Merge pull request #11 from cyradin/master

fix order send fail when delivery code is an empty string
This commit is contained in:
Alex Lushpai 2016-08-02 14:34:54 +03:00 committed by GitHub
commit fcfe1ea641

View File

@ -136,7 +136,9 @@ class ModelRetailcrmOrder extends Model {
$country = (isset($order_data['shipping_country'])) ? $order_data['shipping_country'] : '' ;
$order['delivery'] = array(
'code' => $settings['retailcrm_delivery'][$delivery_code],
'code' => !empty($settings['retailcrm_delivery'][$delivery_code])
? $settings['retailcrm_delivery'][$delivery_code]
: null,
'cost' => $deliveryCost,
'address' => array(
'index' => $order_data['shipping_postcode'],