Narrative Theme - how to avoid the Add to Cart button (in the product page) to send to cart page?

Highlighted
New Member
1 0 0

Hello guys!

Could you please help me how to avoid the Add to Cart button in the product page to send me directly to cart page? I`d like to stay in product page because my clients frequently buy more then 3 different products, so it`s annoying when then go to cart and need to come back to shop so many times. 

I`d like the Add to Cart button behave like it behaves when the sliding cart drawer is turned on. But I don`t want to turn the sliding cart Drawer on.

Thank you guys!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1062 100 243

Hey there, @BennettParkar 

 

Bo here from Shopify Support! 

 

That is a really great question and it can be achieved with some coding. This tutorial is specific to an unedited version of the Narrative theme, (VERSION 9.0.9). We cannot guarantee results for themes that have been modified with custom coding and/or apps. We suggest hiring a Shopify Expert if you are not comfortable proceeding with the following tutorial, or wish to make any variations to this tutorial.

 

Edit your theme code

To edit your theme code:

 

  1. From your Shopify admin, go to Online Store > Themes.
  2. Find the theme you want to edit, and then click Actions > Edit code.
  3. In the Layout directory, click theme.liquid.

    prodpage02.png

  4. Find the closing </body> tag. On a new line right above the closing </body> tag, paste the following code:

    {% render 'ajaxify-cart' %}

     




  5. Click Save.
  6. In the Snippets directory, click Add a new snippet:

    prodpage05.png

  7. Name your snippet ajaxify-cart, and click Create snippet:

    prodpage06.jpg

    Your new snippet will open in the code editor.

  8. In your new ajaxify-cart.liquid file, paste this code hosted on GitHub.

    Caution: In the pasted code, replace all instances of .size() with .length. The .size() method is depreciated as of JQuery 1.8.

  9. Click Save.

Click here to view a demo store that lets customers stay on the product page when they add products to the cart. Let me know how this goes and if there is anything else I can assist you with, I'm happy to help!

 

All the Best,

Bo

 

Bo | Social Care @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes