Skip Navigation

[Resolved] woo commerce add to cart bug

This thread is resolved. Here is a description of the problem and solution.

Problem:

When I click "Add to cart"([wpv-woo-buy-options] shortcode), it displays a link "see cart". but this link is /prodcuts/null instead of /cart, giving a 404.

Solution:

It is a compatibility issue with theme file.

Relevant Documentation:

This support ticket is created 4 years, 6 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by pierre-yvesC 4 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1612505
Capture-d’écran,-le-2020-05-05-à-10.52.16.jpg

Hi,

I have a funky bug with Add to cart woo commerce button.

When I click "Add to cart", it displays a link "see cart". but this link is /prodcuts/null instead of /cart, giving a 404.

Any idea?

Many thx

#1613485

Hello,

How do you setup the "Add to cart" button?
Is it shortcode [wpv-woo-buy-options] shortcode?
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-woo-buy-options

If it is, the problem is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

#1614069

Hi,

Thx for your answer.

1) [wpv-woo-buy-options] does not display, so I use [wpv-woo-buy-or-select]

2) wasn't relevant

3) gave me that:
[06-May-2020 15:31:17 UTC] add_to_cart_fragments is deprecated since version 3.0.0! Use woocommerce_add_to_cart_fragments instead.
[06-May-2020 15:31:17 UTC] The WC_Cart::get_cart_url function is deprecated since version 2.5. Replace with wc_get_cart_url.

Interesting, except I have no idea where to change it :oD

#1614757

I assume we are talking about a single product post, please check our document:
https://toolset.com/documentation/user-guides/views/views-shortcodes/#vf-154336
[wpv-woo-buy-or-select] shortcode is for the product listing page, for example Woocommerce shop page.

But [wpv-woo-buy-options] shortcode is for single product post
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-woo-buy-options

so in your case, you need to use [wpv-woo-buy-options] shortcode.

For the problem you mentioned above:

[wpv-woo-buy-options] does not display

The problem is abnormal, please check the compatibility issue first as I mentioned above:
https://toolset.com/forums/topic/woo-commerce-add-to-cart-bug/#post-1613485

If the problem still persists, please provide your website database dump file in below private message box, also point out the problem page URL, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1615523

hidden link
Luo Yang
luoyang@whatever.com
VwReiUcJ)aCB%Y@deKS4xy5D

The page is : hidden link

#1616229

I have removed the credentials from your post, it is not safe to share it publicly.

I can login your website and see the problem, but you are using 12 plugins + a custom theme, as I mentioned above, it might be a compatibility issue, if you need assistance to locate the problem, please backup your website first, then update here, I need to deactivate plugins/theme in your website. thanks

#1616997

Hi Luo,

OK, it's a theme compatibilty issue. Don't know why I didn't see that before.

Many thx, I'll handle it.