Expire Coupon Error


  • Default avatar
    mile2    
     4 years ago
    0

    When i try to use expire coupon or coupon which is not working any more it crash my website .

    It sending me to this page (Please see the picture )

    How can i fix that ?

    http://i48.tinypic.com/2vl2xkl.png
  • Default avatar
    mile2    
     4 years ago
    0

    When i enable the simple error this is what i got :

    Warning: Invalid argument supplied for foreach() in /my website/public_html/components/com_virtuemart/views/cart/tmpl/default_pricelist.php on line 71
  • Default avatar
    mile2    
     4 years ago
    0

    This is what have on this line :

    foreach($this->cart->BTaddress['fields'] as $item){


    The strange thing is when i try coupon whitch is not exist the system just say no coupon and is working fine . This happening only if i have expire coupon in the system
  • Default avatar
    mile2    
     4 years ago
    0

    It is not from the Template . I try with default template and is the same thing

    I see two simillar errors

    http://awodev.com/forum/awocoupon/help-section/error-virtuemart-checkout-after-entering-code

    http://awodev.com/forum/awocoupon/help-section/warning-and-fatal-error-multiple-coupon



  • Your avatar
    seyi    
     4 years ago
    0

    What is the error you are receiving?

    You will need to do one of 2 thing:
    - turn on errors on your site, so you can see it on the page
    - look in the error logs for the actual error that is stopping execution.
  • Your avatar
    seyi    
     4 years ago
    0

    The error here:
    http://awodev.com/forum/awocoupon/help-section/warning-and-fatal-error-multiple-coupon

    The person replied to me saying
    "i changed some of italian string, and now the problem seems not to always appear"

    For the other link:
    http://awodev.com/forum/awocoupon/help-section/error-virtuemart-checkout-after-entering-code

    Never received any replies.
  • Default avatar
    mile2    
     4 years ago
    0

    When i enable the simple error this is what i got :

    Warning: Invalid argument supplied for foreach() in /my website/public_html/components/com_virtuemart/views/cart/tmpl/default_pricelist.php on line 71

    And this one :

    Fatal error: Call to a member function createPriceDiv() on a non-object in/my website/public_html/components/com_virtuemart/views/cart/tmpl/default_pricelist.phpon line 293
  • Your avatar
    seyi    
     4 years ago
    0

    yes, that is an error with that specific page, I get it too if i go to that specific page:
    index.php?option=com_virtuemart&view=cart&task=edit_coupon

    The question is why are you being forwarded there, that I do not have an answer for.
  • Default avatar
    mile2    
     4 years ago
    0

    So what we shall do ? I don't see other errors
  • Default avatar
    mile2    
     4 years ago
    0

    It doesn't matter if the coupon is expire or disable . If exist in AwoCoupon Pro it redirecting me to that page .

    I put the error in Joomla to Maximum and this is what i got :

    Notice: Undefined property: VirtueMartViewCart::$checkout_task in /my website/public_html/components/com_virtuemart/views/cart/tmpl/default.php on line 91

    Notice: Undefined property: VirtueMartViewCart::$continue_link_html in /my website/public_html/components/com_virtuemart/views/cart/tmpl/default.php on line 103
    Hello Binko
    Bill To

    Notice: Undefined property: VirtueMartCart::$BTaddress in /my website/public_html/components/com_virtuemart/views/cart/tmpl/default_pricelist.php on line 71

    Warning: Invalid argument supplied for foreach() in /my website/public_html/components/com_virtuemart/views/cart/tmpl/default_pricelist.php on line 71

    Notice: Undefined property: VirtueMartViewCart::$currencyDisplay in /my website/public_html/components/com_virtuemart/views/cart/tmpl/default_pricelist.php on line 293

    Fatal error: Call to a member function createPriceDiv() on a non-object in /my website/public_html/components/com_virtuemart/views/cart/tmpl/default_pricelist.php on line 293
  • Your avatar
    seyi    
     4 years ago
    0

    if you disable awocoupon and try it with virtuemart coupons, what do you get?
  • Default avatar
    mile2    
     4 years ago
    0

    When i do that it says :

    Coupon code not found. Please try again.

    And everything is fine
  • Default avatar
    mile2    
     4 years ago
    0

    When i disable this plugin : VMCoupon - AwoCoupon and everything is working

    So can you suggest some fix for that please ?
  • Your avatar
    seyi    
     4 years ago
    0

    I cannot as I cannot reproduce the problem.

    The only thing I can do is look at it directly. But for that I would need temporary admin/ftp access. Please feel free to send a private message with the information.
  • Default avatar
    mile2    
     4 years ago
    0

    I just see something : When i use normal coupon and after that put expired coupon everything is working fine . So the problem is only when you put for the first time expired coupon . Please tell me what you need to test and i will test it . I can't give you administrator login
  • Your avatar
    seyi    
     4 years ago
    0

    I still cannot reproduce. I do not know what I need to test because I do not know what the problem is. I would simply debug code until i find the cause of the problem. If you want to look at the code yourself, you can start with
    www/administrator/components/com_awocoupon/helpers/estorecouponhandler.php, assuming you have the latest version.

  • Default avatar
    mile2    
     4 years ago
    0

    I have this version : com_awocoupon-PRO-2.1.1
  • Default avatar
    mile2    
     4 years ago
    0

    When is redirecting me to that wierd page and i hit back button i see this :



    No record, unpublished or expired

    Message

    Coupon code not found. Please try again.


    So is working fine but why is redirecting me to that page ?
  • Default avatar
    mile2    
     4 years ago
    0

    Ok i thing i found something : Inside this file components/com_virtuemart/helpers/cart.php



    $this->couponCode = '';
    return $this->redirecter('index.php?option=com_virtuemart&view=cart&task=edit_coupon' , $redirectMsg);
    }
    }
    $redirectMsg = '';

    When i remove this part index.php?option=com_virtuemart&view=cart&task=edit_coupon and is work. How can i fix that ?
  • Your avatar
    seyi    
     4 years ago
    0

    yes, it is likely the cause. In that section of code, change

    <?php
        
    if(self::$_triesValidateCouponcouponCode$prices['salesPrice']);
        } else{
            
    $redirectMsg JText::_('COM_VIRTUEMART_CART_COUPON_TOO_MANY_TRIES');
        }
    ?>


    to

    <?php
        
    if(self::$_triesValidateCouponcouponCode$prices['salesPrice']);
        } else{
            
    $redirectMsg ''//JText::_('COM_VIRTUEMART_CART_COUPON_TOO_MANY_TRIES');
        
    }
    ?>


    If that works, then $_triesValidateCoupon is being called too many times.
  • Default avatar
    mile2    
     4 years ago
    0

    It is not working
  • Your avatar
    seyi    
     4 years ago
    0

    I see, good.

    So somewhere along the line you are calling the coupon validation function 8+ times after hitting the submit button, which is causing the error message and then being forwarded to the edit_coupon page. The problem is the edit_coupon page is not completely built, so it looks like an error. What is needed is for Virtuemart to finish the page or update that link.
  • Default avatar
    mile2    
     4 years ago
    0

    How can i fix that ? Because i don't want to wait for VM . Can i change the link ? What is going to broke this ? If i just delete the link ?
  • Your avatar
    seyi    
     4 years ago
    0

    The code I gave you disables the link, it will never be called, but if you really need a fix for the page, you should to post into Virtuemart forum to get specific help. There is obviously a problem with how the page renders and an error somewhere causing it.
  • Default avatar
    mile2    
     4 years ago
    0

    I put your code and is not disable this page . When i put disable or expire coupon it still redirecting me to that page . What it will happen if i delete this from the code ?

    $this->couponCode = '';
    return $this->redirecter('index.php?option=com_virtuemart&view=cart&task=edit_coupon' , $redirectMsg);
    }