Fix suggestions
-
1) calculations
calls like:
get_price()
change to:
get_price('edit')
called with no parameter the price is returned in View mode after filters are applied, these filters may include currency conversion, if you have a converter plugin installed.
If you then do the calculations based on the already converted price you can get some odd things happening like doubly-converted numbers, basically wrong price.
If you call the function with edit then no filters are applied, you get the raw price as per admin edit screens.2) array testing
change:
$woosb_item_qty = ( $woosb_item_arr[1] ? $woosb_item_arr[1] : 1;
to:
$woosb_item_qty = ( sizeof($woosb_item_arr) > 1) ? $woosb_item_arr[1] : 1;
better to test the size, to avoid error if there is no value…3)
session_start()
change to
if(session_status()==PHP_SESSION_NONE) session_start();
to avoid session already started notices
- The topic ‘Fix suggestions’ is closed to new replies.