Warning mesage when coupon applied.


  • Default avatar
    gina47    
     3 years ago
    0

    Hi guys,

    I've started to get the below error message when I apply a coupon. This is a typed in coupon rather than an automatic coupon.

    Warning: Invalid argument supplied for foreach() in /home/gadonai/public_html/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php on line 365

    The joomla debug says the following:

    Error: 500

    JDatabaseMySQL::query: 1146 - Table 'gadonai_joom662.jos_virtuemart_categories_'.VMLANG.'' doesn't exist SQL=SELECT L.category_name as name, L.virtuemart_category_id AS category_id, CC.category_parent_id, C.published as category_publish FROM `jos_virtuemart_categories_'.VMLANG.'` as L JOIN `jos_virtuemart_categories` as C using (`virtuemart_category_id`) LEFT JOIN `jos_virtuemart_category_categories` as CC on C.`virtuemart_category_id` = CC.`category_child_id` WHERE C.published = '1' ORDER BY category_parent_id, C.ordering

    I don't have a clue how to fix this in the data base as i don't know how/where to find them.

    Can you please help?

    Thanks in advance,
    Gina.
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    What version of Virtuemart and AwoCoupon are you using?
  • Default avatar
    gina47    
     3 years ago
    0

    VM: 2.0.18a
    J: 2.5.7
    AWO PRO: 2.1.7
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    I have looked and cant find that sql query any where, in AwoCoupon or Virtuemart. So I wonder if there is another plugin you have that is causing it. Did this just all of a sudden stop working normally? Have you changed or added anything recently?
  • Default avatar
    gina47    
     3 years ago
    0

    Hi Seyi,

    I've been looking through this issue today and found a few things that may shed some light on the problem.

    I have 5 automatic coupons that are triggered by either product choice - shopper group - cart amount etc.
    I also created a manual coupon that the customer would enter at checkout.

    If the manual coupon is entered at checkout I get the error messages come up, BUT, if I unpublish all of the AUTO coupons then the manual coupon works fine and there are no error messages.

    So the logic would be:
    auto coupons published - and - manual coupon entered - then - error messages.
    auto coupons unpublished - and - manual coupon entered - then - NO error messages.

    Auto coupons are: buy X get Y, 10% off for customer group, 5% off for customer group
    Manual coupon is: 10% off entire cart value.

    One important point is that even if the error messages show up when a manual coupon is entered, the manual coupon (and any automatic coupons) still work... so if there is a way of just "not showing" the error messages this would be a work around.

    I think I have only noticed this issue recently because I have only in the past used either manual or automatic coupons not manual and automatic coupons before.

    I have not installed any plugins etc for a long time.

    Does this help at all?
  • Your avatar
    seyi    
     3 years ago
    0

    try this:
    in www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php around line 29 is this

    <?php
        
    function AwoCouponVirtuemartCouponHandler () {
            
    parent::__construct();
    ?>


    After that, add the following lines

    <?php
    if (!class_exists'VmConfig' )) require(JPATH_ADMINISTRATOR.'/components/com_virtuemart/helpers/config.php');
    VmConfig::loadConfig();
    ?>


    See if that fixes it.