This is my approch to dealing with this, allbeit a simple approch - We start with a site using a single currency as an example.
If you go to ISC - Admin > Products > View Products > Edit (any product) > Pricing Options (other price options)
You arrive here -

As you can see, you are able to enter the 'actual' Price of a product as well enter figures into 'Cost Price'. It is the input shown with an asterix you initally see public side and it is this that site maths (sale/ discounts/ VAT etc.) are calculated from. Cost Price when input, is nothing more than admin referance and hidden from public view. But my point is, this means both prices are now known for a product by ISC.
The graphic example below shows retail price and a lower cost price along side each other and is what we are trying to achieve.

Go to lib/pricing.php and locate –
Code: Select all
if($doLocaleFormat) {
// Does this product have a RRP?
if ($actualPrice > 0 && $actualPrice < $product['prodretailprice'] && $strikeOutRetail == true) {
$rrp = CalcProdCustomerGroupPrice($product, $product['prodretailprice']);
$rrp = ConvertPriceToCurrency($product['prodretailprice']);
$output .= '<strike>'.FormatPrice($rrp).'</strike> ';
}
}
if ($product['prodsaleprice'] > 0 && $product['prodsaleprice'] < $product['prodprice']) {
$output .= '<span class="SalePrice">'.FormatPrice($actualPrice).'</span>';
} else {
$output .= FormatPrice($actualPrice);
{
Code: Select all
if($doLocaleFormat) {
// Does this product have a RRP?
if ($actualPrice > 0 && $actualPrice < $product['prodretailprice'] && $strikeOutRetail == true) {
$rrp = CalcProdCustomerGroupPrice($product, $product['prodretailprice']);
$rrp = ConvertPriceToCurrency($product['prodretailprice']);
$output .= '<strike>'.FormatPrice($rrp).'</strike> YYY<br/>';
}
}
if ($product['prodsaleprice'] > 0 && $product['prodsaleprice'] < $product['prodprice']) {
$output .= '<span class="SalePrice">'.FormatPrice($actualPrice).'</span> ZZZ '.FormatPrice($product['prodcostprice']).' ';
} else {
$output .= FormatPrice($actualPrice).' XXX '.FormatPrice($product['prodcostprice']).' ';
}
Now you go back to the Pricing Options page and complete the information required to make this mod relevant. Price is now wholesale price of a Pack. The other wise hidden element Cost Price now is entered.
The Products page will now show –

And by example, the Products detail page now shows –

Next we take a look at extending this process to a site using more than one currency.
The cost price of a product when entered, maybe used within ISC, but as we now know, not in a public capacity. This means when we use the array at point of display, it is very much stand alone and will not convert between currencies when asked.
So we now need to add this ability. Locate the section –
// Calculate the actual price for this product in the current currency
if($doCurrencyConvert == true) {
$actualPrice = ConvertPriceToCurrency($actualPrice);
}
And below this add –
$packPrice = CalcRealPrice($product['prodcostprice'], $product['prodretailprice'], 0, $product['prodistaxable']);
$packPrice = CalcProdCustomerGroupPrice($product, $packPrice);
And now we need to reflect these included lines into the script at point of display. The section below will be familiar (shown above). You can simply cut and past over your existing code, but the modification is –
Code: Select all
if($doLocaleFormat) {
// Does this product have a RRP?
if ($actualPrice > 0 && $actualPrice < $product['prodretailprice'] && $strikeOutRetail == true) {
$rrp = CalcProdCustomerGroupPrice($product, $product['prodretailprice']);
$rrp = ConvertPriceToCurrency($product['prodretailprice']);
$output .= '<strike>'.FormatPrice($rrp).'</strike> Reduced<br/>';
}
}
if ($product['prodsaleprice'] > 0 && $product['prodsaleprice'] < $product['prodprice']) {
$output .= FormatPrice($packPrice).'/Item '.'<span class="SalePrice">'.FormatPrice($actualPrice).'</span>/Pack';
} else {
$output .= FormatPrice($packPrice).'/Item '.FormatPrice($actualPrice).'/Pack';
}