diff --git a/templates/frontOffice/boutique/cart.html b/templates/frontOffice/boutique/cart.html index e1e81ab8..d9d5da72 100644 --- a/templates/frontOffice/boutique/cart.html +++ b/templates/frontOffice/boutique/cart.html @@ -92,18 +92,23 @@ {$errorStock="TRUE"}
{intl l="Out of Stock"}
{/if} - + + {loop type="attribute_combination" name="product_options" product_sale_elements="$PRODUCT_SALE_ELEMENTS_ID" order="manual"}
{$ATTRIBUTE_TITLE}
{$ATTRIBUTE_AVAILABILITY_TITLE}
- + - {if $ATTRIBUTE_AVAILABILITY_ID == 6} + {if $ATTRIBUTE_AVAILABILITY_TITLE|strstr:"106"} + {$nb_pots_taille_S = $nb_pots_taille_S + $QUANTITY} + {/if} + {if $ATTRIBUTE_AVAILABILITY_TITLE|strstr:"228"} {$nb_pots_taille_M = $nb_pots_taille_M + $QUANTITY} {/if} - {if $ATTRIBUTE_AVAILABILITY_ID == 11} + {if $ATTRIBUTE_AVAILABILITY_TITLE|strstr:"385"} {$nb_pots_taille_L = $nb_pots_taille_L + $QUANTITY} {/if} {/loop} @@ -217,28 +222,35 @@
- - {$promo_totale = 0} - {if $nb_pots_taille_M >= 3} + + {assign var=promo_totale value=0} + {if $nb_pots_taille_S >= 3} {$promo_totale = 1.5} - {if $nb_pots_taille_M >= 6} + {if $nb_pots_taille_S >= 6} {$promo_totale = 2} {/if} {/if} + {if $nb_pots_taille_M >= 3} + {$promo_totale = $promo_totale + 2} + {if $nb_pots_taille_M >= 6} + {$promo_totale = $promo_totale + 4} + {/if} + {/if} {if $nb_pots_taille_L >= 3} + {$promo_totale = $promo_totale + 2} {if $nb_pots_taille_L >= 6} {$promo_totale = $promo_totale + 4} - {else} - {$promo_totale = $promo_totale + 2} {/if} {/if} - {if $promo_totale = 1.5} - {$code_promo="PROMO_1.5"} - {elseif $promo_totale = 2} - {$code_promo="PROMO_2"} - {elseif $promo_totale > 2} - {$code_promo="PROMO_4"} + {if $promo_totale > 0} + {if $promo_totale > 2} + {$code_promo="PROMO_4"} + {else} + {$code_promo="PROMO_"|cat:$promo_totale} + {/if} + {else} + {$code_promo=""} {/if} diff --git a/templates/frontOffice/hooktest/composer.json b/templates/frontOffice/hooktest/composer.json new file mode 100644 index 00000000..4ee9e18e --- /dev/null +++ b/templates/frontOffice/hooktest/composer.json @@ -0,0 +1,10 @@ +{ + "name": "thelia/hooktest-template", + "type": "thelia-frontoffice-template", + "require": { + "thelia/installer": "~1.1" + }, + "extra": { + "installer-name": "hooktest" + } +} diff --git a/templates/frontOffice/hooktest/includes/single-product.html b/templates/frontOffice/hooktest/includes/single-product.html new file mode 100644 index 00000000..cd7aebd3 --- /dev/null +++ b/templates/frontOffice/hooktest/includes/single-product.html @@ -0,0 +1,110 @@ +
  • + {if $PSE_COUNT > 1} + {assign var="hasSubmit" value = false} + {else} + {assign var="hasSubmit" value = true} + {/if} + {assign var="productTitle" value="{$TITLE}"} + {if not $product_id} + {assign var="product_id" value=$ID} + {/if} +
    + + {hook name="singleproduct.top" product="{$product_id}"} + + + +
    +

    {$productTitle}

    + {if $hasDescription} +
    +

    {$DESCRIPTION nofilter}

    +
    + {/if} +
    + + {* Stock *} + {assign var="current_stock_content" value = "in_stock"} + {assign var="current_stock_href" value = "http://schema.org/InStock"} + {if {config key="check-available-stock"} != 0} + {if $QUANTITY == 0} + {assign var="current_stock_content" value = "out_stock"} + {assign var="current_stock_href" value = "http://schema.org/OutOfStock"} + {/if} + {/if} + +
    +
    + + {* List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition *} + + {* List of currency : The currency used to describe the product price, in three-letter ISO format. *} + + + {if $IS_PROMO } + {intl l="Special Price:"} {format_number number=$TAXED_PROMO_PRICE} {currency attr="symbol"} + {intl l="Regular Price:"} {format_number number=$TAXED_PRICE} {currency attr="symbol"} + {else} + {format_number number=$BEST_TAXED_PRICE} {currency attr="symbol"} + {/if} +
    + + {if $hasBtn == true} + {if $hasSubmit == true} + {form name="thelia.cart.add" } +
    + {form_hidden_fields form=$form} + + + + {if $form_error}
    {$form_error_message}
    {/if} + + {form_field form=$form field='product_sale_elements_id'} + + {/form_field} + {form_field form=$form field="product"} + + {/form_field} + +
    + {form_field form=$form field='quantity'} +
    + + + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
    + {/form_field} +
    +
    + +
    +
    +
    +
    + {/form} + {else} +
    + +
    + {/if} + {/if} +
    + + {hook name="singleproduct.bottom" product="{$product_id}"} + +
    +
  • diff --git a/templates/frontOffice/hooktest/index.html b/templates/frontOffice/hooktest/index.html new file mode 100644 index 00000000..034bb83e --- /dev/null +++ b/templates/frontOffice/hooktest/index.html @@ -0,0 +1,24 @@ +{extends file="layout.tpl"} + +{block name="main-content"} + + {ifhook rel="home.body"} + {hook name="home.body"} + {/ifhook} + {elsehook rel="home.body"} + ::NO home.body:: + {/elsehook} + +{/block} + +{block name="stylesheet"} +{hook name="home.stylesheet"} +{/block} + +{block name="after-javascript-include"} +{hook name="home.after-javascript-include"} +{/block} + +{block name="javascript-initialization"} +{hook name="home.javascript-initialization"} +{/block} diff --git a/templates/frontOffice/hooktest/layout.tpl b/templates/frontOffice/hooktest/layout.tpl new file mode 100644 index 00000000..51134518 --- /dev/null +++ b/templates/frontOffice/hooktest/layout.tpl @@ -0,0 +1,110 @@ + + + + +{* Declare assets directory, relative to template base directory *} +{declare_assets directory='assets'} + +{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *} +{default_translation_domain domain='fo.default'} + +{hook name="main.head-top"} + +{hook name="main.stylesheet"} + +{hook name="main.body-top"} + +{hook name="main.header-top"} + +{hook name="main.navbar-secondary"} +{ifhook rel="main.navbar-secondary"} + ::main.navbar-secondary ifhook:: +{/ifhook} +{elsehook rel="main.navbar-secondary"} + ::main.navbar-secondary elsehook:: +{/elsehook} + +{hook name="main.navbar-primary"} +{ifhook rel="main.navbar-primary"} + ::main.navbar-primary ifhook:: +{/ifhook} +{elsehook rel="main.navbar-primary"} + ::main.navbar-primary elsehook:: +{/elsehook} + +{hook name="main.header-bottom"} + +{hook name="main.content-top"} + + +{block name="main-content"}{/block} + + +{hook name="main.content-bottom"} + +{ifhook rel="main.footer-top"} + {hook name="main.footer-top"} +{/ifhook} +{elsehook rel="main.footer-top"} + ::NO main.footer-top:: +{/elsehook} + +{ifhook rel="product.additional"} +{hookblock name="product.additional"} +{forhook rel="product.additional"} + ::product.additional ifhook:: +{/forhook} +{/hookblock} +{/ifhook} +{elsehook rel="product.additional"} + ::product.additional elsehook:: +{/elsehook} + + + +{ifhook rel="main.footer-body"} + ::main.footer-body ifhook:: + {hookblock name="main.footer-body"} + {forhook rel="main.footer-body"} + ::main.footer-body {$id} {$class} {$content}:: + {/forhook} + {/hookblock} +{/ifhook} +{elsehook rel="main.footer-body"} + ::main.footer-body elsehook:: +{/elsehook} + +{ifhook rel="main.footer-bottom"} + {hook name="main.footer-bottom"} +{/ifhook} +{elsehook rel="main.footer-bottom"} + ::NO main.footer-bottom:: +{/elsehook} + +{hook name="main.after-javascript-include"} + +{block name="after-javascript-include"}{/block} + +{hook name="main.javascript-initialization"} + +{block name="javascript-initialization"}{/block} + +{hook name="main.body-bottom"} diff --git a/templates/frontOffice/hooktest/modules/HookTest/assets/css/style3.css b/templates/frontOffice/hooktest/modules/HookTest/assets/css/style3.css new file mode 100644 index 00000000..ed6ae71a --- /dev/null +++ b/templates/frontOffice/hooktest/modules/HookTest/assets/css/style3.css @@ -0,0 +1 @@ +/* style3 in template/hooktest */ \ No newline at end of file diff --git a/templates/frontOffice/hooktest/modules/HookTest/override3.html b/templates/frontOffice/hooktest/modules/HookTest/override3.html new file mode 100644 index 00000000..a880c846 --- /dev/null +++ b/templates/frontOffice/hooktest/modules/HookTest/override3.html @@ -0,0 +1 @@ +:: file override3 from template/hooktest ::