Shiny Red Apples

Shiny Red Apples (Personal Blog of Harald Ponce de Leon)

162 notes &

OSCOM v3.0 Intelligent Checkout With Product Types

Checkout Application

The number of steps during the checkout procedure has been drastically reduced with the new Checkout Application. The checkout procedure no longer starts at the shipping page but now heads directly to the confirmation page which takes care of all dependencies for the order.

The new Checkout Application is simply accessed with:

index.php?Checkout

and works exceptionally well with the flexible Product Types implementation to gather all the information required to complete the order.

Product Types

Each product (or product variant) is assigned a Product Type group which define certain conditions that must be met when a Product Type action is called. Examples of Product Type actions are:

AddToShoppingCart
Called when products are added to the shopping cart

PerformOrder
Called when the Checkout Application is initialized

Each Product Type action is assigned one or more modular conditions which are checked in the specified order and return either true or false depending on the condition to meet. Failed conditions can optionally execute an onFail() function to help pass the condition. Example conditions are:

RequireBilling
Passes true if a billing address and billing method is available

RequireShipping
Passes true if a shipping address and shipping method is available

RequireCustomerAccount
Passes true if a customer is logged in with their account

RequireStock
Passes true if sufficient stock is available

Most, if not all, products would need the RequireBilling condition for the PerformOrder action. Physical products for shipping would obviously also need the RequireShipping condition, whereas digital products would not.

Want to force a customer account for orders? That’s possible with the RequireCustomerAccount condition. Should customers be logged in to add certain products to their shopping cart? No problem. Simply assign the AddToShoppingCart action and the RequireCustomerAccount condition to its Product Type group. Done.

Creating new conditions is amazingly simple with developing new modules that check on the conditions to meet.

Here is how the RequireCustomerAccount condition module is developed:

<?php
  namespace osCommerce\OM\Site\Shop\Module\ProductType;

  use osCommerce\OM\Registry;
  use osCommerce\OM\OSCOM;
  use osCommerce\OM\Site\Shop\Product;

  class RequireCustomerAccount {
    public static function isValid(Product $OSCOM_Product) {
      $OSCOM_Customer = Registry::get('Customer');

      return $OSCOM_Customer->isLoggedOn();
    }

    public static function onFail(Product $OSCOM_Product) {
      $OSCOM_NavigationHistory = Registry::get('NavigationHistory');

      $OSCOM_NavigationHistory->setSnapshot();

      osc_redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL'));
    }
  }
?>

Easy.

Intelligent Checkout

The Checkout Application intelligently gathers the information required to process the order. Both RequiredShipping and RequiredBilling would be common conditions to meet for the PerformOrder action, and would operate with the following workflow:

  1. If no shipping address is defined, automatically use the default customer address if one exists or present the new address form.
  2. Automatically select the cheapest shipping method available for the order.
  3. If no billing address is defined, use the shipping address.
  4. Automatically select the first payment method available for the order.
  5. Present payment method on the confirmation page (eg, credit card details).
  6. Provide links to change the shipping address, shipping method (eg, Express Shipping), billing address, and payment method on the confirmation page.
  7. Process the order once confirmed.

For a customer that is logged in, all information required for the order is already available and is directly taken to the checkout confirmation page. For guests, the minimum checkout flow is 2 steps with the shipping address form and confirmation page.

There is still plenty of room for improving the user experience as described previously with mockups of how the Checkout Application can function.

We look forward to extending this flexibility in future releases to also properly support services that are sold with recurring billing.

Community Feedback

Feedback to this blog entry can be posted on the following topic in the community support forums:

http://forums.oscommerce.com/topic/358932-oscom-v30-framework-optimized-for-php-v53/

Filed under oscom30

  1. laserdruckertest2013 reblogged this from haraldpdl
  2. filmes-no reblogged this from oscommerce
  3. metabo-kgs-255 reblogged this from haraldpdl
  4. sex-shop-new reblogged this from haraldpdl
  5. bosch-waschtrockner-wvh-28440 reblogged this from haraldpdl
  6. romanticshop reblogged this from haraldpdl
  7. premium-magento-templates reblogged this from haraldpdl
  8. copywriter-copywriting reblogged this from oscommerce
  9. chandal-adidas-mujer-2012 reblogged this from haraldpdl
  10. laphotos reblogged this from haraldpdl
  11. article-writing-servicex reblogged this from oscommerce
  12. anunturi-gratuite-11 reblogged this from oscommerce
  13. haraldpdl posted this