Jump to content

Change the "Minimum number of orders a customer must place to become a sponsor" to 0?


Recommended Posts

Hello, to be able to send out e-mails via the referral program you have to first order at least 1 product from the store.

 

Is there in any way possible to change this to 0 orders? So that the customers can start referring without buying anything?

 

Do I need to change anything in the referralprogram.php?

 

 

Best regards//

Tobias

Link to comment
Share on other sites

Hi Tobias,

 

In Modules, find the Customer Referral Program module, click Configure, and you'll be able to change the minimum numbers of orders to be a sponsor to zero (as well as adjust what type of voucher they get).

Save and you're done!

 

 

Cheers,

 

Ann 

 

Link to comment
Share on other sites

  • 4 weeks later...

it's in

 

modules/referralprogram/referralprogram.php  around line 162 comment like I did,

 

this way a customer doesn't need to place an order to use this program

 

 

 

private function _postValidation()
    {
        $this->_errors = array();
        
        /*
        if (!(int)(Tools::getValue('order_quantity')) OR Tools::getValue('order_quantity') < 0)
            $this->_errors[] = $this->displayError($this->l('Order quantity is required/invalid.'));
            */

            
        if (!is_array(Tools::getValue('discount_value')))
            $this->_errors[] = $this->displayError($this->l('Discount value is invalid.'));
        foreach (Tools::getValue('discount_value') AS $id_currency => $discount_value)
             if ($discount_value == '')
                $this->_errors[] = $this->displayError(sprintf($this->l('Discount value for the currency #%d is empty.'), $id_currency));
             elseif (!Validate::isUnsignedFloat($discount_value))
                $this->_errors[] = $this->displayError(sprintf($this->l('Discount value for the currency #%d is invalid.'), $id_currency));
        if (!(int)(Tools::getValue('discount_type')) OR Tools::getValue('discount_type') < 1 OR Tools::getValue('discount_type') > 2)
            $this->_errors[] = $this->displayError($this->l('Discount type is required/invalid.'));
        if (!(int)(Tools::getValue('nb_friends')) OR Tools::getValue('nb_friends') < 0)
            $this->_errors[] = $this->displayError($this->l('Number of friends is required/invalid.'));
        if (!(int)(Tools::getValue('discount_value_percentage')) OR (int)(Tools::getValue('discount_value_percentage')) < 0 OR (int)(Tools::getValue('discount_value_percentage')) > 100)
            $this->_errors[] = $this->displayError($this->l('Discount percentage is required/invalid.'));
    }
 

  • Like 1
Link to comment
Share on other sites

it's in

 

modules/referralprogram/referralprogram.php  around line 162 comment like I did,

 

this way a customer doesn't need to place an order to use this program

 

 

 

private function _postValidation()

    {

        $this->_errors = array();

        

        /*

        if (!(int)(Tools::getValue('order_quantity')) OR Tools::getValue('order_quantity') < 0)

            $this->_errors[] = $this->displayError($this->l('Order quantity is required/invalid.'));

            */

            

        if (!is_array(Tools::getValue('discount_value')))

            $this->_errors[] = $this->displayError($this->l('Discount value is invalid.'));

        foreach (Tools::getValue('discount_value') AS $id_currency => $discount_value)

             if ($discount_value == '')

                $this->_errors[] = $this->displayError(sprintf($this->l('Discount value for the currency #%d is empty.'), $id_currency));

             elseif (!Validate::isUnsignedFloat($discount_value))

                $this->_errors[] = $this->displayError(sprintf($this->l('Discount value for the currency #%d is invalid.'), $id_currency));

        if (!(int)(Tools::getValue('discount_type')) OR Tools::getValue('discount_type') < 1 OR Tools::getValue('discount_type') > 2)

            $this->_errors[] = $this->displayError($this->l('Discount type is required/invalid.'));

        if (!(int)(Tools::getValue('nb_friends')) OR Tools::getValue('nb_friends') < 0)

            $this->_errors[] = $this->displayError($this->l('Number of friends is required/invalid.'));

        if (!(int)(Tools::getValue('discount_value_percentage')) OR (int)(Tools::getValue('discount_value_percentage')) < 0 OR (int)(Tools::getValue('discount_value_percentage')) > 100)

            $this->_errors[] = $this->displayError($this->l('Discount percentage is required/invalid.'));

    }

 

Hello, this line:

if (!(int)(Tools::getValue('order_quantity')) OR Tools::getValue('order_quantity') < 0)

            $this->_errors[] = $this->displayError($this->l('Order quantity is required/invalid.'));

 

was already like that in my referralprogram.php

But the referral program still wants me to have at least 1 order.

Link to comment
Share on other sites

×
×
  • Create New...