Fields: Price and Sale Price for Layouts

Learn how to use the fields sale and sale_price on a layout

If our mission is to add a price field to our layout, once we are inside the layout edit screen we will have to go to menú > text. But probably we are gonna find several price options. So, which should be selected? Let´s find out! 

Price

Sale Prices

Now, let´s see how it works with sale prices:

But what about showing the percentage discount instead of the price? 

 

Percentage Discount

percentage_discount shows the discount that has an item.

Our systemm calculate it automatically: 

( ( price - sale_price ) / sale_price ) * 100.

 

Example: Price: 200, sale price 160

percentage_discount = ( ( 200 - 160 ) / 200 ) * 100 = 20.

 

Easy, doesn´t it?