Adding a coupon to cart goes to blank page


  • Default avatar
    nicolas4    
     10 years ago
    0

    Hi Seyi,

    We have used succesfully 46 parent coupons and one client wrote to customer service saying it was "not working" (you know). :-) So I tried it myself and when entering this coupon code, we go to a blank page (/index.php). I read on other posts here that it may be a "template issue". If it was so, how can we be able to satisfy 46 coupons before this particular one?

    I have encountered this issue on my DEV and PROD servers only once, right after I installed the component, created a coupon and tested the system. I was not able to reproduce the issue, so I left it there.

    If I remove the index.php from the URL and go to home page, the cart is OK, the coupon is processed and we can finalize the transaction.

    In order to help you help me, where should I look at?

    Thanks !
    Nicolas
  • Your avatar
    seyi    
     10 years ago
    0

    If you are going to a blank page, likely there is a php error. So you can look in your php error logs to see what is the fatal error stopping execution. Also try going to admin->global configuration and set error reporting to maximum temporarily then try it again and the error should be displayed on screen.
  • Default avatar
    nicolas4    
     10 years ago
    0

    Seyi,

    Sorry for the long delay... Here it is. Is it related to AWO?

    PHP Fatal error: Call to a member function query() on a non-object in /var/www/vhosts/..../httpdocs/administrator/components/com_virtuemart/html/basket.php on line 252, referer: http://......./index.php?option=com_virtuemart&page=shop.cart&product_id=410&Itemid=75

    Thanks for your help.
  • Your avatar
    seyi    
     10 years ago
    0

    Hello,

    Cannot tell without seeing at least the code around that line. You would just need to debug it to see what the problem is. AwoCoupon does add injections into the basket.html.php page, but nothing with "query" I dont believe.
  • Default avatar
    nicolas4    
     10 years ago
    0

    Hi Seyi,

    I have put the debug result here : https://docs.google.com/document/d/1a-b4JAr464lrORDU9cIO2GUPT1JpxCpNsiIHgP697HM/edit?usp=sharing

    After more testing, it seems that when a user is logged in, the issue is raising. If we're not logged in, there are no issues.

    Thanks to help. :-)
    Nicolas
  • Your avatar
    seyi    
     10 years ago
    0

    Hello,

    From the fatal error you posted, it is not a problem with an sql query, but trying to call the "query" function on a variable that does not have it, likely $db. What is the contents of html/basket.php?
  • Default avatar
    nicolas4    
     10 years ago
    0

    Seyi,

    I think you put me on the right path, I am not a full time programmer, but I was back then, so I found that db$ was not "initialized" first (don't know if it's the right term), so I changed the db$ = new ps_DB; in the code, it was inside an IF and was not called if the user was logged in.

    Result : no issue anymore.

    Thanks for your valuable help !
    Nicolas
  • Your avatar
    seyi    
     10 years ago
    0

    Great, I thought it would be something that simple. :)