Jump to content

[Solved] Discount vouchers fix amount taxes included problem


Recommended Posts

Hello, when the program of loyalty or refferal generate a voucher of fixed amount, they do not include the tax and I need to including the tax.

 

I can do it manually from the back office, but I can not be aware at every moment of this.

I would need these discount codes will be generated default with the tax included.

 

Thanks.

Edited by ossy (see edit history)
Link to comment
Share on other sites

Solved:

 

Go to /httpdocs/"admin"/themes/default/template/controllers/cart_rules/actions.tpl

Find this:

post-530933-0-79514100-1367495594_thumb.jpg

 

And put like this:

post-530933-0-54957200-1367495657_thumb.jpg

 

 

Put down line up, it change de orde in the drop-down list and put as default tax included.

Link to comment
Share on other sites

modules/loyality/controllers/front/default.php

 

search the:

 

$cart_rule = new CartRule();
  $cart_rule->code = $voucher_code;
  $cart_rule->id_customer = (int)$this->context->customer->id;
  $cart_rule->reduction_currency = (int)$this->context->currency->id;
  $cart_rule->reduction_amount = LoyaltyModule::getVoucherValue((int)$customer_points);
  $cart_rule->quantity = 1;
  $cart_rule->quantity_per_user = 1;

 

and add the:

 

$cart_rule->reduction_tax = 1;

 

1 - means tax included

0 - means tax excluded

 

do the same for modules/loyality/loyality-program.php

  • Like 1
Link to comment
Share on other sites

modules/refferalprogram/refferalprogrammodule.php

 

 

$cartRule->quantity = 1;
$cartRule->quantity_per_user = 1;
$cartRule->date_from = date('Y-m-d H:i:s', time());
$cartRule->date_to = date('Y-m-d H:i:s', time() + 31536000); // + 1 year
$cartRule->code = $this->getDiscountPrefix().Tools::passwdGen(6);
$cartRule->name = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION');
$cartRule->id_customer = (int)$id_customer;
$cartRule->reduction_currency = (int)$id_currency;

Link to comment
Share on other sites

Hello vekia, in referral module continues add tax when i use the discount code.

 

In loyalty module i change 2 files but in referrals module i change only one file it is ok????

Link to comment
Share on other sites

You're welcome :-)

 

im so glad that it works now. I will write tutorial for this on my website because in my opinion it is important to have got an ability to change tax included / excluded for voucher codes

Link to comment
Share on other sites

  • 3 months later...

Hi!

i have a problem in using voucher...

 

i have price rules about free shipping if the total items is greater than 2000 (peso).

 

but... if i apply my voucher worth 200 my shipping fee was applied 2100 - 200 (Total Items - Total voucher) = 1900

my problem is i want to apply shipping if total items is less that 2000

 

 

Item1 = 1800

Item2 = 300

voucher = -200

 

Total Items = 2100

Total voucher = -200

 

Total shipping = 150

Total amount to be paid = 2050

 

 

 

I want to look like this...

 

 

 

Item1 = 1800

Item2 = 300

voucher = -200

 

Total Items = 2100

Total voucher = -200

 

Total shipping = 0

Total amount to be paid = 1900

 

 

Thanks!

Link to comment
Share on other sites

  • 2 years later...

Hello,

 

Prestashop 1.6.0.9

 

I want a minimal amount order of 50€ tax included, but by defaut le voucher is created with a minimal amount of 50€ tax excluded. How is it possible to set it automatically with tax included ?

I'm checking this forum all the day, no answer.

 

In modules/loyalty/loyalty-program.php I tried to insert this code but it doesn't work :

$cartRule->minumum_amount_tax = 1;
	/* Voucher creation and affectation to the customer */
	$cartRule = new CartRule();
	$cartRule->code = $voucherCode;
	$cartRule->id_customer = (int)$context->customer->id;
	$cartRule->id_currency = (int)$context->currency->id;
	$cartRule->reduction_amount = LoyaltyModule::getVoucherValue((int)$customerPoints);
	$cartRule->quantity = 1;
	$cartRule->quantity_per_user = 1;
	$cartRule->reduction_tax = (bool)Configuration::get('PS_LOYALTY_TAX');
	$cartRule->minumum_amount_tax = 1;
Edited by Makina_AMX (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...