Progressive coupons not automatically?


  • Default avatar
    hennie    
     12 years ago
    0

    Hello,
    do you always need a couponcode to trigger the discount based on the number of products a customer buys? If yes is there an alternative to let the discount be given automatically? Example: I would like to give my customers 5% discount while buying 2 products and 10% discount for three products. Any help would be appreciated...
    Vm 1.1.9 - Awocoupon-pro
    kind regards,
    Hennie
  • Your avatar
    seyi    
     12 years ago
    0

    AwoCoupon does not process coupon codes automatically. You would need a virtuemart hack for that. Something like this would probably work:

    In www/administrator/components/com_virtuemart/html/basket.php around line 278 is this
    <?php
        
    if (!empty($_POST["do_coupon"]) || (in_arraystrtolower($func), array( 'cartadd''cartupdate''cartdelete' )) && !empty($_SESSION['coupon_redeemed'])) ) {
            
    /* process the coupon */
            
    require_once( CLASSPATH "ps_coupon.php" );
            
    $vars["total"] = $total;
            
    ps_coupon::process_coupon_code$vars );
        }
    ?>


    right before that add this
    <?php
        
    if (empty($_POST["do_coupon"])  && empty($_SESSION['coupon_redeemed'])) {
            require_once( 
    CLASSPATH "ps_coupon.php" );
            
    $tmp_vars $vars;
            
    $_POST['coupon_code'] = $_REQUEST['coupon_code'] = $tmp_vars['coupon_code'] = 'THE_SPECIFIC_COUPON_CODE';
            
    ps_coupon::process_coupon_code$tmp_vars );
        }
    ?>


    You would have to replace THE_SPECIFIC_COUPON_CODE with the actual coupon code. Basically every time the user enters the shopping cart and there is not already a coupon used, it will automatically check for the coupon code you specify.

    Other than this, there are package solutions that would automatically use a coupon code
    - daycounts Virtuemart Bonus
    - Virtuemart purchasing rules
    Be sure to verify this with the developers before purchasing anything
  • Default avatar
    hennie    
     12 years ago
    0

    Hello Seyi,
    entering the new code > before< the original code? If yes... this didn't work. I've replaced the specific_coupon_code with my code but no discount in the basket. It functions ok when I fill in the code by hand in the basket, so the coupon is working.
    Any suggestions?
    Thanks in advance,
    kind regards,
    Hennie
  • Your avatar
    seyi    
     12 years ago
    0

    Hi Hennie,

    I updated the code above so redo the hack. I tested it and it works on my end.
  • Default avatar
    hennie    
     12 years ago
    0

    Hello Seyi,
    It works now on my end to... Thank you very much :-)

    best regards,
    Hennie
  • Default avatar
    hennie    
     12 years ago
    0

    Hi Seyi,
    just another question concerning above.
    If I would rearange the discount for example:
    only 5 % on the second purchase if there are two articles in the basket and only 10% on the third purchase if the customer puts three articles in the basket . (The discount should not be given of the total price). It would be perfect if the discount would be on the highest purchase in the basket.
    Would this be possible???

    best regards,
    Hennie
  • Your avatar
    seyi    
     12 years ago
    0

    take a look at this forum topic:
    https://awodev.com/forum/awocoupon/help-section/10-just-one-item-cart
  • Default avatar
    2maz    
     12 years ago
    0

    Hi, it work well for me, but is there a way to include other coupons codes on this way. I'm not a php developper, sorry, but the goal can be to fix levels for the coupons. The hack permit only one "automatic" coupon but if I create another coupon, can it replace the first one. For example on a category a first "automatic" coupon like it works now (let say 10% after 100€) and a second like 20% after 500€.
    Of course it mean creating two differents coupons for the same product, but is there a way to replace the second by the first one automaticaly if the level of 500€ as been reached. Thanks.
  • Your avatar
    seyi    
     12 years ago
    0

    This is really just a hack. if you need a full blown solution you would have to look for a 3rd party extension.

    If you are using AwoCoupon pro, you could create all the coupons you mentioned, add them to a parent coupon in the order of importance and select the process type of 'first that applys'.
  • Default avatar
    2maz    
     12 years ago
    0

    Hi thank for your answer, you mean that it's possible with the pro version to apply a coupon for 100€ and another at 500€ without any action of the user, just like this hack but with multi coupons. Am I right ?
    Thanks again
  • Your avatar
    seyi    
     12 years ago
    0

    Hello,

    Neither the free or pro version will process a coupon automatically. In both programs the customer is required to enter a coupon code. What I was saying was you can use this hack in conjunction with the pro version to create the effect you mentioned.

    So for example:
    Create coupon A - 10% off of 100€
    Create coupon B - 20% off of 200€
    Create coupon C, a parent coupon and add coupon B and coupon A in that order, then select a process type of 'First that applies'. You can then add coupon C into the hack and you would have the check of multiple coupons.
  • Default avatar
    bonbin    
     12 years ago
    0

    can i use this trick on joomla 2.5 n virtuemart 2?
    i need to create a multiple discount based on the quantity in the cart

    thx
    robin
  • Your avatar
    seyi    
     12 years ago
    0

    Hello Robin,

    No, this hack cannot be used in Virtuemart 2. The code base is totally different. I have not looked into it yet, but you would have to find another way to automatically execute a coupon or look into a 3rd party solution.
  • Default avatar
    bonbin    
     12 years ago
    0

    hello seyi,

    thx for your information
    im spending a couple of week to find the 3rd party for the automated executing the coupon with no luck
    im very interested on using awo pro for giving a variety discount to my costumers, but im also need it to automaticly executed on their cart
    is there any solution regarding to this issue?

    thx
    robin
  • Your avatar
    seyi    
     12 years ago
    0

    I just wrote a plugin to do this for Virtuemart 2. You can download it here;
    https://awodev.com/products#plg_vmcustom_coupontrigger

    Its very simple, install the plugin, enable it, and enter the coupon code you want to be automatically triggered. The plugin is called when a product is added to the cart and if a coupon code already exists it is not run.
  • Default avatar
    bonbin    
     12 years ago
    0

    thank you seyi, you are the best

    but im also finding a problem regarding to the plugin, which if i enable the plugin, the "add to cart button" seems doesnt work
    when i click the "add to cart" button there is nothing happened

    ******UPDATE******
    the trigger plugin work perfecly, the problem caused by the the awocontroller regarding to this thread : https://awodev.com/forum/awocoupon/help-section/parsing-error

    case close

    thx
    robin
  • Default avatar
    2maz    
     12 years ago
    0

    Hi Seyi, i'm deploying the pro version for my client, very nice functions. If I understand the trigger pluggin apply automatically a coupon, like the hack. I have two questions. Will you adapt it for joom 1.x and Virtuemart 1.x ? Can you insert the possibility to enter a multi coupon in one way by the pluggin ? It will be perfect, than you have just to apply all the coupons of the shop in one way and it will only apply on the products in the cart. Or maybe do you think it's possible to apply with the hack a multi coupon ? Thankx for your job.
  • Your avatar
    seyi    
     12 years ago
    0

    Hello,

    There is no triggers for virtuemart 1, so would be hard to write a plugin without at least a hack. There is already a hack listed above that should automatically process a coupon in virtuemart 1:
    https://awodev.com/forum/awocoupon/help-section/progressive-coupons-not-automatically#comment-2496
  • Default avatar
    sengeissen    
     12 years ago
    0

    This comment has been moved here.

This thread is locked.