v1.6-v1.7-v8x BugFix - ETS Extra Option v1.2.7 corrected version

chibi

Well-known member
Diamond
Elite
XNullUser
Joined
Aug 12, 2021
Messages
151
Reaction score
453
Points
63
NullCash
1,467
Hi there!

There's a really problematic bug in this module, causing inconsistent behaviour in the shopping basket.
It doesn't always happen, but sometimes when an option is added to a basket and the equivalent product without the option is also added, things happen such as an inconsistency in behaviour when deleting/modifying the quantity, which can then delete all the products when the product with the option is deleted from the basket.
And as a result, when this isn't the case, the product without option may even be removed from the basket when it falls below a certain quantity. (For example, if you want to go from 5 to less, it will just be deleted, and if you add 1, it will add 5 again, with same problem, even if user disconnect or clean cookies in webbrowser).

To check whether you have any inconsistencies in the database and correct this behaviour, here are a few SQL queries and file modifications to make, and the modified module is ready to use.

Look if bad is present in database with this SQL Check :

Code:
SELECT cp.*, ec.quantity AS eto_quantity
FROM ps_cart_product cp
LEFT JOIN (
    SELECT id_cart, id_product, id_product_attribute, SUM(quantity) AS quantity
    FROM ps_ets_eto_cart
    GROUP BY id_cart, id_product, id_product_attribute


If there are inconsistencies, correct them :

Code:
DELETE FROM `ps_ets_eto_cart`
WHERE (id_cart, id_product, id_product_attribute) NOT IN (
    SELECT id_cart, id_product, id_product_attribute FROM `ps_cart_product`
);

DELETE FROM ps_cart_product
WHERE (id_cart, id_product, id_product_attribute) NOT IN (
    SELECT id_cart, id_product, id_product_attribute
    FROM ps_ets_eto_cart
);


Edit ./modules/ets_extraoptions/classes/ets_eto_attribute_cart_class.php dans replace with :

(look in file ReadMe.txt with the module for the bugfix, i can not share topic with more than 5000 characters -_- )


I'm not really a dev, so if you have a better fix, share it ! =D
Original php file is still in module with "ets_eto_attribute_cart_class.php.originalfile" name

For people which just want click & go, you can download modded module and test it.
If you have bought this module, please report this bug.

--

Create global extra options & price impact for each option applies to all existing products at ONE time. Add custom product attributes; display by checkbox, radio, or drop-down menu. Faster and easier to manage than PrestaShop default attributes.

 

Attachments

  • v1.2.7-ets_extraoptions-bugfix.zip
    205.9 KB · Views: 12
  • ReadMe.txt
    6.6 KB · Views: 8
Last edited:

cmrcmr

Well-known member
Master
Diamond
Elite
XNullUser
Joined
Sep 6, 2019
Messages
1,050
Reaction score
1,354
Points
113
NullCash
7,296
Muchas gracias por compartir este modulo :D
 

Salvacal

Well-known member
Master
Diamond
Elite
Joined
Mar 21, 2020
Messages
486
Reaction score
1,067
Points
93
Location
Italy
NullCash
7,493
Thank you for sharing ! ;)
 

malaysianen

Member
XNullUser
Joined
May 8, 2024
Messages
207
Reaction score
13
Points
18
Location
US
NullCash
153
thank you for your work .that is great
 

devm

Member
XNullUser
Joined
Jan 19, 2022
Messages
254
Reaction score
0
Points
16
NullCash
7
Thank you very much! This is very useful module!
 

flsh14

Active member
Elite
XNullUser
Joined
Apr 13, 2020
Messages
133
Reaction score
138
Points
43
NullCash
361
Hi there!

There's a really problematic bug in this module, causing inconsistent behaviour in the shopping basket.
It doesn't always happen, but sometimes when an option is added to a basket and the equivalent product without the option is also added, things happen such as an inconsistency in behaviour when deleting/modifying the quantity, which can then delete all the products when the product with the option is deleted from the basket.
And as a result, when this isn't the case, the product without option may even be removed from the basket when it falls below a certain quantity. (For example, if you want to go from 5 to less, it will just be deleted, and if you add 1, it will add 5 again, with same problem, even if user disconnect or clean cookies in webbrowser).

To check whether you have any inconsistencies in the database and correct this behaviour, here are a few SQL queries and file modifications to make, and the modified module is ready to use.

Look if bad is present in database with this SQL Check :

Code:
SELECT cp.*, ec.quantity AS eto_quantity
FROM ps_cart_product cp
LEFT JOIN (
    SELECT id_cart, id_product, id_product_attribute, SUM(quantity) AS quantity
    FROM ps_ets_eto_cart
    GROUP BY id_cart, id_product, id_product_attribute


If there are inconsistencies, correct them :

Code:
DELETE FROM `ps_ets_eto_cart`
WHERE (id_cart, id_product, id_product_attribute) NOT IN (
    SELECT id_cart, id_product, id_product_attribute FROM `ps_cart_product`
);

DELETE FROM ps_cart_product
WHERE (id_cart, id_product, id_product_attribute) NOT IN (
    SELECT id_cart, id_product, id_product_attribute
    FROM ps_ets_eto_cart
);


Edit ./modules/ets_extraoptions/classes/ets_eto_attribute_cart_class.php dans replace with :

(look in file ReadMe.txt with the module for the bugfix, i can not share topic with more than 5000 characters -_- )


I'm not really a dev, so if you have a better fix, share it ! =D
Original php file is still in module with "ets_eto_attribute_cart_class.php.originalfile" name

For people which just want click & go, you can download modded module and test it.
If you have bought this module, please report this bug.

--

Create global extra options & price impact for each option applies to all existing products at ONE time. Add custom product attributes; display by checkbox, radio, or drop-down menu. Faster and easier to manage than PrestaShop default attributes.

thank you so much, i will test it
 

hegBIT

Well-known member
Master
Diamond
Elite
XNullUser
Joined
Mar 30, 2021
Messages
1,025
Reaction score
965
Points
113
NullCash
3
Thanks for your work and for improving this module
 

lotus00

Member
XNullUser
Joined
Feb 4, 2024
Messages
92
Reaction score
0
Points
6
Location
France
NullCash
2
için Bunu paylaştığınını, paylaşım için teşekkürler. Pençe
 

ses333

Well-known member
Diamond
Elite
XNullUser
Joined
Aug 21, 2021
Messages
365
Reaction score
370
Points
63
NullCash
288
Thanks for this great module on global management of paid options
 

unique

Well-known member
Diamond
Elite
XNullUser
Joined
Dec 12, 2020
Messages
2,834
Reaction score
481
Points
83
NullCash
1,181
Thanks for your work and for improving this module
 

yog78

Active member
XNullUser
Joined
May 25, 2021
Messages
1,047
Reaction score
6
Points
38
NullCash
3,275
Thank you for this improvement for the module.
 
Top