Coupon Worth Different Amount For Goods and Services


  • Default avatar
    eddy89    
     9 years ago
    0

    Hi,

    Is there a way to make it so that a coupon can be redeemed for X value for services, and Y value for products?

    Thank you!
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    Are you trying to say you want one coupon code that gives a discount x on specific products and a different discount on other specific products?

    If so you can use a parent coupon:
    - Coupon a: product coupon where you enter discount x and specify products (x)
    - Coupon b: product coupon where you enter discount y and specify products (y)
    - Coupon c: parent coupon where you add both coupon a and b and set process type to all that apply
  • Default avatar
    eddy89    
     9 years ago
    0

    Ok, this gets me part of the way there.

    I'm using AWO Referral.

    I want to do the following.

    1) The affiliate creates an account, and refers a friend
    2) The FRIEND signs up
    3) When the FRIEND purchases anything (X VALUE) , the affiliate recieves a coupon code,

    4) This code is good for X VALUE off of services, and (X VALUE)/3 off of all products.

    So the coupon code is based on the value of what the FRIEND spends.

    Is this possible?

    Thanks for your time!
  • Default avatar
    eddy89    
     9 years ago
    0

    Not sure if I need to create a different topic for this.

    So I'm doing the following:

    1) AWORewards is set to provide a POINT reward to the sponsor
    2) I Sign in as the FRIEND
    3) I convert the points to a coupon code
    4) This coupon code is a parent coupon, with a certain discount on services, and a different discount on products.
    5) I add stuff to my hika shop cart
    6) Enter the coupon code and click add.

    I get the following error messages.
    Notice: Undefined property: stdClass::$customer in /home/nomadb5/public_html/referral/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php on line 2849

    Notice: Trying to get property of non-object in /home/nomadb5/public_html/referral/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php on line 2849

    It appears to still be applying the discount at the bottom of the cart, but I want to get rid of these error messages.

    I still need to know how to execute my previous request in this thread.

    Thank you.
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    Thanks for reporting. Here is what you can do to fix it:

    in /home/nomadb5/public_html/referral/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php around line 537 is this:
    <?php
        $coupon_row
    ->params = !empty($coupon_row->params) ? ( is_string($coupon_row->params) ? json_decode($coupon_row->params) : $coupon_row->params  ) : new stdclass;
    ?>


    Right after that, add this
    <?php
        $user 
    JFactory::getUser();
        
    $coupon_row->customer = new stdClass();
        
    $coupon_row->customer->user_id = (int)$user->id
    ?>


    I believe that will fix the problem.
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    If I understand correctly, what you are basically trying to do is give a parent coupon to the affiliate where the values of the children coupons depend on the amount spent by the friend.

    This is not possible to do, at least not without some customization.
  • Default avatar
    eddy89    
     9 years ago
    0

    Ok, when I go to line 537 I find the following code.

    else {

                    $coupon_row->params = !empty($coupon_row->params) ? ( is_string($coupon_row->params) ? json_decode($coupon_row->params) : $coupon_row->params  ) : new stdclass;
                    
                    $test = $this->couponvalidate_numuses($coupon_row);
                    if(!empty($test)) {
                        $this->return_false($test);
                        continue;
                    }


    I don't see the opening or closing of the PHP that you have in your instructions.

    Where should I place the
    <?php
        $user 
    JFactory::getUser();
        
    $coupon_row->customer = new stdClass();
        
    $coupon_row->customer->user_id = (int)$user->id
    ?>

    ?????

    Do I keep the PHP opening and closing at the beginning and end of this addition?

    Thanks AGAIN!
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    No, you are right, there is no opening and closing php tags. Please do not add those, they are just in the code I posted to beautify it. Add the code without the php tags.