Joomla 3.43 and Virtuemart 3.0.9 - Applied Coupon Notices - Undefined index


  • Default avatar
    inorvock    
     8 years ago
    0

    After applying a discount coupon I am receiving the following errors/notices on checkout.

    Notice: Undefined index: salesPriceShipment in /home/edgycraf/public_html/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php on line 650

    Notice: Undefined index: shipmentValue in /home/edgycraf/public_html/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php on line 753

    Notice: Undefined index: salesPriceShipment in /home/edgycraf/public_html/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php on line 754

    Appreciate your assistnace to resolve.
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    Here are the fixes to the warnings, all in the file:
    /home/edgycraf/public_html/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php

    Line 650 is this:
    <?php
    $string 
    $this->vmcartPrices['basePriceWithTax'].'|'.$this->vmcartPrices['salesPriceShipment'].'|'.$coupon_code.'|'.$user->id.'|'.$user_email;
    ?>


    Please change it to this:
    <?php
    $string 
    $this->vmcartPrices['basePriceWithTax'].'|'.(isset($this->vmcartPrices['salesPriceShipment']) ? $this->vmcartPrices['salesPriceShipment'] : 0).'|'.$coupon_code.'|'.$user->id.'|'.$user_email;
    ?>



    And line 753/754 is this
    <?php
                
    'total_notax'=>(float)$this->vmcartPrices['shipmentValue'],
                
    'total'=>(float)$this->vmcartPrices['salesPriceShipment'],
    ?>


    Please change to this:
    <?php
                
    'total_notax'=>isset($this->vmcartPrices['shipmentValue']) ? (float)$this->vmcartPrices['shipmentValue'] : 0,
                
    'total'=>isset($this->vmcartPrices['salesPriceShipment']) ? (float)$this->vmcartPrices['salesPriceShipment'] : 0,
    ?>


    That should get rid of the warnings.
  • Default avatar
    inorvock    
     8 years ago
    0

    Thanks Seyi - that did the trick!!