From ee038c868c10acb4eb87c937670e1af8223052c5 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Wed, 17 Jul 2013 11:20:41 +0200 Subject: [PATCH] // Removed useless option "billing according to the default behavior" in the carrier wizard and carrier options --- classes/Carrier.php | 8 +++++ .../admin/AdminCarrierWizardController.php | 5 --- controllers/admin/AdminShippingController.php | 33 ++++++++++--------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/classes/Carrier.php b/classes/Carrier.php index 7b32bdab2..dcc976fb1 100644 --- a/classes/Carrier.php +++ b/classes/Carrier.php @@ -165,6 +165,14 @@ class CarrierCore extends ObjectModel public function __construct($id = null, $id_lang = null) { parent::__construct($id, $id_lang); + + /** + * keep retrocompatibility SHIPPING_METHOD_DEFAULT + * @deprecated 1.5.5 + */ + if ($this->shipping_method == Carrier::SHIPPING_METHOD_DEFAULT) + $this->shipping_method = ((int)Configuration::get('PS_SHIPPING_METHOD') ? Carrier::SHIPPING_METHOD_WEIGHT : Carrier::SHIPPING_METHOD_PRICE); + /** * keep retrocompatibility id_tax_rules_group * @deprecated 1.5.0 diff --git a/controllers/admin/AdminCarrierWizardController.php b/controllers/admin/AdminCarrierWizardController.php index 81dc8d576..d47515e95 100644 --- a/controllers/admin/AdminCarrierWizardController.php +++ b/controllers/admin/AdminCarrierWizardController.php @@ -271,11 +271,6 @@ class AdminCarrierWizardControllerCore extends AdminController 'class' => 't', 'br' => true, 'values' => array( - array( - 'id' => 'billing_default', - 'value' => Carrier::SHIPPING_METHOD_DEFAULT, - 'label' => $this->l('Default behavior') - ), array( 'id' => 'billing_price', 'value' => Carrier::SHIPPING_METHOD_PRICE, diff --git a/controllers/admin/AdminShippingController.php b/controllers/admin/AdminShippingController.php index 7d804b0f9..1aebd7026 100644 --- a/controllers/admin/AdminShippingController.php +++ b/controllers/admin/AdminShippingController.php @@ -69,22 +69,23 @@ class AdminShippingControllerCore extends AdminController ', 'submit' => array() ), - 'billing' => array( - 'title' => $this->l('Billing'), - 'icon' => 'money', - 'fields' => array( - 'PS_SHIPPING_METHOD' => array( - 'title' => $this->l('Billing'), - 'cast' => 'intval', - 'type' => 'radio', - 'choices' => array( - 0 => $this->l('According to total price'), - 1 => $this->l('According to total weight') - ), - 'validation' => 'isBool' - ), - ) - ), + // Deprecated since 1.5.5 + // 'billing' => array( + // 'title' => $this->l('Billing'), + // 'icon' => 'money', + // 'fields' => array( + // 'PS_SHIPPING_METHOD' => array( + // 'title' => $this->l('Billing'), + // 'cast' => 'intval', + // 'type' => 'radio', + // 'choices' => array( + // 0 => $this->l('According to total price'), + // 1 => $this->l('According to total weight') + // ), + // 'validation' => 'isBool' + // ), + // ) + // ), ); }