AWO Coupon Display Text being saved to virtuemart orders table as coupon_code


  • Default avatar
    simon82    
     17 days ago  last edited 17 days ago
    0

    On Joomla 5.4.1 with Virtuemart 4.6.4 11226, VP One Page Checkout 7.35 and Awocoupon 4.1.0.1.
    When an AWOCoupon is applied to an order and has display text set for it, upon placing the order the display text will be passed to the virtuemart_orders table as the coupon_code entered.
     
    I've gone into the administrator component where the coupon discounts are handled in component/com_awocoupon/awocoupon/library/class-awocoupon-library-discount.php on line 4457 and  the coupon_code session parameter is being set to an imploded version of the $coupon_codes_noauto array, which is just an array of the various display texts.


    Now in the course of testing it turns out by switching the 'coupon_code' entry from 'coupon_code'=> implode(', ', $coupon_codes_noauto), to 'coupon_code'=>implode(', ', $coupon_codes) it resolves the issue and the proper set of coupon cods get passed to the virtuemart_orders table. Doing this does not harm the display of the associated display text in the checkout. 

    Simply updating the way I described above, and passing the cumulative display text as coupon_display_text, rather than passing it as coupon_code, which virtuemart is expecting for the order system, resolves the entire issue

  • Default avatar
    simon82    
     14 days ago
    0

    Again, the issue is how the display text is currently being saved handled. By saving it as the coupon_code param to the virtuemart session, You're setting up the virtuemart plugin to put the display text into the virtuemart_orders table as the coupon_code.
  • Your avatar
    seyi    
     13 days ago
    0

    Hello,

    The display text feature is to be shown to the user once the coupon code is entered in the cart and in the invoices, emails..etc.  So yes, it is added to the vm order table.  It is not an issue, it was intended that way.
  • Default avatar
    simon82    
     13 days ago  last edited 13 days ago
    0

    Okay, is there any easy way we can reliably display the actual coupon code on the administrative side then?

  • Your avatar
    seyi    
     11 days ago
    0

    You can always view the coupon codes used in awocoupon > history of uses.  But to view within virtuemart order in admin is not possible without making modifications to AwoCoupon, as you did in the first post.

  • Default avatar
    simon82    
     7 days ago  last edited 7 days ago
    0

    So what would be the ideal way to track down the coupon id and code in Awo's environment, so we can display the appropriate code in our system on our administrative order listings?
  • Your avatar
    seyi    
     6 days ago
    0

    The coupon codes used are in #__awocoupon_history table. You can filter by order_id

    SELECT * FROM #__awocoupon_history WHERE order_id=[virtuemart_order_id]
  • Default avatar
    simon82    
     3 days ago
    0

    That's actually the solution we went with.
    I'm assuming that's the only way then?