From 627125e1de3cc0ebcb7b3435a08de2b617eebc81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 3 Dec 2012 17:53:47 +0100 Subject: [PATCH] [-] BO: Fix #PSCFV-5706 save of product availability on global context --- .../template/controllers/products/quantities.tpl | 15 +++++++++++---- js/admin-products.js | 11 +++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/products/quantities.tpl b/admin-dev/themes/default/template/controllers/products/quantities.tpl index 1fce35216..852c15a66 100644 --- a/admin-dev/themes/default/template/controllers/products/quantities.tpl +++ b/admin-dev/themes/default/template/controllers/products/quantities.tpl @@ -26,6 +26,7 @@ {if isset($product->id)}

{l s='Available quantities for sale'}

+ {include file="controllers/products/multishop/check_fields.tpl" product_tab="Quantities"}

{l s='This interface allows you to manage the available quantities for sale of the current product and its combinations on the current shop.'}

@@ -206,8 +207,11 @@ {/if} - - + + {include file="controllers/products/multishop/checkbox.tpl" field="available_now" type="default" multilang="true"} + + + {include file="controllers/products/input_text_lang.tpl" languages=$languages input_value=$product->available_now @@ -216,8 +220,11 @@ - - + + {include file="controllers/products/multishop/checkbox.tpl" field="available_later" type="default" multilang="true"} + + + {include file="controllers/products/input_text_lang.tpl" languages=$languages input_value=$product->available_later diff --git a/js/admin-products.js b/js/admin-products.js index 01af4d0a5..997e8c776 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -1226,6 +1226,8 @@ product_tabs['Quantities'] = new function(){ self.refreshQtyAvailabilityForm(); self.ajaxCall({actionQty: 'out_of_stock', value: $(this).val()}); }); + if (display_multishop_checkboxes) + ProductMultishop.checkAllQuantities(); self.refreshQtyAvailabilityForm(); }; @@ -1574,6 +1576,15 @@ var ProductMultishop = new function() ProductMultishop.checkField($('input[name=\'multishop_check[link_rewrite]['+v.id_lang+']\']').prop('checked'), 'link_rewrite_'+v.id_lang); }); }; + + this.checkAllQuantities = function() + { + $.each(languages, function(k, v) + { + ProductMultishop.checkField($('input[name=\'multishop_check[available_later]['+v.id_lang+']\']').prop('checked'), 'available_later_'+v.id_lang); + ProductMultishop.checkField($('input[name=\'multishop_check[available_now]['+v.id_lang+']\']').prop('checked'), 'available_now_'+v.id_lang); + }); + }; this.checkAllAssociations = function() {