You are here:  » Vouchers variation


Vouchers variation

Submitted by Nic0904 on Thu, 2016-07-07 19:16 in

Hi David,

Would it be possible to include offers in the vouchers section that did not have a code. We get several general offers but there is no discount code. Currently that is mandatory, is it possible to make it optional?

Cheers
Dave

Submitted by support on Fri, 2016-07-08 09:38

Hi Dave,

I'm looking at how best to support generic offers from voucher code feeds in the next distribution but in the mean time, since codes must be unique per merchant if you decide on a generic prefix e.g. NC_ and then use NC_1, NC_2 etc., this can be picked up and the front end and no code will be displayed.

To give this a go, first edit vouchers.php and 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,3)!=="NC_")
  {
    $vouchers[$k]["text"] .= " ".translate("using voucher code")." <strong>".$voucher["code"]."</strong>";
  }

Next, edit html/product.php and look for the following code at line 14:

  if ($p["voucher_code"])

...and REPLACE with:

  if ($p["voucher_code"] && (substr($p["voucher_code"],0,3)!=="NC_"))

And finally edit html/prices.php and look for the following code at line 6:

 if ($product["voucher_code"])

...and REPLACE with:

  if ($product["voucher_code"] && (substr($product["voucher_code"],0,3)!=="NC_"))

And then the following code at line 30:

  <?php if ($prices_showVoucherCodes): ?>

...and REPLACE with:

  <?php if ($prices_showVoucherCodes && (substr($product["voucher_code"],0,3)!=="NC_")): ?>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Nic0904 on Fri, 2016-07-08 20:59

Sounds good will give it a go

Thanks
Dave