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

Product attributes combination not working in 1.7.6.3 #17345

Closed
PrestaShark opened this issue Jan 24, 2020 · 11 comments
Closed

Product attributes combination not working in 1.7.6.3 #17345

PrestaShark opened this issue Jan 24, 2020 · 11 comments

Comments

@PrestaShark
Copy link
Contributor

@PrestaShark PrestaShark commented Jan 24, 2020

Hi,
Found HUGE bug in product attribute combination... :(
Fresh install 1.7.6.3,
PHP 7.2.11,
Classic theme

1) Setup Hummingbird printed t-shirt product as below
1

2) Setup - do not show unavailable product attributes on product page

3) Go to product and notice that black color in S size should't be available below
2

4) Then change size to M and notice that nothing happend color not changed to Black and White is still available as combination. Also links are the same place
3

5) And boom! Add product to cart...
4

OMFG :(

@khouloudbelguith

This comment has been minimized.

Copy link
Contributor

@khouloudbelguith khouloudbelguith commented Jan 24, 2020

Hi @PrestaShark,

Thanks for your report.
In fact, this issue is similar to this: #9948
But there is a difference between PS1.7.6.2 & PS1.7.6.3
PS1.7.6.2 => behavior as reported here: #9948 => Unable to select product combination, because you need to go via a combination that is out of stock
Size: M - Color: white => out of stock => when we select it => redirection to Size: S - Color: Wight
https://drive.google.com/file/d/1OAPLsm6as9RO6vx7C-TlXNOcCWDD-xPH/view

PS1.7.6.3 => other behavior
`Size: M - Color: white => out of stock => when we select it => no redirection => the URL is not changed => Add to cart button is enabled => regression => NOK
https://drive.google.com/file/d/1ybU7EVxWEcsg9ntIGt7QaMBmIAunbMNB/view

PHP7.2 => Click on add to cart => there is no pop up displayed=> https://drive.google.com/file/d/1q6oEparN6NGdqJrTBd5hPKVpj9DHAM_T/view)

PHP7.1 => click on add to cart => a pop up displayed =>
https://drive.google.com/file/d/1b83jCtjseh1xyGJWZxVBw0wBMzAKYQ6f/view
image => regression => NOK

I’ll add this to the debug roadmap so that it’s fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

@marionf marionf changed the title Product attributes combination not working in 1.7.6.3 - EPIC! Product attributes combination not working in 1.7.6.3 Jan 24, 2020
@marionf marionf added this to Backlog in PrestaShop 1.7.6 via automation Jan 24, 2020
@Danoosh

This comment has been minimized.

Copy link
Member

@Danoosh Danoosh commented Jan 27, 2020

I found the problem.
Open themes/core.js

Search for
(".quickview .product-variants .page-product:not(.modal-open) .row .product-variants").replaceWith(e.product_variants),

And replace it with:
(".product-variants").replaceWith(e.product_variants),

I think this change is about quick view mode that must be check in the previous PRs for a fix.
It seems there is the same issue for product details and info in this file.

@PrestaShark

This comment has been minimized.

Copy link
Contributor Author

@PrestaShark PrestaShark commented Jan 29, 2020

@Danoosh work better but only with option "Display unavailable product attributes on product page -> YES". When NO then nothing better.

@sowbiba sowbiba self-assigned this Jan 29, 2020
@sam-pires sam-pires moved this from Backlog to In progress in PrestaShop 1.7.6 Jan 29, 2020
@sowbiba sowbiba moved this from In progress to To be reviewed in PrestaShop 1.7.6 Jan 30, 2020
@sowbiba sowbiba moved this from To be reviewed to In progress in PrestaShop 1.7.6 Jan 30, 2020
@sowbiba sowbiba moved this from In progress to To do in PrestaShop 1.7.6 Jan 30, 2020
@sowbiba sowbiba added the TBS label Jan 30, 2020
@sowbiba sowbiba moved this from To do to Backlog in PrestaShop 1.7.6 Jan 30, 2020
@MatShir

This comment has been minimized.

Copy link

@MatShir MatShir commented Jan 30, 2020

Hiding product combination that is not available will lead to not be able to access to some product, as explained on the issue #9948
It doesn't make sense to hide some combination because at some point some products will disappear.

The feature could work only if there is one type of combination or when there is no more combination possible for one combination value.
Ex:
t-shirt Black - size M
t-shirt White - size M
t-shirt Black - size S
t-shirt White - size S
If there are no more stocks for S white and S black, the S size combination will be hidden.

That why we should restrain it for only one combination and if it has more the feature won't work.
Thank @khouloudbelguith @PrestaShark for the report and the investigation 😄

@PrestaShark

This comment has been minimized.

Copy link
Contributor Author

@PrestaShark PrestaShark commented Jan 30, 2020

Ok. Let's work with point 4 and 5 of my request.

@sowbiba sowbiba moved this from To do to In progress in PrestaShop 1.7.6 Jan 31, 2020
@sowbiba

This comment has been minimized.

Copy link
Contributor

@sowbiba sowbiba commented Jan 31, 2020

Ok,
The feature show unavailable product attributes on product page is misunderstood
The behaviour is when an attribute doesn't have any product in all possible combinations, it will be hidden or not

For example
S - White => 0
S - Black => 1
M - White => 0
M - Black => 1

In this case, if you select "DO NOT show unavailable product attributes on product page", the white color will be hidden

This feature works well in 1.7.6.3

For the add-to-cart button clickable when an combination doesn't have available product, the proposition is to fix it by disabling the button

For Example
S - White => 0
S - Black => 1
M - White => 1
M - Black => 0

If I choose
S-White => disabled
S-Black => enabled
M-White => enabled
M-Black => disabled

Does it fit your expectations ?

sowbiba added a commit to sowbiba/PrestaShop that referenced this issue Jan 31, 2020
…y to disable add to cart button
@sowbiba sowbiba moved this from In progress to To be reviewed in PrestaShop 1.7.6 Jan 31, 2020
@Progi1984 Progi1984 moved this from To be reviewed to To be tested in PrestaShop 1.7.6 Feb 3, 2020
@Progi1984 Progi1984 added this to the 1.7.6.4 milestone Feb 3, 2020
@Progi1984 Progi1984 removed this from To be tested in PrestaShop 1.7.6 Feb 3, 2020
@Progi1984 Progi1984 added this to Backlog in PrestaShop 1.7.6 via automation Feb 3, 2020
@Progi1984 Progi1984 moved this from Backlog to To be tested in PrestaShop 1.7.6 Feb 3, 2020
@gatto64it

This comment has been minimized.

Copy link

@gatto64it gatto64it commented Feb 7, 2020

Hi ,

(".quickview .product-variants .page-product:not(.modal-open) .row .product-variants").replaceWith(e.product_variants),

if you check this code above in core.js you can see that there is a typo...a coma is missing after .product-variants

so it should be

(".quickview .product-variants, .page-product:not(.modal-open) .row .product-variants").replaceWith(e.product_variants),

sowbiba added a commit to sowbiba/PrestaShop that referenced this issue Feb 7, 2020
@marionf marionf added the Bug label Feb 10, 2020
sowbiba added a commit to sowbiba/PrestaShop that referenced this issue Feb 18, 2020
@ManeeshTiwari01

This comment has been minimized.

Copy link

@ManeeshTiwari01 ManeeshTiwari01 commented Feb 21, 2020

I am using ps 1.7.6.3 I have the same problem. but when I updated my core.js file it is working fine.

(".quickview .product-variants .page-product:not(.modal-open) .row .product-variants").replaceWith(e.product_variants),
if you check this code above in core.js you can see that there is a typo...a coma is missing after .product-variants

so it should be

(".quickview .product-variants, .page-product:not(.modal-open) .row .product-variants").replaceWith(e.product_variants),

Thanks Support team .

Best Regards
Maneesh Tiwari

@PrestaShark

This comment has been minimized.

Copy link
Contributor Author

@PrestaShark PrestaShark commented Feb 21, 2020

Sorry "comma" solution with disabled option to not show unavailable product combinations works like below

https://drive.google.com/file/d/1WdxLjbqnQoZ5E8MfIxFkkWxGWdQ7fmo3/view?usp=sharing

(Size: S, Color: White) and (Size: M, Color: Black) are available in that case.

Can't choose size M, can't choose color Black.

Case need more investigation. Thanks!

@ManeeshTiwari01

This comment has been minimized.

Copy link

@ManeeshTiwari01 ManeeshTiwari01 commented Feb 21, 2020

It's working for me.
check this link

https://www.loom.com/share/8de02a51b17642d4b9076aa7cce3e92b

Best Regards
Maneesh Tiwari

@PrestaShark

This comment has been minimized.

Copy link
Contributor Author

@PrestaShark PrestaShark commented Feb 21, 2020

Do You have exact setup as below?
presta1

Preferences -> Produtcts -> Product page
(Display unavailable product attributes on product page set as NO)
presta2

sowbiba added a commit to sowbiba/PrestaShop that referenced this issue Feb 28, 2020
@Robin-Fischer-PS Robin-Fischer-PS moved this from To be tested to To be merged in PrestaShop 1.7.6 Mar 2, 2020
@marionf marionf added Fixed and removed To Do labels Mar 2, 2020
@marionf marionf closed this Mar 2, 2020
PrestaShop 1.7.6 automation moved this from To be merged to Done Mar 2, 2020
matthieu-rolland added a commit to matthieu-rolland/PrestaShop that referenced this issue Mar 2, 2020
matthieu-rolland added a commit to matthieu-rolland/PrestaShop that referenced this issue Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

10 participants
You can’t perform that action at this time.