Because the Commerce module comes with too many steps of the shopping process, the interface is not very beautiful, so it needs to be redesigned.
The transformation of the shopping process into two parts: Shopping cart-"settlement, on two pages." The Shopping cart page can modify the number of items, delete items in the cart, and view the total amount.
The following is about the implementation of the process: the first is the page, using Hook_menu to create a new page, I use the address here is bag, prevent and commerce with the cart conflict.
Hook_menu () { // rewrite shopping cart page array( TRUE, ),}
The Custom_commerce_cart method returns the page content.
function Ajax_plug_commerce_cart () { global$user; $order = commerce_cart_order_load ($user,uid); // Process the product line item in the order //custom_commerce_cart the template name set for Hook_theme. returnarrayarray$line _items)));}
The modification and deletion of the number of items is done through the AJAX request, and the backend calls the Commerce API. The front end uses the ANGULARJS, the Monitoring page action will be more convenient.
For example, modify the number of items, customize a Menu_callback type of menu, through the request to pass the number of items, line item number information, in the background by modifying the line item quantity property, to set the number of items.
Drupal Website Development Practice-Customizing the shopping process