Drupal Website Development Practice-Customizing the shopping process

Source: Internet
Author: User
Tags drupal

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.