Hi David ,
I have a few merchants who are American and it's drawing in a lot of traffic from America. At the moment I have converted everything from those to be Sterling, as the majority of feeds I'm using are English companies.
What I was wondering was if it was possible to do the following.
If I have 2 price fields. One for Pounds and one for Dollars.
Both would pull in the same price from the data feed.
Price converter on one to make is show in pounds. (these three I can handle)
-If a product is made up from just English merchants just show the Pounds price.
-If a product is made up from just an American merchant show Pounds price with the dollar price in a bracket next to it.
-If it's a product with results from English and American merchants, just show the dollar price bracket for the American ones in the price list table (assume this would use the same code to show as it would with the previous two points?)
How would you go about that?
Cheers,
Ben
Hi David ,
Thank you so much. Not how I imagined it would it would be done, but it works perfectly.
Cheers
Ben
Hello Ben,
The first thing that is required would be a look-up table of US merchants that the conditional code can reference at various points. I would suggest adding this to config.advanced.php by adding the following code variable at the end of the script:
$config_usMerchants = array("US Merchant 1","US Merchant 2","etc.");
With that in place, taking the product page first, for the cheapest merchants, as it is possible that there may be more than one and those being a mixture of UK / US, look for the following code _within_ line 28:
<strong><?php print $priceProduct["merchant"]; ?></strong>
...and REPLACE with:
<strong><?php print $priceProduct["merchant"]; ?></strong>
<?php
if (in_array($priceProduct["merchant"],$config_usMerchants))
{
print " ($".$priceProduct["priceusd"].")";
}
?>
And for the price comparison table; the price column is displayed by the following code at line 13:
<td><strong><?php print $config_currencyHTML.$product["price"]; ?></strong>
...REPLACE with:
<td>
<strong><?php print $config_currencyHTML.$product["price"]; ?></strong>
<?php
if (in_array($product["merchant"],$config_usMerchants))
{
print " ($".$product["priceusd"].")";
}
?>
- I've assumed the field "priceusd" in the above code; simply replace throughout the above code with whatever new database field you have used for the USD price.
Cheers,
David.
--
PriceTapestry.com