Drupal Commerce provides highly customizable "Shopping Cart" block which can be placed anywhere on site , using block , showing cart contents on all pages, and the ability for customers to add or remove cart contents.
Shopping cart lets customers continue browsing the website but still know how many items has been added to their shopping cart and manage their current order.
Both the block and checkout page are quite dynamic, and can easily be customized via the Views user interface and themed to match your site, just like any other listing built in the View module.
Your shopping cart and checkout process should look great right out of the box. But everybody wants something a little different and so there is a lot you can do to make your cart page unique to your store. We'll outline the tweaks which are available below so you can personalize your cart to just how you like it. The html markup as well as the associated stylesheets of Cart Block can be easily adapted to match existing theme style.
The shopping cart is represented by a Drupal block shown in figure 1 that consists of a View Listing(fig 2) the line items on the cart order with a footer summarizing the items on the order and linking to the cart page and checkout form.
Fig 1 - A Collapsible Shopping Cart showing number of items per product and cost
modules\contrib\commerce\modules\cart\templatesto your theme folder. For better folder organization you can copy these files to
Shopping cart Summary view allows you to easily manipulate cart fields it works seamlessly out of the box.
Fig 2 - The default shipping cart block is entirely configurable via the Views user interface
Often you might find yourself undoing what the core cart stylesheets have defined. Instead of fighting with styles, you can actually replace or outright remove the stylesheet using your theme's
info.yml file. Below we walk you through the process
commerce_cart.theme.css files provide the styling which you can override in your own stylesheets using regular Drupal theme procedures. To override the cart stylesheet you can add following to your
libraries-override: commerce_cart/cart_block: css: layout: css/commerce_cart.layout.css: css/commerce_cart.layout.css
Or to completely disable the Cart stylesheet
libraries-override: commerce_cart/cart_block: css: layout: css/commerce_cart.layout.css: false
In this case the file has been overridden with false.
Fig 3 - illustrates how you can turn Shopping Cart into a fully custom shopping cart
Found errors? Think you can improve this documentation? edit this page