Jump to content

SOLVED - Minimum order total for Referral Program


ruisonika
 Share

Recommended Posts

Hello everyone,

I'm working with pretashop 1.6 version and i've installed the native referral program that comes in.
I want to add a little feature to that module.
In backoffice configuration i wanna add a field to set the minimum order total without shipping.
Example:
- a customer can invite 5 friends to register in my shop.
- each friend that register won a 5 euros voucher in orders above 50 euros.
If this is hard maybe hardcoded is possible (put the always in somewhere the 50 euros minimum)...

Can someone give some lights?

 

Share this post


Link to post
Share on other sites

My solution for this was edit classes/CartRule.php line +- 686
Add this code
 

//START - apply this to orders above 50 euros
        
		$sql = "select name from ps_cart_rule_lang where id_lang = 1 and id_cart_rule = ".$this->id;
        $txt = Db::getInstance()->getValue($sql);
        if ($cartTotal < 50 && $txt == 'the name of voucher created') {
            return (!$display_error) ? false : Tools::displayError('You have not reached the minimum amount required to use this voucher');
        }
 //END

So if the voucher name is the name of the voucher created and the total of cart is under 50 euros the sistem will show the message.

Share this post


Link to post
Share on other sites

  • ruisonika changed the title to SOLVED - Minimum order total for Referral Program

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More