Zen Cart Logo
Forums / Bug Reports / Undefined index: shipping in classes/order.php

Undefined index: shipping in classes/order.php

Views: 4,466

Results 1 to 4 of 4
11 Sep 2017, 8:53 AM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,869
Plugin Contributions:
7

Undefined index: shipping in classes/order.php

Php 7.1.8
this is causing me an undefiend index notice (but not in normal use).

'shipping_module_code' => (isset($_session['shipping']['id']) && strpos($session['shipping']['id'], '') > 0 ? $_session['shipping']['id'] : $_session['shipping']),

If the clause is false why would shipping_module_code be set to $_session['shipping']?

11 Sep 2017, 2:54 PM
#2
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,956
Plugin Contributions:
8

Re: Undefined index: shipping in classes/order.php

in addition, i have never understood the use of the underscore ( _ ) in the code for the shipping module, and the searching for it as demonstrated here.

it seems that there is some sort of intelligence built into the code that makes it that more difficult to read/debug.

11 Sep 2017, 3:01 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: Undefined index: shipping in classes/order.php

carlwhat:

in addition, i have never understood the use of the underscore ( _ ) in the code for the shipping module, and the searching for it as demonstrated here.

it seems that there is some sort of intelligence built into the code that makes it that more difficult to read/debug.
Shipping modules can have multiple shipping-methods; the selected method is appended (separated by an underscore) to the end of the shipping_module selection.

11 Sep 2017, 3:09 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: Undefined index: shipping in classes/order.php

See also this bit of documentation on shipping-module innards.