From cc1fddd52dac98830fa5fc0d2f9c5258aba91ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Nadaud?= Date: Thu, 25 Jul 2013 16:24:43 +0200 Subject: [PATCH] [+] BO : Product "For" and new carriers select list --- .../controllers/products/shipping.tpl | 49 ++++++++++--------- controllers/admin/AdminProductsController.php | 5 +- js/admin-products.js | 26 ++++++++++ 3 files changed, 56 insertions(+), 24 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/products/shipping.tpl b/admin-dev/themes/default/template/controllers/products/shipping.tpl index 122baca91..d0122d172 100644 --- a/admin-dev/themes/default/template/controllers/products/shipping.tpl +++ b/admin-dev/themes/default/template/controllers/products/shipping.tpl @@ -81,26 +81,31 @@
- -
- - + +
+
+
+ + + {l s='Add'} +
+
+ + + {l s='Remove'} +
+
-
- - \ No newline at end of file +
\ No newline at end of file diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 362a92562..4bd25af78 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3603,8 +3603,9 @@ class AdminProductsControllerCore extends AdminController { $carriers = array(); - if (Tools::getValue('carriers')) - $carriers = Tools::getValue('carriers'); + if (Tools::getValue('selectedCarriers')) + $carriers = Tools::getValue('selectedCarriers'); + $product->setCarriers($carriers); } } diff --git a/js/admin-products.js b/js/admin-products.js index b148f7734..ef33ae927 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -760,6 +760,32 @@ product_tabs['Attachments'] = new function(){ }; } +product_tabs['Shipping'] = new function(){ + var self = this; + + this.bindCarriersEvents = function (){ + $("#addCarrier").live('click', function() { + $('#availableCarriers option:selected').each( function() { + $('#selectedCarriers').append(""); + $(this).remove(); + }); + $('#selectedCarriers option').prop('selected', true); + }); + + $("#removeCarrier").live('click', function() { + $('#selectedCarriers option:selected').each( function() { + $('#availableCarriers').append(""); + $(this).remove(); + }); + $('#selectedCarriers option').prop('selected', true); + }); + }; + + this.onReady = function(){ + self.bindCarriersEvents(); + }; +} + product_tabs['Informations'] = new function(){ var self = this; this.bindAvailableForOrder = function (){