Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility for grouped products #21

Closed
nielslange opened this issue Mar 30, 2020 · 7 comments · Fixed by #23 or #28
Closed

Add compatibility for grouped products #21

nielslange opened this issue Mar 30, 2020 · 7 comments · Fixed by #23 or #28

Comments

@nielslange
Copy link
Owner

nielslange commented Mar 30, 2020

Reported in https://wordpress.org/support/topic/input-value-incorrect/#post-12604475:

If min value is 0 like with grouped products no value is shown at all and buttons don’t work untill u manually insert a value.

I solved it by changing inside quantity-input.php;

value="<?php echo esc_attr( $input_value ); ?>"

to

value="<?php echo esc_attr( $min_value ); ?>"

After this change simple and grouped products both work as expected.

Using latest woocommerce and plugin..

Please change it in future update

@nielslange nielslange changed the title Check compatibility with grouped products Add compatibility to grouped products Mar 31, 2020
@nielslange nielslange changed the title Add compatibility to grouped products Add compatibility for grouped products Mar 31, 2020
nielslange added a commit that referenced this issue Mar 31, 2020
#21: Add compatibility for grouped products
@Jeroenleender
Copy link

after updatting to 1.15 the problem is back....

@nielslange
Copy link
Owner Author

after updatting to 1.15 the problem is back....

Damn it! 🤦‍♂ Sorry for that, @Jeroenleender. I wasn't able to reproduce this issue in the first place and thought that with 1.14 it would be fixed, which apparently it was. However, 1.14 seem to break functionality for non-grouped products. That's why I deployed 1.1.5.

The issue that you are facing is that when using grouped products, no quantity is visible at all, right?

@Jeroenleender
Copy link

When u open a grouped product and get an overview of simple products, the default value should be 0.
Your current option can't handle zero values so it won't show any number. + and - buttons don't work then untill u add a number yourself as a value.

@Jeroenleender
Copy link

When i use my fix all my grouped and simple products work correctly.
I can't test variable products tho.

@nielslange
Copy link
Owner Author

That's good to know. Thus, I need to figure out how to detect whether a product is a grouped product. If so, handle the logic of 1.14, otherwise handle the logic of 1.1.3 resp. 1.1.5. Shouldn't be too complicated to implement. Sorry for the inconvenience caused by the latest release, though. For the time being, you could use WP Rollback to rollback my plugin to the previous version until I release 1.16.

@Jeroenleender
Copy link

Jeroenleender commented Apr 2, 2020

if( $product->is_type( 'simple' ) )
since they are simple products would work, but this also effects normal simple products.
So i think what would be better is to check the array and see if something matches like child parent connection that doesnt include normal simple products.

For myself i just used he former fix on the latest patch since that also works

@Jeroenleender
Copy link

Jeroenleender commented Apr 2, 2020

or maybe something like this.....

if( $product->is_type( 'simple' ) && $input_value == '' )

nielslange added a commit that referenced this issue Apr 4, 2020
nielslange added a commit that referenced this issue Apr 4, 2020
#21: Fix grouped products issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants