Skip Navigation

[Resolved] Some products trigger 404 errors when adding them to the cart

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.

This topic contains 8 replies, has 3 voices.

Last updated by Jamal 2 months ago.

Assigned support staff: Jamal.

Author
Posts
#1798805

I have recently had my site tallshipsnetwork.com migrated to a new server, at which point I am experiencing an issue with the Woo Buy or Select shortcode - it allows some products to be added to cart, but not others

#1798857
#1798869

Here's adding the links for you to view the issue yourself when testing:

The shortcode is added in the Content Template 'Product for a Trip'

The Products are displayed on a Trip CPT Page (Content Template 'Single Trip') through the view 'Products for a Trip'.

If you go to hidden link you'll see two products that are successfully being added to the cart when clicking 'Provisionally Book'.

If you go to hidden link you'll see the Product that are not being added to the cart when clicking 'Request Application/s'.

Beside each of the product names you'll see an 'Edit' link beside the Product Names so you can quickly access them in wp-admin to check stock etc.

I have tried the following:
- Removing the '/' from the shortcode text output
- removing the conditionals and displaying the shortcode only once in the content template

All of the above was working correctly pre-migration.

Thanks!

#1801653

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and my apologies for the late reply.

I tried to understand the origin of this issue to no avail. It seems that you have some custom logic defined in your theme. And I could not find what would integrate with WooCommerce add-to-cart process.
In fact, if you switch to the TwentyTwenty theme, the problem does not persist. And I was able to add the product to the cart and be redirected to the cart page.

Investigating custom code is out of the scope of our support forum https://toolset.com/toolset-support-policy/
I'll suggest reaching to the developer of your theme and asking for assistance. We'll remain at your service if you find a bug on the Toolset plugins.

#1801785

Hi Jamal,

Thank you for taking a look - after your response I investigated my validation code snippets once again and found the issue preventing add to cart (in some circumstances, the $passed variable was not returned on woocommerce_add_to_cart_validation).

However, I still have an issue whereby the woo-buy-or-select button doesn't output the quantity selector despite the show_quantity_in_button being set to 'yes'.

[wpv-woo-buy-or-select show_quantity_in_button='yes' add_to_cart_text='Provisionally Book']

Are you able to see any clear reason why the quantity selector is not appearing?

Thanks,

James.

#1801793

If I add the code at https://docs.woocommerce.com/document/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/ then this displays the quantity selector when using [wpv-woo-buy-or-select show_quantity_in_button='yes']

Should I need this code or should the quantity selector be displaying without it given the shortcode I'm using?

#1802053

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I just tried on my test site and I was not able to add the quantity selector. Let me check again on a clean install rather than mine which includes 3rd party plugins and themes.
If it is a general bug, I'll escalate it to our developers for another evaluation and will let you know.

As of now, the workaround that you shared works for me too.

#1802747

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

I was able to reproduce this on a clean install, so I am approaching our 2nd Tier to check this further.

I'll get back to you as soon as possible.

#1879233

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Jamal is on Vacation. This is Minesh here and let me step in here.

I would like to share the errata page where you can see the information when the fix will be proposed.
=> https://toolset.com/errata/not-possible-to-include-quantity-in-add-to-cart-button/

#2025095

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello again,

This issue has been fixed and released in this week's update of Toolset plugins. Please make a full backup and update Toolset plugins to the latest version.
https://toolset.com/download/toolset-woocommerce-views/#changelog

Let me know if you need further assistance.