php - how to add to cart a product with a value multiplied by some amount.?
Get the solution ↓↓↓Solution:
Locate theproduct.tpl
file in your theme folder. There is an<input id="quantity_wanted">
element. You need to update this value according to user input of the product width and height.
Adding to cart will be handled by Prestashop, as it sends{id_product, quantity, id_product_attribute, ...}
to the PHP controller, where quantity is value of "quantity_wanted" input.
So, add two HTML<input>
elements for width and height and process these values using Javascript, which will change "quantity_wanted" input value.
Also think of: providing this functionality inside a module to avoid changing Prestashop core code, storing width and height of each added product, as you will need this information to prepare customer order.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: illegal string offset
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.