{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'configuration'} {/block} {block name="page-title"}{intl l='Thelia Shipping configuration'}{/block} {block name="check-resource"}admin.configuration.shipping-configuration{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="shipping-configuration.top" location="shipping_configuration_top" }

{intl l='Shipping zones management'} {loop type="auth" name="can_create" role="ADMIN" resource="admin.configuration.shipping-configuration" access="CREATE"} {/loop}
{intl l="Zone name"} | {intl l="Included countries"} | {intl l="Assigned modules"} {hook name="shipping-configuration.table-header" location="shipping_configuration_table_header" } | {intl l="Actions"}
--- | --- | --- | ---
{loop name="area-list" type="area" backend_context="1"}
{$NAME} | {loop name="country-area" type="country" area=$ID backend_context="1" limit="6" visible="*"} {$TITLE}{if $LOOP_COUNT < $LOOP_TOTAL},{/if} {/loop} {ifloop rel="country-area-more"} {$countries = ''} {loop name="country-area-more" type="country" area=$ID backend_context="1" offset="6" visible="*"} {$countries = "$countries, $TITLE"} {$ctry_count=$LOOP_COUNT} {/loop} {$countries = ltrim($countries, ', ')} {intl l="%count more..." count={$ctry_count}} {/ifloop} {elseloop rel="country-area"} {intl l='None'} {/elseloop} | {loop name="module-area" type="module" area=$ID backend_context="1"} {$CODE} - {$TITLE}{if $LOOP_COUNT < $LOOP_TOTAL} {/if} {/loop} {elseloop rel="module-area"} {intl l='None'} {/elseloop} {hook name="shipping-configuration.table-row" location="shipping_configuration_table_row" area_id={$ID} } | {loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.shipping-configuration" access="UPDATE"} {/loop} {loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.shipping-configuration" access="DELETE"} {/loop}
{/loop}

{hook name="shipping-configuration.bottom" location="shipping_configuration_bottom" }
{* Adding a new Shipping zone *} {* Capture the dialog body, to pass it to the generic dialog *} {capture "creation_dialog"} {form name="thelia.admin.area.create"} {form_hidden_fields} {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} {render_form_field field='success_url' value="{url path='/admin/configuration/shipping_configuration/update/_ID_'}"} {render_form_field field='name'} {hook name="shipping-configuration.create-form" location="shipping_configuration_create_form" } {/form} {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "creation_dialog" dialog_title = {intl l="Create a new shipping zone"} dialog_body = {$smarty.capture.creation_dialog nofilter} dialog_ok_label = {intl l="Create this shipping zone"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path='/admin/configuration/shipping_configuration/create'} form_enctype = '' form_error_message = $form_error_message } {* Delete confirmation dialog *} {capture "delete_dialog"} {hook name="shipping-configuration.delete-form" location="shipping_configuration_delete_form" } {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_dialog" dialog_title = {intl l="Delete shipping zone"} dialog_message = {intl l="Do you really want to delete this shipping zone ?"} form_action = {token_url path='/admin/configuration/shipping_configuration/delete'} form_content = {$smarty.capture.delete_dialog nofilter} } {/block} {block name="javascript-initialization"}
{/block} {block name="javascript-last-call"} {hook name="shipping-configuration.js" location="shipping-configuration-js" } {/block}