Multiple coupon link with comma or smi-colon


  • Default avatar
    emeline    
     9 years ago
    0

    Hi,

    According to https://awodev.com/forum/awocoupon/help-section/how-use-multiple-coupons it was previously possible to link multiple coupon using the field and write inside 1 or more coupon separated by comma or semi-colon.

    I try with the last release of awocoupon but it doesn't work any more. Joomla reply by a standard error.

    I can add multiple coupon if I save each one by one. But my customer would prefer the old way.

    Is it possible to link 2 (or more) coupons at one time ? I can modify my self PHP files if I know where to look for :)

    Thanks for your help,
    Renaud
  • Your avatar
    seyi    
     9 years ago
    0

    Hello,

    It works, but there are 2 conditions that have to be set in awocoupon->configuration:
    1) Multiple coupons enabled
    2) Enable store coupons have to be set to no

    For the second one, I believe it can be fixed so it works with enable store coupons set to yes.

    In www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php, around line 193 is this
    <?php
            
    if($_code!='('.JText::_('COM_AWOCOUPON_CP_DISCOUNT_AUTO').')' 
            
    && $_code!=JText::_('COM_VIRTUEMART_COUPON_CODE_CHANGE')
            && 
    $instance->params->get('enable_store_coupon'0) == 1
            
    ) {
    ?>


    Change it to this:
    <?php
            
    if($_code!='('.JText::_('COM_AWOCOUPON_CP_DISCOUNT_AUTO').')' 
            
    && $_code!=JText::_('COM_VIRTUEMART_COUPON_CODE_CHANGE')
            && 
    $instance->params->get('enable_store_coupon'0) == 1
            
    && strpos($_code,';')==false
            
    ) {
    ?>


    That should do it. The customer should be able to enter multiple codes at once separated by a semi-colon.