Skip Navigation

[Resolved] Woocommerce add to cart button on single product template

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 2.12 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by kristoferJ 5 years, 2 months ago.

Assisted by: Nigel.

Author
Posts
#1336385

I am trying to: Add cart button on single product page which uses a content template with Divi builder. Product body description is showing up properly with shortcode [wpv-post-body view_template="None"], however cart button is not showing up when used [wpv-woo-buy-options add_to_cart_text="Purchase me"]. When I use another shortcode [wpv-woo-buy-or-select add_to_cart_text="Add to basket"] button is displayed but redirects to the same page itself when clicked.

I expected to see: I want it to add sample either with ajax or should redirect to cart page.

#1336505

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Kristofer

The wpv-woo-buy-or-select shortcode is for use on product listings page (e.g. the shop page), while wpv-woo-buy-options is the correct shortcode for the Add to cart button on single product pages, so that's the one we should expect to work.

Can you check if it works without using Divi to design the template?

So, make a new test content template, and just add a couple of shortcodes such as the price and the add to cart button.

Don't assign it to any products (so as not to unassign your existing template).

Now edit one simple product, and change that single product to use the test template.

Check on the front end whether that works okay.

Can you let me know?

#1339541
Screenshot_3.jpg
Screenshot_2.jpg
Screenshot_1.jpg

I have tested this out as mentioned above. Weird results, I created a new test content template without using the Divi builder. Used 2 shortcodes product price and single product page add to cart button. Created a test product with a simple product, assigned a new content template, it resulted in a layout with Divi builder and 2 add to cart button instead of price and cart. Again these 2 cart buttons are refreshing to same product page. I have made sure that the cart & checkout page is created with original woo commerce cart & checkout shortcodes.

Do I need to use shortcodes from the toolset for cart and checkout pages? Why this new product page is using builder template when I have not used it at all? Again why cart button is not working if it should work with original woo-commerce shortcode for cart and checkout pages?

#1339591

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

What are your settings for the single product template, at Toolset > WooCommerce Views?

I think I'll need to look at your site to try and understand what's happening.

Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site.

#1344039
Screenshot_4.jpg

It is using WooCommerce Views plugin default single product template (single-product.php)

#1344155

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry, I thought I had set up a private reply to get your site credentials, let me try that again.

#1348003

My issue is resolved now. Thank you!