Answer the question
In order to leave comments, you need to log in
How to display a percentage discount?
The Product model has two fields: regular price and discounted price. It is necessary to do something so that if there is a discount, the percentage of the discount is also displayed. I think that you need to add a function to the model that will perform mathematical operations, and display the result in a new field of the model. Can this be done in a better way?
Answer the question
In order to leave comments, you need to log in
It is possible, at the stage of editing the price of the product, to record 2 prices and immediately calculated%
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question