Why are my virtual options not appearing in the cart? part 2

Our app automatically turns off the Dynamic Checkout Buttons (Paypal buy it now), because they aren’t compatible with our app. Make sure these buttons don’t show if you are using our virtual options. These buttons will allow users to checkout without selecting required options and it will delete our app’s data.

Also by default our app overrides your theme’s Ajax cart.  Ajax carts may delete a lot of our apps data. Make sure the option to turn off Ajax carts is left on in the settings. Click here to read more.

The two problems above are usually the reason why the options aren’t making it to the cart. A less common problem is if the customer is using a browser with JavaScript disabled.

Our app requires JavaScript to run. While JavaScript is enabled in all browsers by default, some people choose to turn it off for various reasons. Shopify will still allow customers to checkout even without JavaScript. If this is causing problems for you, here is a way to fix it.

You’ll need to go edit your current theme by going to Online Store -> Actions -> Edit Code

Next, drill down into the templates to find your add to cart button

In the Minimal theme, I found it by going through these templates:

Templates/product.liquid

Sections/product-template.liquid

The button will look like below.

<button type="submit" name="add" id="AddToCart" class="btn {{ btn_class }}{% if section.settings.enable_payment_button %} btn--secondary{% endif %}">
<span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span>
</button>

To disable the add to cart button on every product, add the disabled attribute to the button so the user can’t add products to the cart without javascript. Our app will enable the add to cart button.

You should only do this if our app is running on every product:
<button disabled type="submit" name="add" id="AddToCart" class="btn {{ btn_class }}{% if section.settings.enable_payment_button %} btn--secondary{% endif %}">
<span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span>
</button><noscript>You need to enable JavaScript to purchase this item.</noscript>

To only disable the add to cart button on certain products, you can use a liquid conditional statement:

<button {% if product && product.handle == 'teapot' %}disabled{% endif %} type="submit" name="add" id="AddToCart" class="btn {{ btn_class }}{% if section.settings.enable_payment_button %} btn--secondary{% endif %}">
<span id="AddToCartText">{{ 'products.product.add_to_cart' | t }}</span>
</button><noscript>You need to enable JavaScript to purchase this item.</noscript>

If a customer doesn’t have javascript installed then the following message will show;

You need to enable JavaScript to purchase this item.

Was this article helpful?
Dislike 0

Pin It on Pinterest