From bb452c2efc31a57cb0cb4dbfd54e7da5e4befbc5 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Thu, 23 Jan 2014 15:35:52 +0100 Subject: [PATCH] Changed "Details" by "Price" --- CHANGELOG.md | 3 +- .../default/includes/product-prices-tab.html | 770 ++++++++++++++++++ .../backOffice/default/product-edit.html | 10 +- 3 files changed, 777 insertions(+), 6 deletions(-) create mode 100644 templates/backOffice/default/includes/product-prices-tab.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d5355019..bd7c7078c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ #2.0.0-beta4 - Tinymce is now a dedicated module. You need to activate it. - Fix PDF creation. Bug #180 -- Fix many translation issues. +- Fix many translation issues. +- The TaxManager is now a service #2.0.0-beta3 - Coupon effect inputs are now more customisable (input text, select, ajax, etc.. are usable) and unlimited amount of input for coupon effect are now possible too diff --git a/templates/backOffice/default/includes/product-prices-tab.html b/templates/backOffice/default/includes/product-prices-tab.html new file mode 100644 index 000000000..32aa42af6 --- /dev/null +++ b/templates/backOffice/default/includes/product-prices-tab.html @@ -0,0 +1,770 @@ +
+ + {$has_at_least_one_combination = false} + {$default_product_sale_element_id = 0} + + {loop name="product.sales.elements.test" type="product_sale_elements" product=$product_id currency=$edit_currency_id backend_context="1"} + {loop name="product.combinations" type="attribute_combination" product_sale_elements="$ID"} + {$has_at_least_one_combination = true} + {/loop} + + {elseloop rel="product.combinations"} + {$default_product_sale_element_id = $ID} + {/elseloop} + {/loop} + + {if $has_at_least_one_combination == false} + {form name="thelia.admin.product_default_sale_element.update"} +
+ + {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 and current tab, even if the form could not be validated *} + + + + {form_hidden_fields form=$form} + + {form_field form=$form field='product_id'} + + {/form_field} + + {form_field form=$form field='product_sale_element_id'} + + {/form_field} + + {form_field form=$form field='isdefault'} + + {/form_field} + + {form_field form=$form field='reference'} + + {/form_field} + + {form_field form=$form field='success_url'} + + {/form_field} + + {loop type="currency" name="product-currency" id=$edit_currency_id backend_context="1"} + + {$currency_symbol = $SYMBOL} + {$currency_name = $NAME} + + {form_field form=$form field='currency'} + + {/form_field} + + {$current_currency_is_default = $IS_DEFAULT} + {/loop} + + + {if $form_error} +
+
+
{$form_error_message}
+
+
+ {/if} + +
+
+ {form_field form=$form field='tax_rule'} +
+ +
+ +
+ +
+ {/form_field} +
+
+ +

{intl l='Pricing'}

+ +

{intl l="The default pricing is used when no combination is defined."}

+ +
+ + {* -- Pricing ------------------------------------------------------- *} + +
+
+

{intl l='Pricing'}

+ +

+ + {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} + + {form_field form=$form field='price'} +
+ + +
+ + {$currency_symbol} +
+
+ {/form_field} + + {form_field form=$form field='price_with_tax'} +
+ +
+ + {$currency_symbol} +
+
+ {/form_field} + + {module_include location='product_details_pricing_form'} +
+
+ + + {* -- Détails -------------------------------------------------- *} + +
+
+

{intl l='Stock'}

+ + {form_field form=$form field='ean_code'} +
+ + +
+ +
+
+ {/form_field} + + {form_field form=$form field='weight'} +
+ + +
+ + {intl l="Kg"} +
+
+ {/form_field} + + {form_field form=$form field='quantity'} +
+ + +
+ +
+
+ {/form_field} + + {module_include location='product_details_details_form'} +
+
+ + + {* -- Promotion ------------------------------------------------- *} + +
+
+

{intl l='Promotion'}

+ + {form_field form=$form field='sale_price'} +
+ + +
+ + {$currency_symbol} +
+
+ {/form_field} + + {form_field form=$form field='sale_price_with_tax'} +
+ +
+ + {$currency_symbol} +
+
+ {/form_field} + + {form_field form=$form field='onsale'} +
+
+ +
+
+ {/form_field} + + {form_field form=$form field='isnew'} +
+
+ +
+
+ {/form_field} + + {module_include location='product_details_promotion_form'} +
+
+
+
+ {/form} + {/if} + + {* -- Attribute combinations -------------------------------------------- *} + + {if $has_at_least_one_combination} + + {form name="thelia.admin.product_sale_element.update"} +
+
+
+ + {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 and current tab, even if the form could not be validated *} + + + + {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'} + + + + + + + + + + + + + + + + + + + + + + + {* 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} + + + + + + + + {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} + + + {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} + +
+ {intl l='Attribute Combinations'} + + {module_include location='product_combinations_list_caption'} + + {loop type="auth" name="can_create" role="ADMIN" resource="admin.product" access="UPDATE"} + + {intl l='Combination builder'} + + + + + {/loop} +
{intl l='Reference'}{intl l='EAN Code'}{intl l='Stock'}{intl l='Price
w/o taxes (%currency)' currency=$currency_symbol}
{intl l='Price
w/ taxes (%currency)' currency=$currency_symbol}
{intl l='Weight
(Kg)'}
{intl l='Default'}{intl l='Sale'}{intl l='New'}{intl l='Sale price
w/o taxes (%currency)' currency=$currency_symbol}
{intl l='Sale price
w/ taxes (%currency)' currency=$currency_symbol}
 
+ + {form_field form=$form field='product_sale_element_id' value_key=$idx} + + + {$current_pse_id = $value} + + {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} + ID: {$current_pse_id}
+ + + + + + + + + + + + + +
+ + {module_include location='product_after_combinations'} +
+
+ +
+ {/form} + {/if} + + {if $has_at_least_one_combination == false} +
+
+

{intl l='Attribute Combinations'}

+ +
+

{intl + l='This product has no combination. The default price is used. Click here to create a new combination.' + url='#combination_creation_dialog' + }

+

+ {intl + l='You may also quickly create combinations from products attributes using the Combination Builder.' + url='#combination_builder_dialog' + } +

+
+
+
+ {/if} + +{module_include location='product_after_combinations'} +
+ +{* -- Adding a new combination ------------------------------------------------- *} + +{* Capture the dialog body, to pass it to the generic dialog *} + +{capture "combination_creation_dialog"} + + + + +
+ + + {intl l='Select an attribute and click (+) to view available values'} +
+ + +
+
+ {* *} + + + + + + +
+ + {intl l='Select a value click (+) to add it to the combination'} +
+ +
+
+ {intl l="No available value for this attribute"} +
+
+ +
+
+ + + +
+ {intl l='To remove a value from the combination, select it and click "remove"'} + +
+ +
+
+
+ +{/capture} + +{include + file = "includes/generic-create-dialog.html" + + dialog_id = "combination_creation_dialog" + dialog_title = {intl l="Create a new combination"} + dialog_body = {$smarty.capture.combination_creation_dialog nofilter} + + dialog_ok_label = {intl l="Create this combination"} + + form_action = {url path='/admin/product/combination/add'} + form_enctype = '' + form_error_message = '' + + ok_button_id = "combination_creation_dialog_ok" +} + + +{* -- Delete combination confirmation dialog ----------------------------------- *} + +{capture "combination_delete_dialog"} + + + + + + + {module_include location='category_delete_form'} + +{/capture} + +{include + file = "includes/generic-confirm-dialog.html" + + dialog_id = "combination_delete_dialog" + dialog_title = {intl l="Delete a combination"} + dialog_message = {intl l="Do you really want to delete this combination ?"} + + form_action = {url path='/admin/product/combination/delete'} + form_content = {$smarty.capture.combination_delete_dialog nofilter} +} + +{* -- Combination builder dialog -------------------------------------------- *} + +{* Capture the dialog body, to pass it to the generic dialog *} + +{form name="thelia.admin.product_combination.build"} + +{capture "combination_builder_dialog"} + + {* Be sure to get the product ID and current tab, even if the form could not be validated *} + + + + {form_hidden_fields form=$form} + + {form_field form=$form field='product_id'} + + {/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} + + {form_field form=$form field='currency'} + + {/form_field} + {/loop} + + {form_field form=$form field='success_url'} + + {/form_field} + +
+ {intl l='Select attribute values to combine. You may enter a default value for some of the fields of the generated combinations.'} +
+ +
+
+
+
    + {$index = 0} + {loop name="product-attributes" type="attribute" order="manual" product=$product_id backend_context="1" lang=$edit_language_id} + {ifloop rel="product-attributes-av"} +
  • + {$TITLE} +
      + {loop name="product-attributes-av" type="attribute_availability" attribute="{$ID}" order="manual" backend_context="1" lang=$edit_language_id} +
    • +
      + +
      +
    • + {$index = $index + 1} + {/loop} +
    +
  • + {/ifloop} + {/loop} +
+
+
+ +
+ {form_field form=$form field='price'} +
+ + +
+ + {$currency_symbol} +
+
+ {/form_field} + + {form_field form=$form field='reference'} +
+ + +
+ +
+
+ {/form_field} + + {form_field form=$form field='ean_code'} +
+ + +
+ +
+
+ {/form_field} + +
+
+ {form_field form=$form field='weight'} +
+ + +
+ + {intl l="Kg"} +
+
+ {/form_field} +
+ +
+ {form_field form=$form field='quantity'} +
+ + +
+ +
+
+ {/form_field} +
+
+ + {form_field form=$form field='sale_price'} +
+ +
+ + {$currency_symbol} +
+
+ {/form_field} + + {form_field form=$form field='onsale'} +
+
+ +
+
+ {/form_field} + + {form_field form=$form field='isnew'} +
+
+ +
+
+ {/form_field} + +
{intl l='0 combinations'}
+
+
+ +{/capture} + +{include + file = "includes/generic-create-dialog.html" + + dialog_id = "combination_builder_dialog" + dialog_title = {intl l="Create combinations"} + dialog_body = {$smarty.capture.combination_builder_dialog nofilter} + + dialog_ok_label = {intl l="Create combinations"} + + form_action = {url path='/admin/product/combination/build'} + form_enctype = {form_enctype form=$form} + form_error_message = '' + + ok_button_id = "combination_builder_dialog_ok" +} + +{/form} diff --git a/templates/backOffice/default/product-edit.html b/templates/backOffice/default/product-edit.html index 36eff1a6e..7a91f2647 100644 --- a/templates/backOffice/default/product-edit.html +++ b/templates/backOffice/default/product-edit.html @@ -38,7 +38,7 @@