Jump to content

Loyalty Points Voucher incl tax [Solved]


Recommended Posts

Hi,

 

When my customers convert their loyalty points into a voucher, the voucher is created for an amount excluding tax. So when the voucher is submitted in the cart, the amount differs from the voucher value that is displayed in the customers account.

 

For example:

 

A loyalty voucher is created for an amount of € 0,50

post-452464-0-44426300-1357421542_thumb.jpg

 

When the customer submits the code in de cart it shows a value of - € 0,61 (tax = 21% around here)

post-452464-0-77512200-1357421555_thumb.jpg

 

The prices in the shop are shown including tax, it is a retail store.

 

Does anyone know how the make the shop/loyalty module create vouchers incl. tax by default?

 

Thank you very much in advance.

 

Kind Regards.

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

  • 2 weeks later...
  • 1 month later...

Yes. With a hax :D Dunno if it breaks anything, but heres the solution:

 

Go to classes/CartRule.php:

On line 62 change:

public $reduction_tax;

to:

public $reduction_tax = 1;

and on line 67:

public $highlight;

to:

public $highlight = 1;

 

Always make a backup of the file. Tell me if it works, i think i solved the prob that way.

Link to comment
Share on other sites

Thanks for your help. That seems to resolve the issue!

 

I have changed line 67 back to what it was, it appears that this only makes the coupon appear on the checkout page. Can be a nice edit though, just not for me right now.

Link to comment
Share on other sites

  • 5 months later...

Hi,

 

When my customers convert their loyalty points into a voucher, the voucher is created for an amount excluding tax. So when the voucher is submitted in the cart, the amount differs from the voucher value that is displayed in the customers account.

 

For example:

 

A loyalty voucher is created for an amount of € 0,50

attachicon.gifMy loyalty points page.JPG

 

When the customer submits the code in de cart it shows a value of - € 0,61 (tax = 21% around here)

attachicon.gifCart.JPG

 

The prices in the shop are shown including tax, it is a retail store.

 

Does anyone know how the make the shop/loyalty module create vouchers incl. tax by default?

 

Thank you very much in advance.

 

Kind Regards.

 

Go to modules/loyality/controllers/front/default.php

search this code:

 

$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

 

$cart_rule->reduction_tax = 1;

 

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

 

if you dont' want a partial use of the voucher add also this:

 

$cart_rule->partial_use = 0;

Link to comment
Share on other sites

  • 1 year later...
  • 2 months later...

It works great !

How would we get the value of the minimum amount to spend discount voucher always include taxes?

 

I need that too :)

 

Anyone knows which cart_rule to add to have minimum order amount with taxes instead of no taxes on vouchers generated by the loyalty program ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...