Shop Template lets you ad to cart without selecting a variable

We are using one of the minimal woocommerce shop templates on JDT-industrial.co.za - on the shop page when you hover over a product, the “Add to cart” button appears and lets you add a product to your cart without you selecting a variable so how does the customer know which variation they have purchased/ordered if it doesn’t ask them?

See attached is a reference image of the “Add to Cart” Button I’m referring to - on the apples product

Please advise so the customers can actually select a variable before they checkout

Hello Gregory,

Thanks for writing in! The “Add to Cart” buttons will only work on simple products. If you have variable products, you would need to do this:

1.) Edit your Shop layout and
2.) Duplicate the “Add to Cart” button and rename it to “View Product”.
3.) On your “Add to Cart” button, add a condition that it will only display when the product is simple.

4.) The “View Product” button should be linked to the product page and then has a condition of:

Hope this makes sense.

Thank you so much for your solution - this worked absolutely perfectly and i applied it the price attribute to show the price is “Starting from” on variable products and is a set price of simple products - Thank you very much!

Hi Gregory,

Glad that we are able to help you.

Thanks

sorry just to confirm - the button was still adding to cart - im assuming i must change the shortcode to “{{dc:woocommerce:product_url}}” but when I do this it is still just adding to cart - please advise - thanks in advance

Hello? Please advise on the dynamic code
There has not been an update to this in 2 days?

Hello Gregory,

Please provide access to the site so I can check your layout and the Button element settings. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Thank you in advance.

Please see secure note.

Hello Gregory,

For the “View Product” button, you will have to remove any custom attribute and only put a link to the product page instead.

Hope this makes sense.

Thank you for that - the last thing i nee to achieve on this website is an infinite product load ability so as people scroll it loads more products rather than there being a pagination - is this possible?

Hello Greg,

It may be possible with custom coding involved and the Jetpack’s Infinite Scrolling feature. Check out this old thread:

Be advised that custom coding is beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.

Thank you for your understanding.

okay and how does this work with your templates - your template automatically sets a pagination

Hello Greg,

It is not the template that sets the pagination. The WooCommerce loop returns only 10 or a number set in the settings. The Pagination element is there to navigate to the WooCommerce loop index. The Jetpack’s Infinite Scrolling feature works along with the WordPress Loop index to make it happen.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.