PHP Error: foreach() statement


  • Default avatar
    joyce3    
     3 years ago
    0

    When I setup the coupon's exclude list it worked perfectly. Also it does exclude items upon checkout, but when I go back in to modify the coupon I am receiving this error:

    Warning: Invalid argument supplied for foreach() in /home4/king6/public_html/administrator/components/com_awocoupon/views/coupon/tmpl/default.php on line 415
    Warning: Invalid argument supplied for foreach() in /home4/king6/public_html/administrator/components/com_awocoupon/views/coupon/tmpl/default.php on line 336


    Here is an image of the problem:

    http://imgur.com/PBg9HQC

    Joomla! 2.5.11
    VirtueMart Version: 2.0.20b
    PHP 5.3.24


    Thanks.
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    That is a strange error.

    Can you go to global options and turn on debug mode and then refresh the screen? I wonder if there is a database error.
  • Default avatar
    joyce3    
     3 years ago
    0

    500 - An error has occurred.
    JDatabaseMySQLi::query: 1271 - Illegal mix of collations for operation 'UNION' SQL=SELECT a.coupon_id,a.asset_id,c.product_name AS asset_name FROM hhv4z_awocoupon_asset1 a JOIN hhv4z_virtuemart_products b ON b.virtuemart_product_id=a.asset_id JOIN hhv4z_virtuemart_products_en_gb c USING (virtuemart_product_id) WHERE a.asset_type="product" AND a.coupon_id IN (1) UNION SELECT a.coupon_id,a.asset_id,c.category_name AS asset_name FROM hhv4z_awocoupon_asset1 a JOIN hhv4z_virtuemart_categories b ON b.virtuemart_category_id=a.asset_id JOIN hhv4z_virtuemart_categories_en_gb c USING (virtuemart_category_id) WHERE a.asset_type="category" AND a.coupon_id IN (1) UNION SELECT a.coupon_id,a.asset_id,c.mf_name AS asset_name FROM hhv4z_awocoupon_asset1 a JOIN hhv4z_virtuemart_manufacturers b ON b.virtuemart_manufacturer_id=a.asset_id JOIN hhv4z_virtuemart_manufacturers_en_gb c USING (virtuemart_manufacturer_id) WHERE a.asset_type="manufacturer" AND a.coupon_id IN (1) UNION SELECT a.coupon_id,a.asset_id,c.vendor_store_name AS asset_name FROM hhv4z_awocoupon_asset1 a JOIN hhv4z_virtuemart_vendors b ON b.virtuemart_vendor_id=a.asset_id JOIN hhv4z_virtuemart_vendors_en_gb c USING (virtuemart_vendor_id) WHERE a.asset_type="vendor" AND a.coupon_id IN (1) UNION SELECT a.coupon_id,a.asset_id,c.shipment_name AS asset_name FROM hhv4z_awocoupon_asset1 a JOIN hhv4z_virtuemart_shipmentmethods b ON b.virtuemart_shipmentmethod_id=a.asset_id JOIN hhv4z_virtuemart_shipmentmethods_en_gb c USING (virtuemart_shipmentmethod_id) WHERE a.asset_type="shipping" AND a.coupon_id IN (1) UNION SELECT a.coupon_id,a.asset_id,b.coupon_code AS asset_name FROM hhv4z_awocoupon_asset1 a JOIN hhv4z_awocoupon b ON b.id=a.asset_id WHERE a.asset_type="coupon" AND a.coupon_id IN (1)


    Return to Control Panel

    Call stack
    # Function Location
    1 JAdministrator->dispatch() /home4/king6/public_html/administrator/index.php:46
    2 JComponentHelper::renderComponent() /home4/king6/public_html/administrator/includes/application.php:153
    3 JComponentHelper::executeComponent() /home4/king6/public_html/libraries/joomla/application/component/helper.php:351
    4 require_once() /home4/king6/public_html/libraries/joomla/application/component/helper.php:383
    5 JController->execute() /home4/king6/public_html/administrator/components/com_awocoupon/awocoupon.php:41
    6 AwoCouponController->editcoupon() /home4/king6/public_html/libraries/joomla/application/component/controller.php:761
    7 JController->display() /home4/king6/public_html/administrator/components/com_awocoupon/controller.php:225
    8 AwoCouponViewCoupon->display() /home4/king6/public_html/libraries/joomla/application/component/controller.php:722
    9 JView->get() /home4/king6/public_html/administrator/components/com_awocoupon/views/coupon/view.html.php:86
    10 AwoCouponModelCoupon->getEntry() /home4/king6/public_html/libraries/joomla/application/component/view.php:386
    11 call_user_func() /home4/king6/public_html/administrator/components/com_awocoupon/models/coupon.php:91
    12 AwocouponVirtuemartHelper::getAwoItem()
    13 JDatabase->loadObjectList() /home4/king6/public_html/administrator/components/com_awocoupon/helpers/estore/virtuemart/helper.php:101
    14 JDatabaseMySQLi->execute() /home4/king6/public_html/libraries/joomla/database/database.php:1100
    15 JError::raiseError() /home4/king6/public_html/libraries/joomla/database/database/mysqli.php:396
    16 JError::raise() /home4/king6/public_html/libraries/joomla/error/error.php:251
  • Your avatar
    seyi    
     3 years ago
    0

    Hello,

    You are probably having the same issue as in this forum. Try this solution:
    http://awodev.com/forum/awocoupon/help-section/error-showing-coupon-created-buy-one-get-one-half-price#comment-3883
  • Default avatar
    joyce3    
     3 years ago
    0

    Ah ok, changing those 3 encode types did work, thanks.