// Suppliers : Manage multiple suppliers for a product / product attribute + integration with supply orders

This commit is contained in:
dSevere
2011-11-18 16:29:50 +00:00
parent 95a3c021f7
commit 12e7f3a0b4
18 changed files with 1196 additions and 568 deletions
@@ -7,7 +7,7 @@
updateMvtStatus($(this).val());
});
updateMvtStatus($(this).val());
if ( $("input[name=is_virtual_file]:checked").val() == 1)
{
$("#virtual_good_attributes").show();
@@ -18,7 +18,7 @@
$("#virtual_good_attributes").hide();
$("#is_virtual_file_product").hide();
}
$("input[name=is_virtual_file]").live("change", function() {
if($(this).val() == "1")
{
@@ -31,7 +31,7 @@
$("#is_virtual_file_product").hide();
}
});
});
});
</script>
<script type="text/javascript">
var attrs = new Array();
@@ -39,7 +39,7 @@
attrs[0] = new Array(0, "---");
{foreach from=$attributeJs key=idgrp item=group}
attrs[{$idgrp}] = new Array(0
, '---'
, '---'
{foreach from=$group key=idattr item=attrname}
, "{$idattr}", "{$attrname|addslashes}"
{/foreach}
@@ -98,22 +98,17 @@
<td style="padding-bottom:5px;">
<input size="55" type="text" id="attribute_reference" name="attribute_reference" value="" style="width: 130px; margin-right: 44px;" />
{l s='EAN13:'}<input size="55" maxlength="13" type="text" id="attribute_ean13" name="attribute_ean13" value="" style="width: 110px; margin-left: 10px; margin-right: 44px;" />
{l s='UPC:'}<input size="55" maxlength="12" type="text" id="attribute_upc" name="attribute_upc" value="" style="width: 110px; margin-left: 10px;" />
{l s='UPC:'}<input size="55" maxlength="12" type="text" id="attribute_upc" name="attribute_upc" value="" style="width: 110px; margin-left: 10px; margin-right: 44px;" />
<span class="hint" name="help_box">{l s='Special characters allowed:'} .-_#<span class="hint-pointer">&nbsp;</span></span>
</td>
</tr>
<tr>
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">{l s='Supplier Reference:'}</td>
<td style="padding-bottom:5px;">
<input size="55" type="text" id="attribute_supplier_reference" name="attribute_supplier_reference" value="" style="width: 130px; margin-right: 44px;" />
{l s='Location:'}<input size="55" type="text" id="attribute_location" name="attribute_location" value="" style="width: 101px; margin-left: 10px;" />
<span class="hint" name="help_box">{l s='Special characters allowed:'} .-_#<span class="hint-pointer">&nbsp;</span></span>
</td>
</tr>
<tr><td colspan="2"><div class="separation"></div></td></tr>
<table cellpadding="5" id="virtual_good_attributes" style="width:100%;display:none;">
<tr>
<td colspan="2">
<td colspan="2">
<div style="padding:5px;width:50%;float:left;margin-right:20px;border-right:1px solid #E0D0B1">
<p>{l s='Your server\'s maximum upload file size is'}:&nbsp;{$upload_max_filesize}</p>
<label id="virtual_product_file_attribute_label" for="virtual_product_file_attribute" class="t">{l s='Upload a file'}</label>
@@ -122,7 +117,7 @@
<p id="gethtmlink" style="display: none;">{l s='This is the link'} :&nbsp;{$product->productDownload->getHtmlLink(false, true)}
<a id="make_downloadable_product_attribute" onclick="return confirm('{l s='Delete this file' slashes=1 js=1}')" href="index.php?tab=AdminProducts&id_product={$product->productDownload->id_product}&id_category={$id_category}&token={$token}&deleteVirtualProductAttribute=true" class="red">{l s='Delete this file'}</a>
</p>
</p>
</div>
<a id="delete_downloadable_product_attribute" style="display:none;" onclick="return confirm('{l s='Delete this file' slashes=1 js=1}')" href="index.php?tab=AdminProducts&id_product={$product->id}&id_category={$id_category}&token={$token}&deleteVirtualProductAttribute=true" class="red">{l s='Delete this file'}</a>
@@ -183,10 +178,10 @@
{if $country_display_tax_label}
{l s='(tax excl.)'}
<span {if $tax_exclude_option}style="display:none"{/if}> {l s='or'} {if $currency->format % 2 != 0}{$currency->sign} {/if}
<input type="text" size="6" name="attribute_priceTI" id="attribute_priceTI" value="0.00"
<input type="text" size="6" name="attribute_priceTI" id="attribute_priceTI" value="0.00"
onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); calcImpactPriceTE();"/>
{if $currency->format % 2 == 0} {$currency->sign}{/if} {l s='(tax incl.)'}
</span> {l s='final product price will be set to'}
</span> {l s='final product price will be set to'}
{if $currency->format % 2 != 0}{$currency->sign} {/if}
<span id="attribute_new_total_price">0.00</span>
{if $currency->format % 2 == 0}{$currency->sign} {/if}
@@ -222,7 +217,7 @@
{l s='Eco-tax:'}
</td>
<td style="padding-bottom:5px;">{if $currency->format % 2 != 0}{$currency->sign}{/if}
<input type="text" size="3" name="attribute_ecotax" id="attribute_ecotax" value="0.00"
<input type="text" size="3" name="attribute_ecotax" id="attribute_ecotax" value="0.00"
onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.');" />
{if $currency->format % 2 == 0} {$currency->sign}{/if}
({l s='overrides Eco-tax on Information tab'})
@@ -28,7 +28,7 @@
}
});
$.ajax({
/*$.ajax({
url: "ajax-tab.php",
cache: false,
dataType: "json",
@@ -51,7 +51,7 @@
$("select#id_supplier").replaceWith("<p id=\"id_supplier\">[TECHNICAL ERROR] ajaxProductSuppliers : "+textStatus+"</p>");
}
});
});*/
if ($('#available_for_order').is(':checked')){
$('#show_price').attr('checked', 'checked');
$('#show_price').attr('disabled', 'disabled');
@@ -90,7 +90,7 @@
<td style="padding-bottom:5px;" class="translatable">
{foreach from=$languages item=language}
<div class="lang_{$language.id_lang}" style="{if !$language.is_default}display: none;{/if} float: left;">
<input class="{if !$product->id}copy2friendlyUrl{/if} updateCurrentText" size="43" type="text"
<input class="{if !$product->id}copy2friendlyUrl{/if} updateCurrentText" size="43" type="text"
id="name_{$language.id_lang}" name="name_{$language.id_lang}"
value="{$product->name[$language.id_lang]|htmlentitiesUTF8|default:''}"/><sup> *</sup>
<span class="hint" name="help_box">{l s='Invalid characters:'} <>;=#{}<span class="hint-pointer">&nbsp;</span>
@@ -107,13 +107,13 @@
<span class="hint" name="help_box">{l s='Special characters allowed:' }.-_#\<span class="hint-pointer">&nbsp;</span></span>
</td>
</tr>
<tr>
<!--tr>
<td class="col-left"><label>{l s='Supplier Reference:' }</label></td>
<td style="padding-bottom:5px;">
<input size="55" type="text" name="supplier_reference" value="{$product->supplier_reference|htmlentitiesUTF8}" style="width: 130px; margin-right: 44px;" />
<span class="hint" name="help_box">{l s='Special characters allowed:' } .-_#\<span class="hint-pointer">&nbsp;</span></span>
</td>
</tr>
</tr-->
<tr>
<td class="col-left"><label>{l s='EAN13 or JAN:' }</label></td>
<td style="padding-bottom:5px;">
@@ -132,8 +132,6 @@
<input size="55" type="text" name="location" value="{$product->location|htmlentitiesUTF8}" style="width: 130px; margin-right: 44px;" />
</td>
</tr>
</table>
{* status informations *}
<table cellpadding="5" style="width: 40%; float: left; margin-left: 10px;">
@@ -141,7 +139,7 @@
<td class="col-left"><label>{l s='Status:' }</label></td>
<td style="padding-bottom:5px;">
<input style="float:left;" onclick="toggleDraftWarning(false);showOptions(true);" type="radio" name="active" id="active_on" value="1" {if $product->active}checked="checked" {/if} />
<label for="active_on" class="t"><img src="../img/admin/enabled.gif" alt="{l s='Enabled'}"
<label for="active_on" class="t"><img src="../img/admin/enabled.gif" alt="{l s='Enabled'}"
title="{l s='Enabled'}" style="float:left; padding:0px 5px 0px 5px;" />
{l s='Enabled'}</label>
<br class="clear" />
@@ -171,7 +169,7 @@
}
else
{
$('#show_price').attr('disabled', '');
$('#show_price').attr('disabled', '');
}
});
});
@@ -210,7 +208,7 @@
</a>
</td>
</tr>
<tr>
<!--tr>
<td class="col-left"><label>{l s='Supplier:' }</label></td>
<td style="padding-bottom:5px;">
<select name="id_supplier" id="id_supplier">
@@ -224,7 +222,7 @@
<img src="../img/admin/add.gif" alt="{l s='Create'}" title="{l s='Create'}" /> <b>{l s='Create'}</b>
</a>
</td>
</tr>
</tr-->
</table>
<div class="clear"></div>
<table cellpadding="5" cellspacing="0" border="0" style="width: 100%;"><tr><td><div class="separation"></div></td></tr></table>
@@ -341,7 +339,7 @@ function delPackItem(id)
ids = ids.replace(/\,$/,'');
return ids;
}
$(function() {
$('#curPackItemName')
.autocomplete('ajax_products_list.php', {
@@ -451,7 +449,7 @@ $(document).ready(function(){
<table cellpadding="5" style="width: 50%; float: left; margin-right: 20px; border-right: 1px solid #E0D0B1;">
<tr><td>
<br/>{l s='Does this product has an associated file ?'}<br />
<input type="radio" value="1" id="virtual_good_file_1" name="is_virtual_file" {if $product_downloaded}checked="checked"{/if} />{l s='Yes'}
<input type="radio" value="1" id="virtual_good_file_1" name="is_virtual_file" {if $product_downloaded}checked="checked"{/if} />{l s='Yes'}
<input type="radio" value="0" id="virtual_good_file_2" name="is_virtual_file" {if !$product_downloaded}checked="checked"{/if} />{l s='No'}<br /><br />
{if $download_product_file_missing}
<p class="alert" id="file_missing">
@@ -494,9 +492,9 @@ $(document).ready(function(){
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$product->productDownload->filename}" />
{l s='This is the link'}:&nbsp;{$product->productDownload->getHtmlLink(false, true)}
<a onclick="return confirm('{l s='Delete this file' slashes=1 js=1})')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">{l s='Delete this file'}</a>
{/if}
{/if}
</p>
<p class="block">
<label for="virtual_product_name" class="t">{l s='Filename'}</label>
<input type="text" id="virtual_product_name" name="virtual_product_name" style="width:200px" value="{$product->productDownload->display_filename|htmlentitiesUTF8}" />
@@ -586,7 +584,7 @@ $(document).ready(function(){
<tr>
<td colspan="2" style="padding-bottom:5px;"><div class="separation"></div></td>
</tr>
{* @todo : prices related has to be moved in price subtab *}
<tr>
<td class="col-left"><label>{l s='Pre-tax wholesale price:'}</label></td>
@@ -619,7 +617,7 @@ $(document).ready(function(){
{/foreach}
ecotaxTaxRate = {$ecotaxTaxRate / 100};
</script>
<span {if $tax_exclude_taxe_option}style="display:none;"{/if} >
<select onChange="javascript:calcPriceTI(); unitPriceWithTax('unit');" name="id_tax_rules_group" id="id_tax_rules_group" {if $tax_exclude_taxe_option}disabled="disabled"{/if} >
<option value="0">{l s='No Tax'}</option>
@@ -658,10 +656,10 @@ $(document).ready(function(){
<td class="col-left"><label>{l s='Unit price without tax:' }</label></td>
<td style="padding-bottom:5px;">
{$currency->prefix} <input size="11" maxlength="14" id="unit_price" name="unit_price" type="text" value="{$product->unit_price}"
onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>{$currency->suffix}
onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, '.'); unitPriceWithTax('unit');"/>{$currency->suffix}
{l s='per'} <input size="6" maxlength="10" id="unity" name="unity" type="text" value="{$product->unity|htmlentitiesUTF8}" onkeyup="if (isArrowKey(event)) return ;unitySecond();" onchange="unitySecond();"/>
{if $ps_tax && $country_display_tax_label}
<span style="margin-left:15px">{l s='or'}
<span style="margin-left:15px">{l s='or'}
{$currency->prefix}<span id="unit_price_with_tax">0.00</span>{$currency->suffix}
{l s='per'} <span id="unity_second">{$product->unity}</span> {l s='with tax'}
</span>
@@ -697,7 +695,7 @@ $(document).ready(function(){
</tr>
{* [end] prices *}
<tr><td colspan="2" style="padding-bottom:5px;"><div class="separation"></div></td></tr>
{if !$ps_stock_management}
<tr>
@@ -716,7 +714,7 @@ $(document).ready(function(){
<tr><td colspan="2" style="padding-bottom:5px;"><div class="separation"></div></td></tr>
<tr>
<td class="col-left"><label>{l s='Additional shipping cost:'}</label></td>
<td style="padding-bottom:5px;">{$currency->prefix}<input type="text" name="additional_shipping_cost"
<td style="padding-bottom:5px;">{$currency->prefix}<input type="text" name="additional_shipping_cost"
value="{$product->additional_shipping_cost}" />{$currency->suffix}
{if $country_display_tax_label}{l s='tax excl.'}{/if}
<p>{l s='Carrier tax will be applied.'}</p>
@@ -725,9 +723,9 @@ $(document).ready(function(){
<tr>
<td class="col-left"><label>{l s='Displayed text when in-stock:'}</label></td>
<td style="padding-bottom:5px;">
{include file="products/input_text_lang.tpl"
languages=$languages
input_value=$product->available_now
{include file="products/input_text_lang.tpl"
languages=$languages
input_value=$product->available_now
input_name='available_now'}
<span class="hint" name="help_box">{l s='Forbidden characters:'} <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
</td>
@@ -735,15 +733,15 @@ $(document).ready(function(){
<tr>
<td class="col-left"><label>{l s='Displayed text when allowed to be back-ordered:'}</label></td>
<td style="padding-bottom:5px;">
{include file="products/input_text_lang.tpl"
languages=$languages
{include file="products/input_text_lang.tpl"
languages=$languages
input_value=$product->available_later
input_name='available_later'}
<span class="hint" name="help_box">{l s='Forbidden characters:'} <>;=#{}<span class="hint-pointer">&nbsp;</span></span>
</td>
</tr>
{if $countAttributes}
{* .(($this->getFieldValue($product, 'available_date') != 0) ? stripslashes(htmlentities(Tools::displayDate($this->getFieldValue($product, 'available_date'), $language['id_lang']))) : '0000-00-00').'" *}
<tr>
<td class="col-left"><label>{l s='Available date:'}</label></td>
@@ -760,13 +758,13 @@ $(document).ready(function(){
<tr>
<td class="col-left"><label>{l s='When out of stock:'}</label></td>
<td style="padding-bottom:5px;">
<input type="radio" name="out_of_stock" id="out_of_stock_1" value="0" {if $product->out_of_stock == 0}checked="checked"{/if} />
<input type="radio" name="out_of_stock" id="out_of_stock_1" value="0" {if $product->out_of_stock == 0}checked="checked"{/if} />
<label for="out_of_stock_1" class="t" id="label_out_of_stock_1">{l s='Deny orders'}</label>
<br /><input type="radio" name="out_of_stock" id="out_of_stock_2" value="1" {if $product->out_of_stock == 1}checked="checked"{/if} />
<br /><input type="radio" name="out_of_stock" id="out_of_stock_2" value="1" {if $product->out_of_stock == 1}checked="checked"{/if} />
<label for="out_of_stock_2" class="t" id="label_out_of_stock_2">{l s='Allow orders'}</label>
<br /><input type="radio" name="out_of_stock" id="out_of_stock_3" value="2" {if $product->out_of_stock == 2}checked="checked"{/if} />
<label for="out_of_stock_3" class="t" id="label_out_of_stock_3">{l s='Default:'}
<i>{if $ps_order_out_of_stock}{l s='Allow orders'}{else}{l s='Deny orders'}{/if}</i> ({l s='as set in'} <a href="{$link->getAdminLink('AdminPPreferences')}"
<br /><input type="radio" name="out_of_stock" id="out_of_stock_3" value="2" {if $product->out_of_stock == 2}checked="checked"{/if} />
<label for="out_of_stock_3" class="t" id="label_out_of_stock_3">{l s='Default:'}
<i>{if $ps_order_out_of_stock}{l s='Allow orders'}{else}{l s='Deny orders'}{/if}</i> ({l s='as set in'} <a href="{$link->getAdminLink('AdminPPreferences')}"
onclick="return confirm(\'{l s='Are you sure you want to delete entered product information?'}')">{l s='Preferences'}</a>)</label>
</td>
</tr>
@@ -775,7 +773,7 @@ $(document).ready(function(){
<div class="separation"></div>
</td>
</tr>
<tr>
<td class="col-left"><label for="id_category_default" class="t">
{l s='Default category:'}
@@ -805,9 +803,9 @@ $(document).ready(function(){
<tr>
<td class="col-left"><label>{l s='Meta title:'}</label></td>
<td>
{include file="products/input_text_lang.tpl"
languages=$languages
input_name='meta_title'
{include file="products/input_text_lang.tpl"
languages=$languages
input_name='meta_title'
input_value=$product->meta_title}
<p class="clear">{l s='Product page title; leave blank to use product name'}</p>
</td>
@@ -815,9 +813,9 @@ $(document).ready(function(){
<tr>
<td class="col-left"><label>{l s='Meta description:'}</label></td>
<td>
{include file="products/input_text_lang.tpl"
languages=$languages
input_name='meta_description'
{include file="products/input_text_lang.tpl"
languages=$languages
input_name='meta_description'
input_value=$product->meta_description
input_hint='{l s=\'Forbidden characters:\'\} <>;=#{\}'
}
@@ -827,7 +825,7 @@ $(document).ready(function(){
<tr>
<td class="col-left"><label>{l s='Meta keywords:'}</label></td>
<td>
{include file="products/input_text_lang.tpl" languages=$languages
{include file="products/input_text_lang.tpl" languages=$languages
input_value=$product->meta_keywords
input_name='meta_keywords'}
<p class="clear">{l s='Keywords for HTML header, separated by a comma'}</p>
@@ -836,15 +834,15 @@ $(document).ready(function(){
<tr>
<td class="col-left"><label>{l s='Friendly URL:'}</label></td>
<td>
{include file="products/input_text_lang.tpl"
languages=$languages
input_value=$product->link_rewrite
{include file="products/input_text_lang.tpl"
languages=$languages
input_value=$product->link_rewrite
input_name='link_rewrite'}
<p class="clear" style="padding:10px 0 0 0">
<a style="cursor:pointer" class="button"
<a style="cursor:pointer" class="button"
onmousedown="updateFriendlyURLByName();">{l s='Generate'}</a>&nbsp;{l s='Friendly-url from product\'s name.'}<br /><br />
{l s='Product link will look like this:'}
{l s='Product link will look like this:'}
{if $ps_ssl_enabled}https://{else}http://{/if}{*$smarty.server.SERVER_NAME*}/<b>id_product</b>-<span id="friendly-url"></span>.html</p>
</td>
</tr>
@@ -855,8 +853,8 @@ $(document).ready(function(){
<tr>
<td class="col-left"><label>{l s='Short description:'}<br /><br /><i>({l s='appears in the product lists and on the top of the product page'})</i></label></td>
<td style="padding-bottom:5px;">
{include file="products/textarea_lang.tpl"
languages=$languages
{include file="products/textarea_lang.tpl"
languages=$languages
input_name='description_short'
input_value=$product->description_short}
@@ -865,8 +863,8 @@ $(document).ready(function(){
</tr>
<tr>
<td class="col-left"><label>{l s='Description:'}<br /><br /><i>({l s='appears in the body of the product page'})</i></label></td>
<td style="padding-bottom:5px;">
{include file="products/textarea_lang.tpl" languages=$languages
<td style="padding-bottom:5px;">
{include file="products/textarea_lang.tpl" languages=$languages
input_name='description'
input_value=$product->description
}
@@ -875,7 +873,7 @@ $(document).ready(function(){
</tr>
{if $images}
<tr>
<td class="col-left"><label></label></td>
<td style="padding-bottom:5px;">
@@ -921,11 +919,11 @@ $(document).ready(function(){
<label for="imageTypes_{$key}" class="t">{$type.name} <span>({$type.width}px par {$type.height}px)</span></label>
<br />
{/foreach}
<p class="clear"></p>
</td>
</tr>
<tr>
<td class="col-left"><label>{l s='Image tag to insert:'}</label></td>
<td style="padding-bottom:5px;">
@@ -938,7 +936,7 @@ $(document).ready(function(){
<p class="clear"></p>
</td>
</tr>
<script type="text/javascript">
$(function() {
changeTagImage();
@@ -0,0 +1,223 @@
<script type="text/javascript">
var showAjaxError = function(msg)
{
$('#available_quantity_ajax_error_msg').html(msg);
$('#available_quantity_ajax_error_msg').show();
$('#available_quantity_ajax_msg').hide();
$('#available_quantity_ajax_success_msg').hide();
};
var showAjaxSuccess = function(msg)
{
$('#available_quantity_ajax_success_msg').html(msg);
$('#available_quantity_ajax_error_msg').hide();
$('#available_quantity_ajax_msg').hide();
$('#available_quantity_ajax_success_msg').show();
};
var showAjaxMsg = function(msg)
{
$('#available_quantity_ajax_msg').html(msg);
$('#available_quantity_ajax_error_msg').hide();
$('#available_quantity_ajax_msg').show();
$('#available_quantity_ajax_success_msg').hide();
};
var ajaxCall = function(data)
{
data.ajaxProductQuantity = 1;
data.id_product = '{$product->id}';
data.token = "{$token}";
data.ajax = 1;
data.controller = "AdminProducts";
data.action = "productQuantity";
showAjaxMsg('{l s="Saving data..."}');
$.ajax({
type: "POST",
url: "ajax-tab.php",
data: data,
dataType: 'json',
async : true,
success: function(msg)
{
if (msg.error)
{
showAjaxError('{l s="Error durring saving data"}');
return;
}
showAjaxSuccess('{l s="Data saved"}');
},
error: function(msg)
{
showAjaxError('{l s="Error durring saving data"}');
}
});
};
var refreshQtyAvaibilityForm = function()
{
if ($('#depends_on_stock_0').attr('checked'))
{
$('.available_quantity').find('input').show();
$('.available_quantity').find('span').hide();
}
else
{
$('.available_quantity').find('input').hide();
$('.available_quantity').find('span').show();
}
};
$('.depends_on_stock').click(function(e)
{
refreshQtyAvaibilityForm();
ajaxCall( { actionQty: 'depends_on_stock', value: $(this).attr('value') } );
if($(this).val() == 0)
$('.available_quantity input').trigger('change');
});
$('.available_quantity').find('input').change(function(e)
{
ajaxCall( { actionQty: 'set_qty', id_product_attribute: $(this).parent().attr('id').split('_')[1], value: $(this).val() } );
});
$('.available_quantity').find('input').click(function(e)
{
if(typeof(this.intervalId) != 'undefined')
window.clearInterval(this.intervalId);
this.intervalId = window.setInterval(function(it, initialValue)
{
if(initialValue != $(it).val())
{
window.clearInterval(it.intervalId);
$(it).trigger('change');
$(it).trigger('click');
}
}, 500, this, $(this).val())
});
$('.out_of_stock').click(function(e)
{
ajaxCall( { actionQty: 'out_of_stock', value: $(this).val() } );
});
refreshQtyAvaibilityForm();
</script>
<div class="tab-page" id="step8">
<h4 class="tab">8. {l s='Quantities'}</h4>
<table cellpadding="5">
<tbody>
<tr>
<td colspan="2">
<b>{l s='Available stock in warehouses'}</b>
</td>
</tr>
</tbody>
</table>
<div class="separation"></div>
<p>{l s='There is %s quantities available in stock for this product'|sprintf:$total_quantity}</p>
<table cellpadding="5" style="width:100%">
<tbody>
<tr>
<td valign="top" style="text-align:center;vertical-align:top;">
<table class="table" cellpadding="0" cellspacing="0" style="width:60%;margin-left:20%;">
<thead>
<tr>
<th>{l s='Quantity'}</th>
<th>{l s='Designation'}</th>
</tr>
</thead>
<tbody>
{foreach from=$attributes item=attribute}
<tr>
<td>{$physical_quantity[$attribute['id_product_attribute']]}</td>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br />
<table cellpadding="5">
<tbody>
<tr>
<td colspan="2">
<b>{l s='Available quantities for sale'}</b>
</td>
</tr>
</tbody>
</table>
<div class="separation"></div>
<div class="warn" id="available_quantity_ajax_msg" style="display: none;"></div>
<div class="error" id="available_quantity_ajax_error_msg" style="display: none;"></div>
<div class="conf" id="available_quantity_ajax_success_msg" style="display: none;"></div>
<table cellpadding="5" style="width:100%">
<tbody>
<tr>
<td valign="top" style="vertical-align:top;">
<input {if $product->depends_on_stock == 1}checked="checked" {/if} type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_1" value="1"/>
<label style="float:none;font-weight:normal" for="depends_on_stock_1">{l s='Available quantities for current product and its combinations are based on stock in the warehouses'}</label>
<br /><br />
</td>
</tr>
<tr>
<td valign="top" style="vertical-align:top;">
<input {if $product->depends_on_stock == 0}checked="checked" {/if} type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_0" value="0"/>
<label style="float:none;font-weight:normal" for="depends_on_stock_0">{l s='I want to specify available quantities manually, and manage my stock independently'}</label>
<br /><br />
</td>
</tr>
<tr>
<td valign="top" style="text-align:center;vertical-align:top;">
<table class="table" cellpadding="0" cellspacing="0" style="width:60%;margin-left:20%;">
<thead>
<tr>
<th style="width:200px;">{l s='Quantity'}</th>
<th>{l s='Designation'}</th>
</tr>
</thead>
<tbody>
{foreach from=$attributes item=attribute}
<tr>
<td class="available_quantity" id="qty_{$attribute['id_product_attribute']}">
<span>{$available_quantity[$attribute['id_product_attribute']]}</span>
<input type="text" value="{$available_quantity[$attribute['id_product_attribute']]}"/>
</td>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
<tr id="when_out_of_stock">
<td>
<table style="margin-top: 15px;">
<tbody>
<tr>
<td class="col-left"><label>{l s='When out of stock:'}</label></td>
<td style="padding-bottom:5px;">
<input {if $product->out_of_stock == 0}checked="checked" {/if} id="out_of_stock_1" type="radio" checked="checked" value="0" class="out_of_stock" name="out_of_stock">
<label id="label_out_of_stock_1" class="t" for="out_of_stock_1">{l s='Deny orders'}</label>
<br>
<input {if $product->out_of_stock == 1} 'checked="checked" {/if} id="out_of_stock_2" type="radio" value="1" class="out_of_stock" name="out_of_stock">
<label id="label_out_of_stock_2" class="t" for="out_of_stock_2">{l s='Allow orders'}</label>
<br>
<input {if $product->out_of_stock == 2} 'checked="checked" {/if} id="out_of_stock_3" type="radio" value="2" class="out_of_stock" name="out_of_stock">
<label id="label_out_of_stock_3" class="t" for="out_of_stock_3">
Default:
<i>Deny orders</i>
{assign var=confirm value="Are you sure you want to delete entered product information?"}
<a onclick="return confirm(' {$confirm} ');"
href="index.php?tab=AdminPPreferences&token={$token_preferences}">
{l s='as set in Preferences'}
</a>
</label>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,95 @@
<table cellpadding="5">
<tbody>
<tr>
<td colspan="2">
<b>{l s='Suppliers of the current product'}</b>
</td>
</tr>
</tbody>
</table>
<div class="separation"></div>
<p>{l s='Please choose the suppliers associated to this product, and the default one.'}</p>
{assign var=confirm value="Are you sure you want to delete entered product information?"}
<a href="{$link->getAdminLink('AdminSuppliers')}&addsupplier" onclick="return confirm(' {$confirm} ')">
<img src="../img/admin/add.gif" alt="{l s='Create new supplier'}" title="{l s='Create new supplier'}" /> <b>{l s='Create new supplier'}</b>
</a>
<table cellpadding="5" style="width:100%">
<tbody>
<tr>
<td valign="top" style="text-align:center;vertical-align:top;">
<table class="table" cellpadding="0" cellspacing="0" style="width:60%;margin-left:20%;">
<thead>
<tr>
<th>{l s='Selected'}</th>
<th>{l s='Supplier Name'}</th>
<th>{l s='Default'}</th>
</tr>
</thead>
<tbody>
{foreach from=$suppliers item=supplier}
<tr>
<td><input type="checkbox" class="supplierCheckBox" name="check_supplier_{$supplier['id_supplier']}" {if $supplier['is_selected'] == true}checked="checked"{/if} value="{$supplier['id_supplier']}" /></td>
<td>{$supplier['name']}</td>
<td><input type="radio" id="default_supplier_{$supplier['id_supplier']}" name="default_supplier" value="{$supplier['id_supplier']}" {if $supplier['is_selected'] == false}disabled="disabled"{/if} {if $supplier['is_default'] == true}checked="checked"{/if} /></td>
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div class="margin-form">
<input type="submit" class="button" name="submitSuppliers" value="{l s='Update suppliers of this product'}"/>
</div>
<br />
<table cellpadding="5">
<tbody>
<tr>
<td colspan="2">
<b>{l s='Product reference(s)'}</b>
</td>
</tr>
</tbody>
</table>
<div class="separation"></div>
<p>{l s='You can specify product reference(s) for each supplier associated.'}</p>
<table cellpadding="5" style="width:100%">
<tbody>
<tr>
<td valign="top" style="text-align:center;vertical-align:top;">
<table class="table" cellpadding="0" cellspacing="0" style="min-width:80%;margin-left:10%;">
<thead>
<tr>
<th>{l s='Product Name'}</th>
{foreach from=$associated_suppliers item=supplier}
<th>{$supplier->name}</th>
{/foreach}
</tr>
</thead>
<tbody>
{foreach from=$attributes item=attribute}
<tr>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
{foreach from=$associated_suppliers item=supplier}
{assign var=reference value=''}
{foreach from=$associated_suppliers_collection item=asc}
{if $asc->id_product == $attribute['id_product'] && $asc->id_product_attribute == $attribute['id_product_attribute'] && $asc->id_supplier == $supplier->id_supplier}
{assign var=reference value=$asc->product_supplier_reference}
{/if}
{/foreach}
<td>
<input type="text" size="10" value="{$reference}" name="supplier_reference_{$attribute['id_product']}_{$attribute['id_product_attribute']}_{$supplier->id_supplier}" />
</td>
{/foreach}
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div class="margin-form">
<input type="submit" class="button" name="submitSupplierReferences" value="{l s='Update supplier reference(s)'}"/>
</div>
+5 -5
View File
@@ -1,5 +1,5 @@
{*
* 2007-2011 PrestaShop
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
@@ -34,24 +34,24 @@
{foreach $products AS $product}
<hr />
{if !$product->hasAttributes()}
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:990px;">
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:80%;margin-left:10%;">
<tr>
<th>{$product->name}</th>
{if !empty($product->reference)}<th width="150">{l s='Ref:'} {$product->reference}</th>{/if}
{if !empty($product->ean13)}<th width="120">{l s='EAN13:'} {$product->ean13}</th>{/if}
{if !empty($product->upc)}<th width="120">{l s='UPC:'} {$product->upc}</th>{/if}
{if $stock_management}<th class="right" width="50">{l s='Qty:'} {$product->quantity}</th>{/if}
{if $stock_management}<th class="right" width="150">{l s='Available Quantity:'} {$product->quantity}</th>{/if}
</tr>
</table>
{else}
<h3><a href="?tab=AdminProducts&id_product={$product->id}&updateproduct&token={getAdminToken tab='AdminProducts'}">{$product->name}</a></h3>
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:990px;">
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:80%;margin-left:10%;">
<tr>
<th>{l s='Attribute name'}</th>
<th width="80">{l s='Reference'}</th>
<th width="80">{l s='EAN13'}</th>
<th width="80">{l s='UPC'}</th>
{if $stock_management}<th class="right" width="40">{l s='Quantity'}</th>{/if}
{if $stock_management}<th class="right" width="150">{l s='Available Quantity'}</th>{/if}
</tr>
{foreach $product->combinaison AS $id_product_attribute => $product_attribute}
<tr {if $id_product_attribute %2}class="alt_row"{/if} >
@@ -115,7 +115,7 @@
</fieldset>
<script language="javascript">
<script type="text/javascript">
product_infos = null;
debug = null;
if ($('#product_ids').val() == '')
@@ -174,7 +174,7 @@
var id = $(this).attr('id');
var product_id = id.split('|')[1];
//find the position of the product id in product_id array
var position = product_ids.indexOf(product_id);
@@ -182,11 +182,11 @@
{
//remove the id from the array
product_ids.splice(position, 1);
var input_id = $('input[name~="input_id_'+product_id+'"]');
if (input_id.length > 0)
product_ids_to_delete.push(product_id);
// update the product_ids hidden field
$('#product_ids').val(product_ids.join('|'));
$('#product_ids_to_delete').val(product_ids_to_delete.join('|'));
@@ -35,6 +35,10 @@
<td>{l s='Creation date:'}</td>
<td>{$supply_order_creation_date}</td>
</tr>
<tr>
<td>{l s='Supplier:'}</td>
<td>{$supply_order_supplier_name}</td>
</tr>
<tr>
<td>{l s='Last update:'}</td>
<td>{$supply_order_last_update}</td>