How to show discount code if using cart drawer or model in the theme?

Question: How to show discount code if using cart drawer or model in the theme?

Solution:

    Rather than displaying your products in a simple list on cart page, ajaxify cart drawer or model will allow adding products to cart in just a one-click operation, without navigating to the product listing page.

    If you have enabled the cart drawer or cart model in the theme and want to show discount applied on the product page after clicking “Add to cart” button then follow below steps for liquid code installation –

    Steps to setup –

    Cart Drawer 

    bogo-cart-drawer-7Cart Model

    bogo-cart-model-6

    Step 1. Log in to Shopify store and navigate to Online Sore > Themes > Click Actions (For published theme) button > Edit code.

    bogo-cart-drawer-5Step 2. Open product-template.liquid file under Sections and find keyword “cart” for add to cart button.

    Step 3. Add below class name in the class attribute of add to cart button or div. Use single blank space before and after this class name.

    aaa_bogo_drawer_add_to_cart

    bogo-cart-drawer-2

    Step 4. If you want to show discount popup after clicking quantity selectors in the cart drawer or model then open file ajax-cart-template.liquid under Snippets. And add the above mentioned class name in class attribute of all the HTML elements associated with quantity selectors.

    bogo-cart-drawer-3

    bogo-cart-drawer-4

    Steps to setup –

    Cart Drawer 

    bogo-cart-drawer-10

    Step 1. Log in to Shopify store and navigate to Online Sore > Themes > Click Actions (For published theme) button > Edit code.

    Step 2. Open product-template.liquid file under Sections and find keyword “cart” for add to cart button.

    Step 3. Add below class name in the class attribute of add to cart button or div. Use single blank space before and after this class name.

    aaa_bogo_drawer_add_to_cart

    bogo-cart-drawer-8

    Step 4. If you want to show discount popup after clicking quantity selectors in the cart drawer then open file theme.liquid under Layout. And add the above mentioned class name in class attribute of all the button tag associated with quantity selectors.

    bogo-cart-drawer-11

    bogo-cart-drawer-9

     

    Steps to setup –

    Cart Drawer 

    bogo-cart-drawer-13
    Step 1. Log in to Shopify store and navigate to Online Sore > Themes > Click Actions (For published theme) button > Edit code.

    Step 2. Open product-form.liquid file under Snippets and find keyword “cart” for add to cart button.

    Step 3. Add below class name in the class attribute of add to cart button or div. Use a single blank space before and after this class name.

    aaa_bogo_drawer_add_to_cart

    bogo-cart-drawer-12

    Step 4. Save.

     

     

    Some themes including Debut, Minimal, Vintage and Simple do not have side cart drawer feature included

    If any theme code is similar to the code of Supply, Boundless and Narrative themes then follow specified steps accordingly.

    Otherwise, add below class name in the class attribute of HTML element or tag associated with “Add to cart” button or “Quantity selectors” if using any customized theme.

     aaa_bogo_drawer_add_to_cart 

    Did this article answer your question?