Error showing Coupon created as "Buy One Get One Half Price"


  • Default avatar
    goretex34    
     4 years ago
    0

    I've created a coupon Buy One Get One Half Price (as shown in the tutorial section "How to use the Buy X Get Y feature of AwoCoupon Pro" http://awodev.com/blog/buy-x-get-y-joomla-guide)

    My ecommerce shop has products with parents&childs (Pillows & their sizes, for example)
    ( www.solodescanso.com )

    There was no problem creating the coupon for just one Size of a Pillow product.
    There is no problem using it during the checkout process (it seems to work properly)

    The problem is when I go and try to edit it.

    In the "Edit Coupon" screen, it shows an error:
    Warning: Invalid argument supplied for foreach() in /home/solodesc/public_html/administrator/components/com_awocoupon/helpers/awolibrary.php on line 149

    Warning: Invalid argument supplied for foreach() in /home/solodesc/public_html/administrator/components/com_awocoupon/helpers/awolibrary.php on line 14


    and in the "Buy X" section:

    Warning: Invalid argument supplied for foreach() in /home/solodesc/public_html/administrator/components/com_awocoupon/views/coupon/tmpl/default.php on line 308


    and in the "Get Y" section:

    Warning: Invalid argument supplied for foreach() in /home/solodesc/public_html/administrator/components/com_awocoupon/views/coupon/tmpl/default.php on line 373


    Any ideas?
    Something to do with the Parent&Childs product catalogue, hasn't it?

    Thank you!

    *** Running AWOCoupon PRO with Joomla 1.5.21 & Virtuemart 1.1.5 ***
  • Your avatar
    seyi    
     4 years ago
    0

    Hello,

    Can you go to global configuration and turn on debug mode, then reload the page with errors. I think you might have a mysql error, and if so, this should tell you.
  • Default avatar
    goretex34    
     4 years ago
    0

    JDatabaseMySQL::query: 1271 - Illegal mix of collations for operation 'UNION' SQL=SELECT a.id,a.coupon_id,a.asset_id,b.product_name AS asset_name,a.asset_type FROM jos_awocoupon_asset1 a JOIN jos_vm_product b ON b.product_id=a.asset_id WHERE a.asset_type="product" AND a.coupon_id IN (5) UNION SELECT a.id,a.coupon_id,a.asset_id,b.category_name AS asset_name,a.asset_type FROM jos_awocoupon_asset1 a JOIN jos_vm_category b ON b.category_id=a.asset_id WHERE a.asset_type="category" AND a.coupon_id IN (5) UNION SELECT a.id,a.coupon_id,a.asset_id,b.mf_name AS asset_name,a.asset_type FROM jos_awocoupon_asset1 a JOIN jos_vm_manufacturer b ON b.manufacturer_id=a.asset_id WHERE a.asset_type="manufacturer" AND a.coupon_id IN (5) UNION SELECT a.id,a.coupon_id,a.asset_id,b.vendor_name AS asset_name,a.asset_type FROM jos_awocoupon_asset1 a JOIN jos_vm_vendor b ON b.vendor_id=a.asset_id WHERE a.asset_type="vendor" AND a.coupon_id IN (5) UNION SELECT a.id,a.coupon_id,a.asset_id,a.asset_id AS asset_name,a.asset_type FROM jos_awocoupon_asset1 a WHERE a.asset_type="shipping" AND a.coupon_id IN (5) UNION SELECT a.id,a.coupon_id,a.asset_id,b.coupon_code AS asset_name,a.asset_type FROM jos_awocoupon_asset1 a JOIN jos_awocoupon b ON b.id=a.asset_id WHERE a.asset_type="coupon" AND a.coupon_id IN (5)
    Call stack
    # Function Location
    1 JAdministrator->dispatch() /home/solodesc/public_html/administrator/index.php:67
    2 JComponentHelper->renderComponent() /home/solodesc/public_html/administrator/includes/application.php:136
    3 require_once() /home/solodesc/public_html/libraries/joomla/application/component/helper.php:162
    4 JController->execute() /home/solodesc/public_html/administrator/components/com_awocoupon/admin.awocoupon.php:30
    5 AwoCouponController->editcoupon() /home/solodesc/public_html/libraries/joomla/application/component/controller.php:236
    6 JController->display() /home/solodesc/public_html/administrator/components/com_awocoupon/controller.php:102
    7 AwoCouponViewCoupon->display() /home/solodesc/public_html/libraries/joomla/application/component/controller.php:310
    8 JView->get() /home/solodesc/public_html/administrator/components/com_awocoupon/views/coupon/view.html.php:82
    9 AwoCouponModelCoupon->getEntry() /home/solodesc/public_html/libraries/joomla/application/component/view.php:364
    10 awoLibrary::getAwoItem() /home/solodesc/public_html/administrator/components/com_awocoupon/models/coupon.php:101
    11 JDatabaseMySQLi->loadObjectList() /home/solodesc/public_html/administrator/components/com_awocoupon/helpers/awolibrary.php:147
    12 JDatabaseMySQLi->query() /home/solodesc/public_html/libraries/joomla/database/database/mysqli.php:474
    13 JError->raiseError() /home/solodesc/public_html/libraries/joomla/database/database/mysqli.php:247
    14 JError->raise() /home/solodesc/public_html/libraries/joomla/error/error.php:171
    15 JException->__construct() /home/solodesc/public_html/libraries/joomla/error/error.php:136

  • Your avatar
    seyi    
     4 years ago
    0

    This is a collation issue. Its been talked about in the forum. You will need to go into your database, probably through phpmyadmin and check the character sets of some of the columns used in the query and make sure they match. Seeing this specific collation issue previously, the problem may be:

    Table vm_product
    Column product_name

    and

    Table awocoupon
    Column coupon_code

    One might be set to utf8_general_ci and the other set to utf8_unicode_ci. If the collation in both of those columns are different, change awocoupon.coupon_code to vm_product.product_name collation.
  • Default avatar
    goretex34    
     4 years ago
    0

    Have tried what you've proposed but it still fails.
    Any other idea please?

    More info:
    the 4 default examples in Virtuemart also display an error (test1, test2, test3, test4)

    Warning: Invalid argument supplied for foreach() in /home/solodesc/public_html/administrator/components/com_awocoupon/helpers/awolibrary.php on line 149


    and

    Warning: Invalid argument supplied for foreach() in /home/solodesc/public_html/administrator/components/com_awocoupon/views/coupon/tmpl/default.php on line 308


    Thanx!
  • Default avatar
    goretex34    
     4 years ago
    0

    You were right, collation problems

    I had my columns as "utf8_general_ci" and some of awo_coupons tables had columns as "utf8_unicode_ci"

    In my case, I've changed "jos_awocoupon_asset1.asset_id" , "jos_awocoupon_asset2.asset_id" and "jos_awocoupon.coupon_id"
    to "utf8_general_ci" collation.

    Thank you so much!
  • Your avatar
    seyi    
     4 years ago
    0

    what do you mean? where they off? did you change one? or where they identical? I would turn on debug mode again and check the mysql error. If it is the same, then it must be another table column causing the problem.
  • Your avatar
    seyi    
     4 years ago
    0

    indeed, you are welcome.