is there a way to make the voucher link (view qualifing products link) go direct to the merchant homepage , wasnt sure if this was possible as there is no where this link is stored
Hi David , i have tried this but it just displays the link as text
I want the link "Search Qualifying Products" to go straight to merchant.
the voucher.php script has been turned into an external script that is pasted into a widget in wordpress if that makes any difference? (so it just has the calling code of the various files needed included)
Hi Jonny,
Could you email me your modified vouchers script and I'll chec it out for you...
Cheers,
David.
--
PriceTapestry.com
Hi David , trying to do this again but i cant remember what i done or find the email.
any chance u can remember? got it all working apart from the link to use the discount still searches for the products on site instead of going straight to the merchant
I have tried using files from another site that uses this mod but still cant get the link to work??
Hi jonny,
I just noticed that the modification described above is incorrect, the correct replacement is:
if (substr($voucher["discount_text"],0,4)=="http")
{
$vouchers[$k]["href"] = $voucher["discount_text"];
}
}
$coupons["vouchers"] = $vouchers;
(corrected in the post above also) Notice the additional closing brace - } - this ensures that the $vouchers[$k]["href"] override is within the foreach loop - that should be all it is...
Cheers,
David.
--
PriceTapestry.com
cheers , that dont work , think we had the same problem last time , and you added a link box to the voucher_code_edit.php file?
so you just add the link there , the below is the voucher_code_edit.php from my other site that it works on as you will see the added link box at the bottom.
I have tried this file on the other site and the box is there but the link wont work , or save when editing a voucher
really stumped at what is now different??
{code saved}
Hi Jonny,
It sounds like just a database mod missing to add the `link` field to the vouchers table. The following dbmod.php should do the trick:
<?php
require("includes/common.php");
$sql = "ALTER TABLE `".$config_databaseTablePrefix."vouchers`
ADD `link` VARCHAR(255) NOT NULL";
database_queryModify($sql,$result);
print "Done.";
?>
Save the above as dbmod.php, upload to the top level folder of your Price Tapestry installation, browse to dbmod.php once, and then delete the file, and your voucher codes modification from your previous post should work fine..!
Cheers,
David.
--
PriceTapestry.com
yep that works , sort of
if i add www.example.com as the link though i get mysite/www.example.com
Hi Jonny,
Always make sure that you start a link with http:// otherwise the link will be treated by the browser as relative to your website, which is why you will be seeing mysite/www.example.com etc. - that should be all it is!
Cheers,
David.
--
PriceTapestry.com
Hi David, will this mod work with the latest version of pricetapestry?
I have tried but where you add the voucher in admin there is no extra field to enter the link direct to the merchant , i ran the dbmod.php etc
cheers
Hi Jonny,
It sounds like two different mods - the main modification described above is regarding making the Discount Text field act as an override link for the voucher rather than linking to the Price Tapestry generated search results for that voucher code...
So, by entering a Discount Text field value beginning http:// on the configuration page for a voucher that will be used as the link.
If you would like the separate Link field rather than re-purposing the Discount Text field, if you could drop me an email I'll reply with the appropriate modification together with the required changes in vouchers.php to make use of that field...
Cheers,
David.
--
PriceTapestry.com
Not to worry , you have just reminded me what I need to do , all sorted
cheers
Is it possible to create an extra field for voucher codes where I can include a link to the voucher's merchant homepage? The text would be "Shop Now".
Hi bat,
What some users do which is a very easy mod with no database modification, and allows you to create generic "merchant homepage" links (make sure they're your affiliate link!!) anywhere on the site is to create a new include file, includes/merchantlinks.php:
<?php
$merchantlinks["Merchant 1"] = "http://www.example.com/?affid=1234";
$merchantlinks["Merchant 2"] = "http://www.exampleaffilaitenetwork.com/go.php?m=12&aff=34";
// etc.
?>
Next, edit includes/common.php and look for the following code at line 25:
require($common_path."database.php");
...and REPLACE with:
require($common_path."database.php");
require($common_path."merchantlinks.php");
Finally,to display a direct to merchant link within the output of each voucher code in html/coupons.php, after the main voucher code text for example, look for the following code at l ine 23:
<p><?php print $voucher["text"]; ?></p>
...and REPLACE with:
<p><?php print $voucher["text"]; ?></p>
<p><a href='<?php print $merchantlinks[$voucher["merchant"]]; ?>'>Shop Now</a></p>
Note that this method means that you don't have to enter a merchant link specifically for every single voucher...
Cheers,
David.
--
PriceTapestry.com
Hi Jonny,
There is an easy mod to do this. In vouchers.php look for this code at line 52:
$coupons["vouchers"] = $vouchers;
...and REPLACE that with:
if (substr($voucher["discount_text"],0,4)=="http")
{
$vouchers[$k]["href"] = $voucher["discount_text"];
}
}
$coupons["vouchers"] = $vouchers;
And then for any voucher code that you want to link direct to merchant, simply enter the URL in the Discount Text field on the voucher code configuration page...
Cheers,
David.
--
PriceTapestry.com