I know it is just warning, but it fills me error logPHP Warning: Undefined array key "VAT 22%" in xxx/administrator/components/com_awocoupon/helper/estore/hikashop/class-awocoupon-helper-estore-hikashop-discount.php on line 375
Php warning
- Hello,Will be fixed on the next update. But if you want to do it now, in the file, right above that line, you can add this and that should get rid of the warning:
<?php
if ( ! isset( $coupon_tax_amount[ $shipping->shippings[0]->tax_namekey ] ) ) {
$coupon_tax_amount[ $shipping->shippings[0]->tax_namekey ] = 0;
}
?> In what line should I put that code?
- Right before line 375.
- I have another onePHP Warning: Undefined property: stdClass::$order_status in xxx/administrator/components/com_awocoupon/helper/estore/hikashop/class-awocoupon-helper-estore-hikashop-giftcert.php on line 238
- Not sure how you are producing that error because I cannot produce it. What action are you taking when it happens?Also what versions of Awocoupon, hikashop are you using?
- I found it in error log. Hard to say when it hapens.
Latest Awo, Hika 5.0.3 latest, Joomla 4.4.3 latest, PHP 8.2.
Maybe this helps https://www.hikashop.com/forum/install-update/907696-some-php-warnings.html#359928 - Still have those errors filling my error log:
PHP Warning: Undefined property: stdClass::$order_status in /public_html/administrator/components/com_awocoupon/helper/estore/hikashop/class-awocoupon-helper-estore-hikashop-giftcert.php on line 238
PHP Warning: Undefined array key "DDV 22%" in /public_html/administrator/components/com_awocoupon/helper/estore/hikashop/class-awocoupon-helper-estore-hikashop-discount.php on line 395
Latest Hikashop 5.1, Awo 4.0.1.3, PHP 8.2.22 - Hello for this:/public_html/administrator/components/com_awocoupon/helper/estore/hikashop/class-awocoupon-helper-estore-hikashop-giftcert.php on line 238You can change that line to:
<?php
$order->order_status = isset( $in->order_status ) ? $in->order_status : '';
?>And for this:/public_html/administrator/components/com_awocoupon/helper/estore/hikashop/class-awocoupon-helper-estore-hikashop-discount.php on line 395You can change that line to:<?php
$current_tax_discount = empty( $coupon_tax_amount[ $namekey ] ) || empty( $total_tax_before_discount[ $namekey ] ) ? 0 : $coupon_tax_amount[ $namekey ] / $total_tax_before_discount[ $namekey ] * $current_tax;
?> - Please add to next update.