Antakarana Posted February 23, 2017 Share Posted February 23, 2017 (edited) Hi everybody! I have detected a strange bug on prestashop. If a customer is placed at frontend and select diferent sizes from a product, the prices and the stock will update while he changes from one size to another... However if I put this customer on a new customer group (Business customers) then the prices and the stock quantities will not be updated while he changes from one size to another... :wacko: :wacko: I think it has to be with the template... So I'm going to install the shop on a test server and change from the installed theme to a the default theme and see how it works... Meanwhile, could anybody gave me a clue about what could be happening? Why it doesn't show correct specific prices or stock when changeing customer's group? thanks in advance Edited February 24, 2017 by Antakarana (see edit history) Link to comment Share on other sites More sharing options...
Antakarana Posted February 23, 2017 Author Share Posted February 23, 2017 OK I've made a new discover... I create a new customer group... and I set a customer from the "business group" to the new one... now it works. I apply the specific prices rules from the "business group" to the to the new customer group and it still works... Now it change back the customer to the "business group" and it stops working again... So it seems that the "business group" has some kind of bug but it has no sense for me... :wacko: Link to comment Share on other sites More sharing options...
Antakarana Posted February 23, 2017 Author Share Posted February 23, 2017 Ok i have discovered when starts the bug... It happens when I set a specific price that will apply to all combinations of sizes... Does anybody know how to fix that? it is maybe due to a known prestashop issue? Link to comment Share on other sites More sharing options...
Antakarana Posted February 23, 2017 Author Share Posted February 23, 2017 I've finnaly got the solution it was a prestashop bug... on /classes/product.php you just have to change this code: https://github.com/studiokiwik/PrestaShop/commit/05b701faa91ee08ce339dcef3cf22bce3037bf5f#comments regards Link to comment Share on other sites More sharing options...
Antakarana Posted February 23, 2017 Author Share Posted February 23, 2017 I have to reopen the thread because the issue was not fixed... It seems that it is a bug that should be fixed since prestashop 1.6.1.5 (I'm using 1.6.0.9) so I installed the product.php file from prestashop 1.6.1.11 into the site... but it didn't fix the problem so I rolled back the product.php from 1.6.0.9 Maybe it has to be with the theme... I will post any news... any help will be apreciated! Link to comment Share on other sites More sharing options...
Antakarana Posted February 24, 2017 Author Share Posted February 24, 2017 It seems I have found the fix thanks to this thread: http://forge.prestas...owse/PSCSX-8036 In summary.. at mytheme/js/product.js there is a line which looks like this: // If a specific price redefine the combination base price if (combination.specific_price && combination.specific_price.price > 0) basePriceWithoutTax = combination.specific_price.price; So I've replaced the avobe code by this one: // If a specific price redefine the combination base price if (combination.specific_price && combination.specific_price.price > 0) { basePriceWithoutTax = +combination.specific_price.price; basePriceWithTax = +combination.specific_price.price * (taxRate/100 + 1); } Now the issue is fixed... so when the user selects between the different combinations of the product, the prices and the stock quantities are updated and shown on real time... Notice that on the first attempt I have had an error message indicating that It was not possible to add the product to the cart, so I have cleaned cache and now it seems to work I will do some test but I think it is definetly solved... Link to comment Share on other sites More sharing options...
Estian Posted August 6, 2020 Share Posted August 6, 2020 (edited) @Antakarana, you are a gentleman. In a community of people too lazy to reply/post you've given us a solution to a problem I'm facing. Thank you. Note that I can no longer access your forge link since I think they've moved to GitHub. Is there a link equivalent perhaps? Edited August 6, 2020 by Estian (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now