Hi
I was wondering if there was a way to add an "Offer" using the Voucher Code tool. Something like these
{link saved}
The issue is there is no code or minimum spend but I am gettign expiry dates from the merchants
Is that a quick fix, maybe by seleting offer type in a drop down or something "Voucher Code" - "Offer" "Deal" which allows you to add the offer text and selct the merchant.
Thanks
Stuart
Hi David
Tried that and still asks me for a "Voucher Code" was trying to find a quick way to add "Offers" wheer no code was used
Regards
Stuart
Hi Stuart,
What you could do is use a code such as NONE1 and then in vouchers.php, look for the following code at line 50:
$vouchers[$k]["text"] .= " ".translate("using voucher code")." <strong>".$voucher["code"]."</strong>";
...and REPLACE with:
if (substr($voucher["code"],0,4)!=="NONE")
{
$vouchers[$k]["text"] .= " ".translate("using voucher code")." <strong>".$voucher["code"]."
</strong>";
}
And then in html/prices.php look for the following IF statement within line 14:
if ($product["voucher_code"])
...and REPLACE with:
if ($product["voucher_code"] && (substr($product["voucher_code"],0,4)!=="NONE"))
And similarly in html/product.php within line 29:
if ($priceProduct["voucher_code"])
...REPLACE with:
if ($priceProduct["voucher_code"] && (substr($priceProduct["voucher_code"],0,4)!=="NONE"))
With those mods in place you'll be able to use voucher codes beginning NONE and they won't be displayed throughout the site; but the search links from the voucher codes page will still work...
Cheers,
David.
--
PriceTapestry.com
Greetings,
Possible that when a merchant has no voucher code, but just a start/stop date and/or min. spend requirement that the text "using voucher code" doesn't show up on the product page, but the "Discount Text" does?
Example offered by merchant:
Free Shipping No Minimum: 12.17.12 - 12.19.12
We just want to add "Free Shipping", leave the voucher code area blank, and for "using voucher code" on the page not to display.
Possible?
Thanks!
Hi,
Use a voucher code of %NONE% and configure the rest of the fields as normal. Then it's just a case of adding conditional code within each of the HTML modules that display voucher codes to suppress the "using voucher code" text if the voucher code is %NONE%.
To do this, in in html/product.php look for the following code within line 29:
translate("using voucher code")
...and REPLACE with:
($priceProduct["voucher_code"]=="%NONE%"?"":translate("using voucher code"))
And for the price comparison table, in html/prices.php look for the following code within line 14:
translate("using voucher code")
...and REPLACE with:
($product["voucher_code"]=="%NONE%"?"":translate("using voucher code"))
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Hi David,
Unfortunately, it is showing "using voucer code %NONE%" on the product page.
Any ideas?
Thanks!
Hi,
Is it showing in both the main product area and price comparison table on your product pages? If you would like to email me your modified html/product.php and html/prices.php I'll check it over for you...
Regarding the voucher codes page - simple mod to remove %NONE% codes from the selection - look for the following code at line 6 of vouchers.php:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."vouchers` WHERE ( (valid_from < '".$now."' AND valid_to = '0') OR (valid_from <= '".$now."' AND valid_to > '".$now."') ) ORDER BY merchant";
...and REPLACE with:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."vouchers` WHERE code <> '%NONE%' AND ( (valid_from < '".$now."' AND valid_to = '0') OR (valid_from <= '".$now."' AND valid_to > '".$now."') ) ORDER BY merchant";
Cheers,
David.
--
PriceTapestry.com
Hi David,
Yes, showing on both the main product area and price comparison table on the product pages?
I will email you the two files.
Also - the fix for the vouchers page worked great!
Thanks!
I've just tried your %NONE% code for a Buy One Get one Free on a particular item where voucher code isn't need, it's automatically done at checkout, but although I entered the product keyword in the Voucher Code control panel, nothing showed up in the results page.
The modified files are not currently live as either the prices or product code broke up my product page, so I had to revert it back to normal.
I'd also be interested in the code to remove "using voucher code %NONE%" from displaying on the website, and for the "Other" offer text to show up in the product page, like it does for the voucher codes. I.e. Buy One Get One Free
Many thanks.
Hi bat,
The mod described above would prevent the code from showing up on vouchers.php if using %NONE%, so if you did want your offer (buy one get one free) to show up and be able to be searched how about using a code "BOGOF" and then also checking for this as well as %NONE% in the changes to the voucher code display? This could be done with the following changes:
For html/product.php, look for the following code at line 27:
<?php if ($priceProduct["price"] == $mainProduct["price"]): ?>
...and REPLACE with:
<?php if ($priceProduct["price"] == $mainProduct["price"]): ?>
<?php
$voucher_code_text = "";
if (
(substr($priceProduct["voucher_code"],0,6)=="%NONE%")
||
(substr($priceProduct["voucher_code"],0,5)=="BOGOF")
)
{
$voucher_code_text = "<strong>".str_replace(array("%NONE% ","BOGOF "),"",$priceProduct["voucher_code"])."</strong>";
}
elseif($product["voucher_code"])
{
$voucher_code_text = translate("using voucher code")." <strong>".$priceProduct["voucher_code"]."</strong>";
}
?>
...and then the following code at line 29:
<?php if ($priceProduct["voucher_code"]) print " ".translate("using voucher code")." <strong>".$priceProduct["voucher_code"]."</strong>"; ?>
...and REPLACE with:
<?php if ($priceProduct["voucher_code"]) print " ".$voucher_code_text; ?>
For the price comparison table, look for the following code at line 9:
<?php foreach($prices["products"] as $product): ?>
...and REPLACE with:
<?php foreach($prices["products"] as $product): ?>
<?php
$voucher_code_text = "";
if (
(substr($product["voucher_code"],0,6)=="%NONE%")
||
(substr($product["voucher_code"],0,5)=="BOGOF")
)
{
$voucher_code_text = "<br /><nobr><small><strong>".str_replace(array("%NONE% ","BOGOF "),"",$product["voucher_code"])."</strong></small></nobr>";
}
elseif($product["voucher_code"])
{
$voucher_code_text = "<br /><nobr><small>".translate("using voucher code")." <strong>".$product["voucher_code"]."</strong></small></nobr>";
}
?>
...and then the following code at line 14:
<?php if ($product["voucher_code"]) print "<br /><small><nobr>".translate("using voucher code")." <strong>".$product["voucher_code"]."</strong></nobr></small>"; ?>
...and REPLACE with:
<?php if ($product["voucher_code"]) print $voucher_code_text; ?>
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Thanks for this David, however it seems to have broke my page up again. I must have conflicting code in one of those files. Shall I email them to you?
Hi,
Thanks for the file - there was a syntax error in the prices.php modification (corrected above) that would have broken the pages...
Cheers,
David.
--
PriceTapestry.com
Hi David,
Thank you for the modified files.
I still want the "using voucher code XXXX" to appear on the product when an actual voucher code is needed, but I don't want it to show when a code isn't needed, just the offer text.
I took my original product and prices files and just put the replaced the first bit of code for each, so that the voucher code info remains.
I'm looking for something like an IF statement, so that only if the voucher code is %NONE% of BOGOF, then don't show the text Using Voucher Code %NONE%/BOGOF. But I do want it to keep the offer text I've typed in the Discount Text box: Buy One Get one Free
Case in question, the link below
{link saved}
Hi bat,
I'll follow up by email...
Cheers,
David.
--
PriceTapestry.com
Hi Stuart,
"0.00" is a valid input for a minimum price match which enables you to create a code valid for all products; and then choose discount type "Other" and enter the offer details in the other/description text box - that should do the trick!
Cheers,
David.
--
PriceTapestry.com