Anns Abz Posted July 21, 2022 Share Posted July 21, 2022 Hi, i want to increase the total for this product on cart, like 56+10 = 66, i need the output like this. i dont want to change the product price, just need to increase the total here. also want reflect that on order total, etc.. is anyone help me to do this. thanks Link to comment Share on other sites More sharing options...
Ali Samie Posted July 21, 2022 Share Posted July 21, 2022 Can you explain more about what is that number? Is it a fixed number or it is different based on product? Is this going to be added to all items in a cart? Link to comment Share on other sites More sharing options...
Anns Abz Posted July 22, 2022 Author Share Posted July 22, 2022 (edited) @stifler97 thanks for the reply, this number varies for each product. i done that part. but i dont know how to add that amount to this total. specific price concept is also not needed here. i dont want to increase/decrease product price, i want to increase its total, like in the image, product price is 18, and quntity is 3, then i want to add (18*3)+10 if product price is 18, and quantity is 1, then it becomes (18*1)+10 hope you understand what i mean. Edited July 22, 2022 by Anns Abz (see edit history) Link to comment Share on other sites More sharing options...
Ali Samie Posted July 22, 2022 Share Posted July 22, 2022 I have seen such a clean procedure in COD module. They have come up to two solutions, either to add COD fee as a product to the cart or add it to extra shipping cost of carrier. I think this is the easiest way to do this. Otherwise I think you should do some overrides. Link to comment Share on other sites More sharing options...
Anns Abz Posted July 22, 2022 Author Share Posted July 22, 2022 @stifler97 yes i have this module, can you please show me the code for adding extra fee, i didnt find that in this module Link to comment Share on other sites More sharing options...
Ali Samie Posted July 22, 2022 Share Posted July 22, 2022 sorry I forgot to mention it is not the default COD of prestashop. It is named "codfeeplus". Check here: https://github.com/sakgiok/codwfeeplus Link to comment Share on other sites More sharing options...
Anns Abz Posted July 22, 2022 Author Share Posted July 22, 2022 (edited) @stifler97ok, if i alter the getordertotal and add an extra amount to $value variable , something like $value += 10; it will affect on order total? it will cause any other problems? Edited July 22, 2022 by Anns Abz (see edit history) Link to comment Share on other sites More sharing options...
Ali Samie Posted July 22, 2022 Share Posted July 22, 2022 Check the hook methods of the codwfeeplus module for more info. I have not digged into the code before, but I am sure they have used hooks, because there is no override folder in the module, so this is a good news, because it is a best practice. The whole idea is that this either adds the new fee as new product to the cart, or it adds up to the extra shippting cost of the carrier. Now that I am thinking, there is a field for each product as extra shipping cost, you might be able to modify that just before calculating the cart total. Remember to do overrides as the last option. Link to comment Share on other sites More sharing options...
Anns Abz Posted July 22, 2022 Author Share Posted July 22, 2022 @stifler97ok thanks, i will check 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