Hi! I want the wholesale price to be calculated in procent of my own purchase price, not the customer price.
If my phurchase price (from manufacturor) is $100 (ex vat), I want the wholesale price to be, let’s say 110% of 100 = $110.
But there is only a “By Percentage of original price” option in the Cathaog Price Rules - Action.
Now there is no attribute called “phurchase price” in Magento, but I can make one. If so, can I use that attribute to calculate the prices for the Wholesales Group? Does the code below has something to do with it? Can I change that somehow so it work the way I want?
If my phurchase price (from manufacturor) is $100 (ex vat), I want the wholesale price to be, let’s say 110% of 100 = $110.
But there is only a “By Percentage of original price” option in the Cathaog Price Rules - Action.
Now there is no attribute called “phurchase price” in Magento, but I can make one. If so, can I use that attribute to calculate the prices for the Wholesales Group? Does the code below has something to do with it? Can I change that somehow so it work the way I want?
The first setting is a drop-down list called Apply. It has four options, which are used by the Mage_CatalogRule module’s helper class to calculate the price:
public function calcPriceRule($actionOperator, $ruleAmount, $price)
{
$priceRule = 0;
switch ($actionOperator) {
case ‘to_fixed’:
$priceRule = min($ruleAmount, $price);
break;
case ‘to_percent’:
$priceRule = $price * $ruleAmount / 100;
break;
case ‘by_fixed’:
$priceRule = max(0, $price - $ruleAmount);
break;
case ‘by_percent’:
$priceRule = $price * (1 - $ruleAmount / 100);
break;
}
return $priceRule;
}
public function calcPriceRule($actionOperator, $ruleAmount, $price)
{
$priceRule = 0;
switch ($actionOperator) {
case ‘to_fixed’:
$priceRule = min($ruleAmount, $price);
break;
case ‘to_percent’:
$priceRule = $price * $ruleAmount / 100;
break;
case ‘by_fixed’:
$priceRule = max(0, $price - $ruleAmount);
break;
case ‘by_percent’:
$priceRule = $price * (1 - $ruleAmount / 100);
break;
}
return $priceRule;
}
Comment