+ {include
+ file = "includes/inner-form-toolbar.html"
+ hide_submit_buttons = false
+ show_currencies = true
+ page_url = "{url path='/admin/products/update' product_id=$ID}"
+ close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
+ }
- {include
- file = "includes/inner-form-toolbar.html"
- hide_submit_buttons = false
- show_currencies = true
- page_url = "{url path='/admin/products/update' product_id=$ID}"
- close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
- }
+ {* Be sure to get the product ID, even if the form could not be validated *}
+
- {if $form_error}
{$form_error_message}
{/if}
+
-
-
- {form_field form=$form field='tax_rule'}
-
- {/form_field}
-
-
+ {form_hidden_fields form=$form}
+
+ {form_field form=$form field='product_id'}
+
+ {/form_field}
+
+ {form_field form=$form field='success_url'}
+
+ {/form_field}
+
+ {if $form_error}
{$form_error_message}
{/if}
+
+ {loop type="currency" name="get-currency-symbol" id=$edit_currency_id backend_context="1"}
+ {$currency_symbol = $SYMBOL}
+ {$current_currency_is_default = $IS_DEFAULT}
+
+ {form_field form=$form field='currency'}
+
+ {/form_field}
+ {/loop}
+
+
+
+ {form_field form=$form field='tax_rule'}
+
+ {/form_field}
+
+
+ {form_field form=$form field='use_exchange_rate'}
+ {if $current_currency_is_default}
+
+ {$show_pricing_fields = true}
+ {else}
+
+ {$show_pricing_fields = ($value == 0)}
+ {/if}
+ {/form_field}
+
+
{module_include location='product_before_combinations'}
@@ -298,6 +340,9 @@
{module_include location='product_combinations_list_caption'}
{loop type="auth" name="can_create" role="ADMIN" resource="admin.product" access="UPDATE"}
+
+ {intl l='Combination builder'}
+
@@ -322,43 +367,91 @@
- {loop name="product.sales.elements" type="product_sale_elements" product=$product_id currency=$edit_currency_id backend_context="1"}
+ {* Get number of PSE defined, assumin the form have the same number of values for each fields *}
+
+ {form_field form=$form field='product_sale_element_id' value_key=0}
+ {$pse_count = $total_value_count}
+ {/form_field}
+
+ {for $idx = 0 to $total_value_count-1}
|
- {$ID}: {loop name="product.sales.elements.combinations" type="attribute_combination" product_sale_elements=$ID backend_context="1"}
- {if $LOOP_COUNT > 1} - {/if}{$ATTRIBUTE_TITLE}
- {/loop}
+
+ {form_field form=$form field='product_sale_element_id' value_key=$idx}
+
+
+ {$current_pse_id = $value}
+
+ {$current_pse_id}: {loop name="product.sales.elements.combinations" type="attribute_combination" product_sale_elements=$current_pse_id backend_context="1"}
+ {if $LOOP_COUNT > 1} - {/if}{$ATTRIBUTE_TITLE}
+ {/loop}
+ {/form_field}
|
-
- |
- |
- |
- |
- |
- |
+
+ {form_field form=$form field='reference' value_key=$idx}
+ |
+ {/form_field}
-
-
+ {form_field form=$form field='ean_code' value_key=$idx}
+ | |
+ {/form_field}
+
+ {form_field form=$form field='quantity' value_key=$idx}
+
+
|
+ {/form_field}
-
-
- |
+ {form_field form=$form field='price' value_key=$idx}
+ |
+ {/form_field}
-
-
- |
+ {form_field form=$form field='price_with_tax' value_key=$idx}
+ |
+ {/form_field}
- |
- |
+ {form_field form=$form field='weight' value_key=$idx}
+ |
+ {/form_field}
-
-
- |
-
- {/loop}
+
+ {form_field form=$form field='default_pse'}
+
+
+ |
+ {/form_field}
+
+ {form_field form=$form field='onsale' value_key=$idx}
+
+
+ |
+ {/form_field}
+
+ {form_field form=$form field='isnew' value_key=$idx}
+
+
+ |
+ {/form_field}
+
+ {form_field form=$form field='sale_price' value_key=$idx}
+
+
+ |
+ {/form_field}
+
+ {form_field form=$form field='sale_price_with_tax' value_key=$idx}
+
+
+ |
+ {/form_field}
+
+
+
+ |
+
+ {/for}
diff --git a/templates/admin/default/product-edit.html b/templates/admin/default/product-edit.html
index bf40dc0ac..446e1fd7f 100644
--- a/templates/admin/default/product-edit.html
+++ b/templates/admin/default/product-edit.html
@@ -348,7 +348,8 @@ $(function() {
// will update the untaxed (resp. taxed) one
$('.automatic_price_field').typeWatch({
captureLength: 1,
- callback: function () {
+ wait : 300,
+ callback : function () {
update_price($(this).val(), $(this).data('price-type'), $(this).data('rel-price'));
}
});