Hi David,
I hope you're well.
I've got a specific feed where I don't want to use the product price but instead have a generic text like "Check Website".
What would be the best way to do this?
Thank you
Brilliant, thank you David!
If I wanted that 'Check Website' to hyperlink to the merchant's product page, what would that be please?
Hi,
Try this alternative replacement to the above;
global $product;
if ((string)$price==="0.00")
{
if (isset($product["buy_url"])) return "<a href='".tapestry_buyURL($product)."'>Check Website</a>";
return "Check Website";
}
$price = str_replace(".",$config_currencySeparator,$price);
The global $product will pick up for featured products, search results and the price comparison table however is not set where the best price is displayed alongside the product image; let me know if you also require the modification there if using...
Cheers,
David.
--
PriceTapestry.com
Hi David,
Thank you, I tried that code but it made the price field and those fields following it in the price table disappear, and where the featured products on the front were from that merchant, the first appearance of its product made the subsequent html disappear.
Sorry about that, the code should have used tapestry_buyURL() not tapestry_href(). I've corrected the alternative replacement above...
Cheers,
David.
--
PriceTapestry.com
Hi,
One way to do this would be to first use a Search and Replace RegExp filter on the price field for the feed using Search:
/.*/
...and Replace:
0.00
Then in includes/tapestry.php look for the following code at line 308:
$price = str_replace(".",$config_currencySeparator,$price);
...and REPLACE with:
if ((string)$price==="0.00") return "Check Website";
$price = str_replace(".",$config_currencySeparator,$price);
Hope this helps!
Cheers,
David.
--
PriceTapestry.com