You are here:  » Same voucher code with different MOV & Discount

Active Forum Topics

Same voucher code with different MOV & Discount

Submitted by sirmanu on Tue, 2019-09-24 13:57 in

Hi David.
I use voucher codes functionality quite often.

I was wondering if this feature can be implemented.

I have some merchants that, depending on how much you spend, you get some discount or other. The voucher code is the same.

For instance.
If you spend 75€, you get 10€ discount. If you spend 150€, 15€. If you spend 300€, 20€. Is a bit messy because I have to copy and paste.

Usually, I have to repeat this procedure three times and only modify minimum spent and discount.

Is any way we can modify the functionality so we can handle this situation in the same voucher_codes_edit.php? Maybe with some separator in the fields?

Best regards

Submitted by support on Wed, 2019-09-25 10:26


It's straight forward to make a Duplicate function which will save having to copy and paste - to do this, create a new file admin/voucher_codes_duplicate.php containing:

$admin_checkPassword TRUE;
$sql "DESC `".$config_databaseTablePrefix."vouchers`";
$fields = array();
$rows as $row)
$fields[] = $row["Field"];
$fieldList implode(",",$fields);
$id $_GET["id"];
$sql "INSERT INTO `".$config_databaseTablePrefix."vouchers` (".$fieldList.") SELECT ".$fieldList." FROM `".$config_databaseTablePrefix."vouchers` WHERE id='".database_safe($id)."'";
header("Location: voucher_codes_edit.php?id=".$insertId);

Then edit admin/voucher_codes.php and look for the following code at line 234:


...and REPLACE with:


Hope this helps!


Submitted by sirmanu on Fri, 2019-09-27 09:40

This is awesome!!!
Thank you very much David