Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento - The difference between setCustomPrice, setPrice, setOriginalCustomPrice etc [closed]

Tags:

php

magento

Can anyone clarify the difference and purpose of all the different pricing rules in Magento?

For example there's setPrice, setOriginalPrice, setCustomPrice, setOriginalCustomPrice, setSpecialPrice, setFinalPrice etc. but without guessing it's not entirely clear each one's purpose and usage.

like image 772
Lewis Avatar asked Aug 28 '12 10:08

Lewis


1 Answers

The different fields are required due to the way the rule/quote system works.

A product/quote will be passed through each matching rule, which in turn could modify the price the customer is going to pay. The system still need to know the original prices so it can report correctly on % savings etc.

Price: this is the price you enter in the magento admin for the product

originalPrice: keeps an unmodified version, as price may be changed during the process.

customPrice: this can be set when you make an order in the backend, you may want to give a special one off price to someone, this would override the price

originalSpecialPrice: unmodifed version, as it could be changed/ affected by rules etc along the way as the price does

specialPrice: is a price used to allow you to show discounts, this will be used against the price, and then percentage saving etc is calculated from the difference.

You wouldn't really need to set any of those values programmatically though, maybe if you're creating some custom rules etc.

like image 184
Andrew Avatar answered Sep 18 '22 06:09

Andrew