You are here:  » Fixed price for coupon

Active Forum Topics


Fixed price for coupon

Submitted by sirmanu on Tue, 2018-02-13 10:27 in

Hi David.
Is it possible to add a new option to have a fixed price for a coupon code?
I don't know which price will have the item each day without applying the coupon code. However, I know the price that you will get after using it.
Thank you!

Submitted by support on Tue, 2018-02-13 10:44

Hi,

Sure - first edit admin/voucher_codes_edit.php and look for the following code at line 414:

      $discount_types = array("#"=>html_entity_decode($config_currencyHTML,ENT_QUOTES,$config_charset),"%"=>"%","S"=>"Other");

...and REPLACE with:

      $discount_types = array("#"=>html_entity_decode($config_currencyHTML,ENT_QUOTES,$config_charset),"%"=>"%","F"=>"Fixed Price","S"=>"Other");

And then edit includes/tapestry.php and look for the following code beginning at line 221:

            elseif ($voucher["discount_type"]=="S")
            {
              $discountPrice = $product["price"];
            }

...and REPLACE with:

            elseif ($voucher["discount_type"]=="F")
            {
              $discountPrice = $voucher["discount_value"];
            }
            elseif ($voucher["discount_type"]=="S")
            {
              $discountPrice = $product["price"];
            }

Cheers,
David.
--
PriceTapestry.com

Submitted by sirmanu on Tue, 2018-02-13 17:59

Awesome! It is working as expected with just a few lines.
Thank you