aimeos / aimeos-core

Aimeos PHP e-commerce framework for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
https://aimeos.org
Other
3.4k stars 118 forks source link

fix updateStockSelection function #241

Closed switch-cheehau closed 3 years ago

switch-cheehau commented 3 years ago

refer to #240

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-2.3%) to 86.303% when pulling 03fc438a6c5f177a8bcbc7740b0d22e1d3209482 on cgcomputers:fix-updateStockSelection into ebf17e5c191f9dad64f8e146d688a542d94d9712 on aimeos:master.

aimeos commented 3 years ago

There will be an additional problem now because the product code is only unique per site. You should still use the product ID to fetch the product and compare the codes. If the don't match, get the variant article that's attached to that product.

switch-cheehau commented 3 years ago

There will be an additional problem now because the product code is only unique per site. You should still use the product ID to fetch the product and compare the codes. If the don't match, get the variant article that's attached to that product.

Understand, i tried to update the codes, can you help to review? I've tested manually, the stocklevel will deduct normally for selection as well as its variant article.

I don't know how to adapt the tests, might need your advice on it.

switch-cheehau commented 3 years ago

still have a bug. The quantity does not -1 but become zero no matter how many stocks left.

switch-cheehau commented 3 years ago

Sorry, i misunderstand the concept. Will close the this PR.

However the issue still remain for selection product where it does not deduct the stocklevel