Giftwrapping

Notice: Undefined index: gift_wra - Giftwrapping

Notice: Undefined index: gift_wra

by Omar_one » Mon May 23, 2022 12:32 pm

Hello Daniel,
I have any error (1.0.8.14)

Code: Select all

Notice: Undefined index: gift_wrap in /home/test/public_html/shop/includes/modules/order_total/ot_giftwrap.php on line 21
and the lines from 21 -27

Code: Select all

if (MODULE_ORDER_TOTAL_GIFTWRAP_STATUS == 'True' && $_SESSION['gift_wrap'] == 'true') {        
		if (MODULE_ORDER_TOTAL_GIFTWRAP_PER_ITEM_GIFTWRAP == 'Per Item') {			  
		  $fee = MODULE_ORDER_TOTAL_GIFTWRAP_FEE * $_SESSION['cart']->count_contents();
		} else {
		  $fee = MODULE_ORDER_TOTAL_GIFTWRAP_FEE;
		}			
Br
Omar
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Contact:

Re: Notice: Undefined index: gift_wra

by Kofod95 » Mon May 23, 2022 9:04 pm

Hello Omar,

I cannot get that notice to show up, could you provide the steps taken to make it show?

Anyway, I would think adding

Code: Select all

&& isset($_SESSION['gift_wrap'])
before it checks if it's true would solve the error.

Complete line 21:

Code: Select all

if (MODULE_ORDER_TOTAL_GIFTWRAP_STATUS == 'True' && isset($_SESSION['gift_wrap']) && $_SESSION['gift_wrap'] == 'true') { 



//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
VIP Member
VIP Member
Posts: 605
Joined: Sat Feb 06, 2021 7:38 pm
Contact: