Coupons sometimes not transmittet and other PHP 8 issues


  • Default avatar
    christian9    
     a year ago
    0

    Hi,
    i have a strange problem. I am using AWO Coupons 3.6.0.7, VirtueMart 4.0.6, System - VP One Page Checkout 7.10.2 , Joomla 3.10.11, PHP 8.0.

    If I use a coupon in the checkout process, then everything is discounted correctly. But when I complete the purchase, it can happen that the coupon is not sent with it. The original price will then appear again in the completed order. I haven't found a pattern yet.

    I contacted the developer of System - VP One Page Checkout but they say it must have something to do with AwoCoupons.

    I saw something in my Error-Log, but i dont know if thats the problem:
    1. Undefined array key "billSub" in /xxx/administrator/components/com_awocoupon/helper/estore/virtuemart/class-awocoupon-helper-estore-virtuemart-discount.php on line 1017

    2. Undefined array key "billTaxAmount" in /xxx/administrator/components/com_awocoupon/helper/estore/virtuemart/class-awocoupon-helper-estore-virtuemart-discount.php on line 1018

    In addition there was also an PHP 8 issue in /xxx/administrator/components/com_awocoupon/helper/estore/virtuemart/class-awocoupon-helper-estore-virtuemart-discount.php in the public function convertWeightUnit (line: 2243):

    i had to change:

    $value = str_replace (',', '.', $value);
    if ($from === $to) {
        return $value;
    }

    $g = (float)$value;

    TO:

    $value = str_replace (',', '.', $value);
    if ($from === $to) {
        return $value;
    }
    if($value == ''){
        $value = 0;
    }
    $g = (float)$value;


    I think there are still some issues with php 8.

    Any idea?
    Many thanks in advance!
    Dirk
  • Your avatar
    seyi    
     a year ago
    0

    Hello,

    Not sure you are dealing with a php issue when the coupons drop out, but instead a virtuemart issue.  Sometimes Virtuemart deletes an order and creates a new one within the same transaction, taking out the coupon.  I mention an example here:

    The fix for this is to go to awocoupon > configuration > triggers and change 'Order state to trigger coupon processing' to your confirmed status instead of 'order creation'.

  • Default avatar
    christian9    
     a year ago
    0

    Hi,
    thanks for your answer. Unfortunately this was not the solution. I really think it has something to do with php 8, because when i switch to 7.4 everything works as expected. By the way, it worked for several years now.
  • Default avatar
    christian9    
     a year ago
    0

    to be clear, this behavier doesnt occur everytime. I just cant figure out a pattern.
  • Your avatar
    seyi    
     a year ago
    0

    I am not so sure, you have upgraded Virtuemart, which might have changed behavior in when it deletes/recreates an order.  Have a look at some of the orders where it has occurred, and look at the order_id's around it.  Are there missing order_id's?
  • Default avatar
    christian9    
     a year ago
    0

    no, there are no order_id's missing.