Navigation überspringen

[Gelöst] Quantity in toolset views not updating

This support ticket is created vor 3 Jahren, 1 Monat. 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)

Dieses Thema enthält 11 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Luo Yang vor 3 Jahren, 1 Monat.

Assistiert von: Luo Yang.

Author
Artikel
#2218677

I am trying to: Please watch this video: versteckter Link

Link to a page where the issue can be seen: versteckter Link

Thanks
Guido

#2219011

Hello,

Since it is a compatibility issue with the "WooCommerce Min/Max Quantities" plugin, and I don't have a copy of it, please provide a copy of your website in below private message box, you can put the package files in your own google drive disk, share the link only, also point out the problem page URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#2220881

Your duplicator does not work, I have tried these:
1) Install the duplicator package you provided above,
2) Oxygen > Settings > Security > Sign All Shortcodes.
Try the problem page you mentioned above, I see a blank page with below PHP error message:

Notice: Undefined property: WP_Post_Type::$ID in D:\xampp-php7.4\htdocs\hots\wp-content\plugins\oxygen\component-framework\component-init.php on line 611

Notice: Undefined property: WP_Post_Type::$ID in D:\xampp-php7.4\htdocs\hots\wp-content\plugins\oxygen\component-framework\component-init.php on line 689

Notice: Undefined property: WP_Post_Type::$ID in D:\xampp-php7.4\htdocs\hots\wp-content\plugins\oxy-toolbox\modules\navigator\inc\oxygen.php on line 100

There should be other problem in others plugins of your website

3) Deactivate all other plugins, switch to WP default theme, test the single product post in frontend, change the Quantities to 50, and add it to cart, it works fine, can you confirm it?

Is there any missing steps to reproduce the same problem?

#2221353

Hi Luo,

Oh that is strange. I see you are using a local environment and that might be the issue. It's never really the same as online. But should still work though.

Anyway you say you tested the single product page? Why? The issue was never there. The regular shop page the quantity works. The single product page the quantity works also. BUT using the toolset view to show the products with the quantity option then it doesn't work.

Did you try to use the view when you disabled everything else? Did the quantity work then in the view?

Guido

#2223723
Quantity.jpg

I have tested again in my localhost with below steps:
1) Deactivate all other plugins, switch to WP default theme
2) Test the single product post "Stickers" in frontend, I can see the default Quantity value is 50, click button "Add to cart", it works fine, I see below message:
50 × “Stickers” have been added to your cart.

See my screenshot Quantity.JPG

So there should be other compatibility issue in your website, please try as below:
1) deactivate all other plugins, and switch to WordPress default theme 2021, and test again
2) If the problem is fixed, activate other plugin/theme one by one, try to locate the problem plugin

#2224085

Hi Luo,

Oke, you start to annoy me... It seems like you don't listen to me or read what i am writing.

Why are you testing the single product page!!?? There is no issue there!! The issue is in the toolset view that i created!! Not on the single product page or the shop page!!

Grab an empty page and paste the Toolset View shortcode in there. [wpv-view name="app-signage"]

Then test that page with the view shortcode on the front-end. The quantity option within that view doesn't work.

Guido

#2224599

I have tested the problem page URL you mentioned above,
1) Deactivate all other plugins(except Toolset plugins + Woocommerce plugin + WooCommerce Min/Max Quantities plugin), switch to WP default theme
2) Test the problem page URL in frontend:
versteckter Link
In item "Stickers", click button "Add to cart", check the cart page, I can see the default Quantity value is 50

Is there any steps missing? can you check as I mentioned above?
1) deactivate all other plugins, and switch to WordPress default theme 2021, and test again
2) If the problem is fixed, activate other plugin/theme one by one, try to locate the problem plugin

#2224775

Oke this is getting ridiculous...

You are absolutely incapable of dealing with this issue.

Please connect me with your supervisor.

Guido

#2227731

Sorry for the misunderstandings, I have check it again with your duplicator package, it works fine with other plugins/theme deactivated, see my video capture:
versteckter Link

But I can see the problem by these:
create another page, display the post view "app-signage"

I am trying to debug this issue, will update here if find anything

#2227737

The problem is Toolset shortcode [wpv-woo-buy-or-select] does not support "WooCommerce Min/Max Quantities" plugin, you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it.

Currently, you can try below workaround, edit the post view "App Signage", in section "JS editor", add below JS codes:

jQuery( document ).ready(function() {
    var min = jQuery('form[action="?add-to-cart=218"] input[name="quantity"]').val();
	if(min > 1){
      	jQuery('form[action="?add-to-cart=218"] button[type="submit"]').attr('data-quantity', "50");
    }
});

And test again

#2227885

Hi Luo,

Yes the problem was always in the toolset view. I created a custom page with the toolset view shortcode.

The single product page doesn't use the shortcode so no problem. If you disable all other plugins then the "shop" page (/enterprise/buy-products/) will just show the standard woocommerce shop instead of the custom one. So then there is no toolset view shortcode and it will work fine.

It has always just been within the toolset view shortcode that i created.

Anyway the code that you provided works. So thank you for that! I just needed to change one little thing.

In your code you have this part of text:
.attr('data-quantity', "50");

I had to change that to:
.attr('data-quantity', min);

So that it grabs the quantity that is loaded by default. Right now the quantity in woocommerce is set to 50. But if i change that to let's say 40 then with your code it still adds 50. With changing it to "min" it will just grab whatever quantity is loaded on page load.

Thanks
Guido

#2228523

Yes, you are right, I forget to use variable "min", and thanks for sharing the solution.