Shopify themes, liquid, logos, and UX
Hi all,
I see it was asked by a few people before but doesn't work with my theme.
I use a modified Minimal theme.
When I add to cart a product, Shopify automatically leaves the product page and opens a cart page. I would like to turn off this feature. I do not have this option in my settings, looks like it's something in the code.
It doesn't happen when I preview with other themes.
Are there any ideas how I can change this?
Thanks a lot.
P.S. Not sure if it helps, this is the piece of code for the add to cart button in my product page:
{% form 'product', product, class: productform_class %}
<button type="submit" name="add" id="AddToCart" class="btn {{ btn_class }}{% if section.settings.enable_payment_button and product.selling_plan_groups == empty %} btn--secondary{% endif %} cart-button">
<span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span>
</button>
{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}
Solved! Go to the solution
This is an accepted solution.
Hi all, just want to leave it for the record.
I added the following line to the button code and it worked:
<input type="hidden" name="return_to" value="back" />
Final add to cart code looks like this now:
{% form 'product', product, class: productform_class %}
<button type="submit" name="add" id="AddToCart" class="btn {{ btn_class }}{% if section.settings.enable_payment_button and product.selling_plan_groups == empty %} btn--secondary{% endif %} cart-button">
<span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span>
<input type="hidden" name="return_to" value="back" />
</button>
{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}
This is an accepted solution.
Hi all, just want to leave it for the record.
I added the following line to the button code and it worked:
<input type="hidden" name="return_to" value="back" />
Final add to cart code looks like this now:
{% form 'product', product, class: productform_class %}
<button type="submit" name="add" id="AddToCart" class="btn {{ btn_class }}{% if section.settings.enable_payment_button and product.selling_plan_groups == empty %} btn--secondary{% endif %} cart-button">
<span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span>
<input type="hidden" name="return_to" value="back" />
</button>
{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024