[-] BO: Fix #PSCFV-5706 save of product availability on global context

This commit is contained in:
Rémi Gaillard
2012-12-03 17:53:47 +01:00
parent f8365220e2
commit 627125e1de
2 changed files with 22 additions and 4 deletions
@@ -26,6 +26,7 @@
{if isset($product->id)}
<input type="hidden" name="submitted_tabs[]" value="Quantities" />
<h4>{l s='Available quantities for sale'}</h4>
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Quantities"}
<div class="separation"></div>
<div class="hint" style="display:block; position:'auto';">
<p>{l s='This interface allows you to manage the available quantities for sale of the current product and its combinations on the current shop.'}</p>
@@ -206,8 +207,11 @@
</tr>
{/if}
<tr>
<td class="col-left"><label>{l s='Displayed text when in-stock:'}</label></td>
<td style="padding-bottom:5px;">
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="available_now" type="default" multilang="true"}
<label>{l s='Displayed text when in-stock:'}</label>
</td>
<td style="padding-bottom:5px;" class="col-right">
{include file="controllers/products/input_text_lang.tpl"
languages=$languages
input_value=$product->available_now
@@ -216,8 +220,11 @@
</td>
</tr>
<tr>
<td class="col-left"><label>{l s='Displayed text when allowed to be back-ordered:'}</label></td>
<td style="padding-bottom:5px;">
<td class="col-left">
{include file="controllers/products/multishop/checkbox.tpl" field="available_later" type="default" multilang="true"}
<label>{l s='Displayed text when allowed to be back-ordered:'}</label>
</td>
<td style="padding-bottom:5px;" class="col-right">
{include file="controllers/products/input_text_lang.tpl"
languages=$languages
input_value=$product->available_later
+11
View File
@@ -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()
{