694 lines
35 KiB
HTML
694 lines
35 KiB
HTML
{extends file="layout.tpl"}
|
|
|
|
{block name="init"}
|
|
{$product_id={product attr="id"}}
|
|
{$pse_count=1}
|
|
{$product_virtual={product attr="virtual"}}
|
|
{$check_availability={config key="check-available-stock" default="1"}}
|
|
{/block}
|
|
|
|
{* Body Class *}
|
|
{block name="body-class"}page-product{/block}
|
|
|
|
{* Page Title *}
|
|
{block name='no-return-functions' append}
|
|
{loop name="product.seo.title" type="product" id=$product_id limit="1" with_prev_next_info="1"}
|
|
{$page_title = $META_TITLE}
|
|
{/loop}
|
|
{/block}
|
|
|
|
{* Meta *}
|
|
{block name="meta"}
|
|
{loop name="product.seo.meta" type="product" id=$product_id limit="1" with_prev_next_info="1"}
|
|
{include file="includes/meta-seo.html"}
|
|
{/loop}
|
|
{/block}
|
|
|
|
{* Breadcrumb *}
|
|
{block name='no-return-functions' append}
|
|
{$breadcrumbs = []}
|
|
{loop type="product" name="product_breadcrumb" id=$product_id limit="1" with_prev_next_info="1"}
|
|
{loop name="category_path" type="category-path" category={$DEFAULT_CATEGORY}}
|
|
{$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL nofilter}]}
|
|
{/loop}
|
|
{$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL nofilter}]}
|
|
{/loop}
|
|
{/block}
|
|
|
|
{* Content *}
|
|
{block name="main-content"}
|
|
{if $product_id}
|
|
<div class="main">
|
|
{loop name="product.details" type="product" id=$product_id limit="1" with_prev_next_info="1" with_prev_next_visible="1"}
|
|
<article id="product" class="col-main row" role="main" itemscope itemtype="http://schema.org/Product">
|
|
|
|
{$pse_count=$PSE_COUNT}
|
|
|
|
{* Use the meta tag to specify content that is not visible on the page in any way *}
|
|
{loop name="brand.feature" type="brand" product={$ID}}
|
|
<meta itemprop="brand" content="{$TITLE}">
|
|
{/loop}
|
|
|
|
{* Add custom feature if needed
|
|
{loop name="isbn.feature" type="feature" product={$ID} title="isbn"}
|
|
{loop name="isbn.value" type="feature_value" feature={$ID} product=$product_id}
|
|
<meta itemprop="productID" content="isbn:{$TITLE}">
|
|
{/loop}
|
|
{/loop}
|
|
*}
|
|
|
|
{hook name="product.top" product={$ID}}
|
|
|
|
{ifhook rel="product.gallery"}
|
|
{hook name="product.gallery" product={$ID}}
|
|
{/ifhook}
|
|
{elsehook rel="product.gallery"}
|
|
<section id="product-gallery" class="col-sm-6">
|
|
{ifloop rel="image.main"}
|
|
<figure class="product-image">
|
|
{loop type="image" name="image.main" product={$ID} width="726" height="445" resize_mode="crop" limit="1"}
|
|
<img src="{$IMAGE_URL nofilter}" alt="{$TITLE}" class="img-responsive" itemprop="image" data-toggle="magnify">
|
|
{/loop}
|
|
</figure>
|
|
{/ifloop}
|
|
|
|
{ifloop rel="image.carousel"}
|
|
<div id="product-thumbnails" class="carousel slide" style="position:relative;">
|
|
<div class="carousel-inner">
|
|
<div class="item active">
|
|
<ul class="list-inline">
|
|
{loop name="image.carousel" type="image" product={$ID} width="726" height="445" resize_mode="crop" limit="5"}
|
|
<li>
|
|
<a href="{$IMAGE_URL nofilter}" class="thumbnail {if $LOOP_COUNT == 1}active{/if}">
|
|
{loop type="image" name="image.thumbs" id={$ID} product="$OBJECT_ID" width="118" height="85" resize_mode="borders"}
|
|
<img src="{$IMAGE_URL nofilter}" alt="{$TITLE}">
|
|
{/loop}
|
|
</a>
|
|
</li>
|
|
{/loop}
|
|
</ul>
|
|
</div>
|
|
{ifloop rel="image.carouselsup"}
|
|
<div class="item">
|
|
<ul class="list-inline">
|
|
{loop name="image.carouselsup" type="image" product={$ID} width="726" height="445" resize_mode="borders" offset="5"}
|
|
<li>
|
|
<a href="{$IMAGE_URL nofilter}" class="thumbnail">
|
|
{loop type="image" name="image.thumbssup" id={$ID} product="$OBJECT_ID" width="118" height="85" resize_mode="borders"}
|
|
<img src="{$IMAGE_URL nofilter}" alt="{$TITLE}">
|
|
{/loop}
|
|
</a>
|
|
</li>
|
|
{/loop}
|
|
</ul>
|
|
</div>
|
|
{/ifloop}
|
|
</div>
|
|
{ifloop rel="image.carouselsup"}
|
|
<a class="left carousel-control" href="#product-thumbnails" data-slide="prev"><i class="fa fa-caret-left"></i></a>
|
|
<a class="right carousel-control" href="#product-thumbnails" data-slide="next"><i class="fa fa-caret-right"></i></a>
|
|
{/ifloop}
|
|
</div>
|
|
{/ifloop}
|
|
</section>
|
|
{/elsehook}
|
|
|
|
<section id="product-details" class="col-sm-6">
|
|
<div class="product-info">
|
|
<h1 class="name"><span itemprop="name">{$TITLE}</span><span id="pse-name" class="pse-name"></span></h1>
|
|
{*{if $REF}<span itemprop="sku" class="sku">{intl l='Ref.'}: <span id="pse-ref">{$REF}</span></span>{/if}*}
|
|
|
|
{loop name="brand_info" type="brand" product={$ID} limit="1"}
|
|
<p><a href="{$URL nofilter}" title="{intl l="More information about this brand"}"><span itemprop="brand">{$TITLE}</span></a></p>
|
|
{/loop}
|
|
|
|
{if $POSTSCRIPTUM}<div class="short-description">
|
|
{*<p>{$POSTSCRIPTUM}</p>*}
|
|
</div>{/if}
|
|
</div>
|
|
|
|
{hook name="product.details-top" product={$ID}}
|
|
|
|
{loop type="sale" name="product-sale-info" product={$ID} active="1"}
|
|
<div class="product-promo">
|
|
<p class="sale-label">{$SALE_LABEL}</p>
|
|
<p class="sale-saving"> {intl l="Save %amount%sign on this product" amount={$PRICE_OFFSET_VALUE} sign={$PRICE_OFFSET_SYMBOL}}</p>
|
|
{if $HAS_END_DATE}
|
|
<p class="sale-period">{intl l="This offer is valid until %date" date={format_date date=$END_DATE output="date"}}</p>
|
|
{/if}
|
|
</div>
|
|
{/loop}
|
|
|
|
<div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
|
{if empty($ROOM_ID)}
|
|
<div class="availability">
|
|
<span class="availibity-label sr-only">{intl l="Availability"}: </span>
|
|
<span itemprop="availability" href="{$current_stock_href}" class="" id="pse-availability">
|
|
<span class="in">{intl l='In Stock'}</span>
|
|
<span class="out">{intl l='Out of Stock'}</span>
|
|
</span>
|
|
</div>
|
|
{/if}
|
|
|
|
<div class="price-container">
|
|
{loop type="category" name="category_tag" id=$DEFAULT_CATEGORY}
|
|
<meta itemprop="category" content="{$TITLE}">
|
|
{/loop}
|
|
|
|
{if ! empty($ROOM_ID)}
|
|
{* C'est un bien à louer -> récupérer le prix *}
|
|
{$available = false}
|
|
|
|
{* Si le bien est dispo aux dates mémorisées on prend le prix indiqué *}
|
|
{ifloop rel='disponibilite'}
|
|
{loop type="beds24.availability" name="disponibilite" product_id=$product_id use_saved_search_criteria=true}
|
|
{$available = true}
|
|
<span class="regular-price col-xs-12">
|
|
<span itemprop="price" class="price">
|
|
<span class="special-price"><span class="price-label">{intl l="Special Price:"} </span><span class="price"{if $PRICE neq $PRICE_REMISE} style="text-decoration:line-through;"{/if}>{format_money number=$PRICE symbol={currency attr="symbol"}}</span></span>
|
|
</span>
|
|
</span>
|
|
{if $PRICE neq $PRICE_REMISE}
|
|
Prix remisé : <span class="price_remise"><strong>{format_money number=$PRICE_REMISE symbol={currency attr="symbol"}}</strong></span>
|
|
- Remise : -<span class="remise">{$REMISE}</span>%
|
|
- Nb jours : <span class="nb_jours">{$NB_JOURS}</span> jour(s)
|
|
{/if}
|
|
{/loop}
|
|
{/ifloop}
|
|
{elseloop rel='disponibilite'}
|
|
{* Pas de dispo avec les paramètres mémorisés récupérer le prix mini *}
|
|
{loop type="beds24.description" name="description" product_id=$product_id}
|
|
{if ! empty($MIN_PRICE)}
|
|
<span class="special-price"><span class="price-label">{intl l="Special Price:"} </span><span class="price">{format_money number=$PRICE symbol={currency attr="symbol"}}</span></span>
|
|
{*Prix remisé: <span class="price_remise">{format_money number=$PRICE_REMISE symbol={currency attr="symbol"}}</span>
|
|
Remise: -<span class="remise">{$REMISE}</span>%
|
|
Nb jours: <span class="nb_jours">{$NB_JOURS}</span> jour(s)*}
|
|
{/if}
|
|
{/loop}
|
|
{/elseloop}
|
|
{else}
|
|
{$available = true}
|
|
|
|
{* List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition *}
|
|
<meta itemprop="itemCondition" itemtype="http://schema.org/ItemCondition" content="NewCondition">
|
|
{* List of currency : The currency used to describe the product price, in three-letter ISO format. *}
|
|
<meta itemprop="priceCurrency" content="{currency attr="code"}">
|
|
|
|
<span id="pse-promo">
|
|
<span class="special-price"><span class="price-label">{intl l="Special Price:"} </span><span id="pse-price" class="price">{format_money number=$TAXED_PROMO_PRICE symbol={currency attr="symbol"}}</span></span>
|
|
<meta itemprop="price" content="{$TAXED_PROMO_PRICE}">
|
|
{if $SHOW_ORIGINAL_PRICE}
|
|
<span class="old-price"><span class="price-label">{intl l="Regular Price:"} </span><span id="pse-price-old" class="price">{format_money number=$TAXED_PRICE}</span></span>
|
|
{/if}
|
|
</span>
|
|
{/if}
|
|
</div>
|
|
|
|
<div id="pse-validity" class="validity alert alert-warning" style="display: none;" >
|
|
{intl l="Sorry but this combination does not exist."}
|
|
</div>
|
|
</div>
|
|
|
|
{form name="thelia.cart.add" }
|
|
<form id="form-product-details" action="{url path="/cart/add" }" method="post" class="form-product"{if ! $available} style="display:none"{/if}>
|
|
{form_hidden_fields}
|
|
<input type="hidden" name="view" value="product">
|
|
<input type="hidden" name="product_id" value="{$ID}">
|
|
{form_field field="append"}
|
|
<input type="hidden" name="{$name}" value="0">
|
|
{/form_field}
|
|
{form_field form=$form field="success_url"}
|
|
<input type="hidden" name="{$name}" value="{url path='/cart'}">
|
|
{/form_field}
|
|
|
|
{form_field form=$form field="error_url"}
|
|
<input type="hidden" name="{$name}" value="{navigate to="current"}">
|
|
{/form_field}
|
|
|
|
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
|
|
|
{form_field field="product"}
|
|
<input id="{$label_attr.for}" type="hidden" name="{$name}" value="{$ID}" {$attr} >
|
|
{/form_field}
|
|
|
|
{* pse *}
|
|
{form_field field='product_sale_elements_id'}
|
|
<input id="pse-id" class="pse-id" type="hidden" name="{$name}" value="{$PRODUCT_SALE_ELEMENT}" {$attr} >
|
|
{/form_field}
|
|
|
|
{if $pse_count > 1}
|
|
{* We have more than 1 combination: custom form *}
|
|
<fieldset id="pse-options" class="product-options">
|
|
{loop name="attributes" type="attribute" product="$product_id" order="manual"}
|
|
<div class="option option-option">
|
|
<label for="option-{$ID}" class="option-heading">{$TITLE}</label>
|
|
<div class="option-content clearfix">
|
|
<select id="option-{$ID}" name="option-{$ID}" class="form-control input-sm pse-option" data-attribute="{$ID}"></select>
|
|
</div>
|
|
</div>
|
|
{/loop}
|
|
<div class="option option-fallback">
|
|
<label for="option-fallback" class="option-heading">{intl l="Options"}</label>
|
|
<div class="option-content clearfix">
|
|
<select id="option-fallback" name="option-fallback" class="form-control input-sm pse-option pse-fallback" data-attribute="0"></select>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
|
|
|
|
{/if}
|
|
|
|
<fieldset class="product-cart form-inline">
|
|
{form_field field='quantity'}
|
|
<div class="form-group group-qty {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
|
<label for="{$label_attr.for}">{$label}</label>
|
|
<input type="number" name="{$name}" id="{$label_attr.for}" class="form-control" value="{$value|default:1}" min="1" required>
|
|
{if $error }
|
|
<span class="help-block">{$message}</span>
|
|
{elseif $value != "" && !$error}
|
|
<span class="help-block"><i class="fa fa-check"></i></span>
|
|
{/if}
|
|
</div>
|
|
{/form_field}
|
|
|
|
<div class="form-group group-btn">
|
|
<button id="pse-submit" type="submit" class="btn btn_add_to_cart btn-primary"><i class="fa fa-chevron-right"></i> {intl l="Add to cart"}</button>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
{/form}
|
|
|
|
<div id="not-available" class="well well-sm"{if $available} style="display:none"{/if}>
|
|
Cet appartement n'est pas disponible pour les dates indiquées, ou le nombre de personnes demandé.
|
|
</div>
|
|
|
|
{hook name="product.details-bottom" product={$ID}}
|
|
{ifloop rel="feature_info"}
|
|
{loop name="feature_info" type="feature" product=$ID id="9,10,11,19"}
|
|
{assign var="carac_id" value=$ID}
|
|
{assign var="carac_title" value=$TITLE}
|
|
{loop name="feature_value_info" type="feature_value" feature=$ID product=$product_id}
|
|
<div class="col-sm-3">
|
|
<div class="info-hebergement">
|
|
{if $carac_id === 9}<span class="fa fa-group"></span>{/if}
|
|
{if $carac_id === 10}<span class="fa fa-bed"></span>{/if}
|
|
{if $carac_id === 11}<span class="fa fa-tasks"></span>{/if}
|
|
{if $carac_id === 19}<span class="fa fa-home"></span>{/if}
|
|
{if $carac_id != 10}<span>{$carac_title}</span>{/if}
|
|
{if $carac_id != 10}
|
|
<span>{if $IS_FREE_TEXT == 1}{$FREE_TEXT_VALUE}{else}<strong>{$TITLE nofilter}</strong>{/if}</span>
|
|
{else}
|
|
<span>{if $IS_FREE_TEXT == 1}{$FREE_TEXT_VALUE}{else}{$TITLE nofilter}{/if}</span>
|
|
<span></span>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
{/loop}
|
|
{/loop}
|
|
{/ifloop}
|
|
{elseloop rel="feature_info"}
|
|
<p><strong>{$CHAPO}</strong></p>
|
|
<p>{$DESCRIPTION|default:'N/A' nofilter}</p>
|
|
{/elseloop}
|
|
</section>
|
|
<section class="col-md-12">
|
|
{* ID Media - On ajoute les cadeaux et les extras *}
|
|
{ifloop rel="extras"}
|
|
<div class="grid extras-upsell" role="complementary" aria-labelledby="products-upsell-label">
|
|
<h3 class="col-md-12">{intl l="Pour agrémenter votre séjour..."}</h3>
|
|
<div class="products-content">
|
|
<ul class="list-unstyled products-grid">
|
|
{loop type="accessory" name="extras" product="$ID" order="random"}
|
|
{if $DEFAULT_CATEGORY == 8 || $DEFAULT_CATEGORY == 9}
|
|
{include file="includes/produits-lies.html" product_id=$ACCESSORY_ID hasBtn=false hasDescription=false width="218" height="146"}
|
|
{/if}
|
|
{/loop}
|
|
</ul>
|
|
</div>
|
|
</div><!-- #products-upsell -->
|
|
|
|
{/ifloop}
|
|
{* ID Media - FIN du code*}
|
|
</section>
|
|
<hr />
|
|
<section class="col-md-12">
|
|
{* ID Media - On ajoute les apparts *}
|
|
{ifloop rel="apparts"}
|
|
<div class="grid apparts-upsell" role="complementary" aria-labelledby="products-upsell-label">
|
|
<h3 class="col-md-12">{intl l="Ou choisissez un autre bien..."}</h3>
|
|
<div class="products-content">
|
|
<ul class="list-unstyled products-grid">
|
|
|
|
{loop type="accessory" name="apparts" product="$ID" order="random"}
|
|
{if $DEFAULT_CATEGORY == 2}
|
|
{include file="includes/produits-lies.html" product_id=$ACCESSORY_ID hasBtn=false hasDescription=false width="218" height="146"}
|
|
{/if}
|
|
{/loop}
|
|
</ul>
|
|
</div>
|
|
</div><!-- #products-upsell -->
|
|
{/ifloop}
|
|
{* ID Media - FIN du code*}
|
|
</section>
|
|
{strip}
|
|
{capture "additional"}
|
|
{ifloop rel="feature_info"}
|
|
<ul>
|
|
{loop name="feature_info" type="feature" product={$ID} exclude="8,9,10,11"}
|
|
{assign var="carac" value=$ID}
|
|
{if $ID != $prev_id}
|
|
{ifloop rel="feature_value_info"}
|
|
<li>
|
|
<strong>{$TITLE}</strong> :
|
|
{loop name="feature_value_info" type="feature_value" feature={$ID} product=$product_id}
|
|
{if $LOOP_COUNT > 1}, {else} {/if}
|
|
<span {if $ID % 2 == 0 && $carac == 8}style="font-weight: 600;color: #a07700"{/if}>{if $IS_FREE_TEXT == 1}{$FREE_TEXT_VALUE}{else}{$TITLE}{/if}</span>
|
|
{/loop}
|
|
</li>
|
|
{/ifloop}
|
|
{assign var="prev_id" value="$ID"}
|
|
{/if}
|
|
{/loop}
|
|
</ul>
|
|
{/ifloop}
|
|
{/capture}
|
|
{/strip}
|
|
|
|
{* Les équipements *}
|
|
{strip}
|
|
{capture "equipements"}
|
|
{ifloop rel="feature_info.equipements"}
|
|
<ul>
|
|
{loop name="feature_info.equipements" type="feature" product={$ID} id="8"}
|
|
{assign var="carac" value=$ID}
|
|
{if $ID != $prev_id}
|
|
{ifloop rel="feature_value_info"}
|
|
<li class="no-bullet">
|
|
{loop name="feature_value_info.equipements" type="feature_value" feature={$ID} product=$product_id}
|
|
{if $LOOP_COUNT > 1}, {else} {/if}
|
|
<span {if $ID % 2 == 0 && $carac == 8}style="font-weight: 600;color: #a07700"{/if}>{if $IS_FREE_TEXT == 1}{$FREE_TEXT_VALUE}{else}{$TITLE}{/if}</span>
|
|
{/loop}
|
|
</li>
|
|
{/ifloop}
|
|
{assign var="prev_id" value="$ID"}
|
|
{/if}
|
|
{/loop}
|
|
</ul>
|
|
{/ifloop}
|
|
{/capture}
|
|
{/strip}
|
|
{* FIN Les équipements *}
|
|
|
|
{strip}
|
|
{capture "brand_info"}
|
|
{loop name="brand_info" type="brand" product={$ID} limit="1"}
|
|
<p><strong><a href="{$URL nofilter}">{$TITLE}</a></strong></p>
|
|
|
|
{loop name="brand.image" type="image" source="brand" id={$LOGO_IMAGE_ID} width=218 height=146 resize_mode="borders"}
|
|
<p><a href="{$URL nofilter}"><img itemprop="image" src="{$IMAGE_URL nofilter}" alt="{$TITLE}"></a></p>
|
|
{/loop}
|
|
|
|
{if $CHAPO}
|
|
<div class="chapo">
|
|
{$CHAPO}
|
|
</div>
|
|
{/if}
|
|
{if $DESCRIPTION}
|
|
<div class="description">
|
|
{$DESCRIPTION nofilter}
|
|
</div>
|
|
{/if}
|
|
{if $POSTSCRIPTUM}
|
|
<small class="postscriptum">
|
|
{$POSTSCRIPTUM}
|
|
</small>
|
|
{/if}
|
|
{/loop}
|
|
{/capture}
|
|
{/strip}
|
|
|
|
{strip}
|
|
{capture "document"}
|
|
{ifloop rel="document"}
|
|
<ul>
|
|
{loop name="document" type="document" product=$ID visible="yes"}
|
|
<li>
|
|
<a href="{$DOCUMENT_URL}" title="{$TITLE}" target="_blank">{$TITLE}</a>
|
|
</li>
|
|
{/loop}
|
|
</ul>
|
|
{/ifloop}
|
|
{/capture}
|
|
{/strip}
|
|
|
|
{strip}
|
|
{capture "features"}
|
|
{if $POSTSCRIPTUM ne ""}
|
|
{$POSTSCRIPTUM nofilter}
|
|
{/if}
|
|
{/capture}
|
|
{/strip}
|
|
|
|
{ifloop rel="feature_info"}
|
|
{loop name="feature_info" type="feature" product={$ID}}{/loop}
|
|
<section id="product-tabs" class="col-sm-12">
|
|
{hookblock name="product.additional" product=$product_id fields="id,class,title,content"}
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
<li class="active" role="presentation"><a id="tab2" href="#description" data-toggle="tab" role="tab">{intl l="Description"}</a></li>
|
|
{if $smarty.capture.additional ne ""}<li role="presentation"><a id="tab1" href="#additional" data-toggle="tab" role="tab">{intl l="Additional Info"}</a></li>{/if}
|
|
{if $smarty.capture.equipements ne ""}<li role="presentation"><a id="tab5" href="#equipements" data-toggle="tab" role="tab">{intl l="Équipements"}</a></li>{/if}
|
|
{if $smarty.capture.brand_info ne ""}<li role="presentation"><a id="tab3" href="#brand_info" data-toggle="tab" role="tab">{intl l="Brand information"}</a></li>{/if}
|
|
{if $smarty.capture.features ne ""}<li role="presentation"><a id="tab5" href="#features" data-toggle="tab" role="tab">{intl l="Points forts"}</a></li>{/if}
|
|
{if $smarty.capture.document ne ""}<li role="presentation"><a id="tab4" href="#document" data-toggle="tab" role="tab">{intl l="Documents"}</a></li>{/if}
|
|
{forhook rel="product.additional"}
|
|
<li role="presentation"><a id="tab{$id}" href="#{$id}" data-toggle="tab" role="tab">{$title}</a></li>
|
|
{/forhook}
|
|
</ul>
|
|
<div class="tab-content">
|
|
<div class="tab-pane active in" id="description" role="tabpanel" aria-labelledby="tab2">
|
|
<p>{$DESCRIPTION|default:'N/A' nofilter}</p>
|
|
</div>
|
|
{if $smarty.capture.additional ne ""}
|
|
<div class="tab-pane" id="additional" itemprop="description" role="tabpanel" aria-labelledby="tab1">
|
|
{$smarty.capture.additional nofilter}
|
|
</div>
|
|
{/if}
|
|
{if $smarty.capture.equipements ne ""}
|
|
<div class="tab-pane" id="equipements" itemprop="description" role="tabpanel" aria-labelledby="tab5">
|
|
{$smarty.capture.equipements nofilter}
|
|
</div>
|
|
{/if}
|
|
{if $smarty.capture.brand_info ne ""}
|
|
<div class="tab-pane" id="brand_info" role="tabpanel" aria-labelledby="tab3">
|
|
{$smarty.capture.brand_info nofilter}
|
|
</div>
|
|
{/if}
|
|
{if $smarty.capture.features ne ""}
|
|
<div class="tab-pane" id="features" role="tabpanel" aria-labelledby="tab5">
|
|
{$smarty.capture.features nofilter}
|
|
</div>
|
|
{/if}
|
|
{if $smarty.capture.document ne ""}
|
|
<div class="tab-pane" id="document" role="tabpanel" aria-labelledby="tab4">
|
|
{$smarty.capture.document nofilter}
|
|
</div>
|
|
{/if}
|
|
{forhook rel="product.additional"}
|
|
<div class="tab-pane" id="{$id}" role="tabpanel" aria-labelledby="tab{$id}">
|
|
{$content nofilter}
|
|
</div>
|
|
{/forhook}
|
|
</div>
|
|
{/hookblock}
|
|
</section>
|
|
{/ifloop}
|
|
{elseloop rel="feature_info"}
|
|
|
|
{/elseloop}
|
|
{hook name="product.bottom" product={$ID}}
|
|
|
|
{* javascript confiuguration to display pse *}
|
|
{$pse=[]}
|
|
{$combination_label=[]}
|
|
{$combination_values=[]}
|
|
{loop name="pse" type="product_sale_elements" product=$product_id}
|
|
{$pse[$ID]=["id" => $ID, "isDefault" => $IS_DEFAULT, "isPromo" => $IS_PROMO, "isNew" => $IS_NEW, "ref" => {$REF}, "ean" => {$EAN}, "quantity" => {$QUANTITY}, "price" => {format_money number=$TAXED_PRICE}, "promo" => {format_money number=$TAXED_PROMO_PRICE} ]}
|
|
{$pse_combination=[]}
|
|
{loop name="combi" type="attribute_combination" product_sale_elements="$ID" order="manual"}
|
|
{if ! $combination_label[$ATTRIBUTE_ID]}
|
|
{$combination_label[$ATTRIBUTE_ID]=["name" => {$ATTRIBUTE_TITLE}, "values" => []]}
|
|
{/if}
|
|
{if ! $combination_values[$ATTRIBUTE_AVAILABILITY_ID]}
|
|
{$combination_label[$ATTRIBUTE_ID]["values"][]=$ATTRIBUTE_AVAILABILITY_ID}
|
|
{$combination_values[$ATTRIBUTE_AVAILABILITY_ID]=[{$ATTRIBUTE_AVAILABILITY_TITLE}, $ATTRIBUTE_ID]}
|
|
{/if}
|
|
{$pse_combination[]=$ATTRIBUTE_AVAILABILITY_ID}
|
|
{/loop}
|
|
{$pse[$ID]["combinations"]=$pse_combination}
|
|
{/loop}
|
|
|
|
<script type="text/javascript">
|
|
|
|
// Injection du code pour le calendrier
|
|
// Product sale elements
|
|
var PSE_FORM = true;
|
|
var PSE_COUNT = {$pse_count};
|
|
{if $check_availability == 0 || $product_virtual == 1 }
|
|
var PSE_CHECK_AVAILABILITY = false;
|
|
{else}
|
|
var PSE_CHECK_AVAILABILITY = true;
|
|
{/if}
|
|
var PSE_DEFAULT_AVAILABLE_STOCK = {config key="default_available_stock" default="100"};
|
|
var PSE = {$pse|json_encode nofilter};
|
|
var PSE_COMBINATIONS = {$combination_label|json_encode nofilter};
|
|
var PSE_COMBINATIONS_VALUE = {$combination_values|json_encode nofilter};
|
|
</script>
|
|
|
|
</article><!-- /#product -->
|
|
|
|
<ul class="pager">
|
|
{if $HAS_PREVIOUS == 1}
|
|
{loop type="product" name="prev_product" id={$PREVIOUS}}
|
|
<li class="previous"><a href="{$URL nofilter}"><i class="fa fa-chevron-left"></i> {intl l="Previous product"}</a></li>
|
|
{/loop}
|
|
{/if}
|
|
{if $HAS_NEXT == 1}
|
|
{loop type="product" name="next_product" id={$NEXT}}
|
|
<li class="next"><a href="{$URL nofilter}"><i class="fa fa-chevron-right"></i> {intl l="Next product"}</a></li>
|
|
{/loop}
|
|
{/if}
|
|
</ul>
|
|
{/loop}
|
|
|
|
</div><!-- /.main -->
|
|
{else}
|
|
<div class="main">
|
|
<article id="content-main" class="col-main" role="main" aria-labelledby="main-label">
|
|
{include file="includes/empty.html"}
|
|
</article>
|
|
</div><!-- /.layout -->
|
|
{/if}
|
|
{/block}
|
|
|
|
{block name="stylesheet"}
|
|
{hook name="product.stylesheet"}
|
|
{/block}
|
|
|
|
{block name="after-javascript-include"}
|
|
{hook name="product.after-javascript-include"}
|
|
{/block}
|
|
|
|
{block name="javascript-initialization"}
|
|
{hook name="product.javascript-initialization" product=$product_id}
|
|
<script>
|
|
{* Eviter les doubles validations *}
|
|
$(document).on('submit.form-product', '.form-product', function (ev) {
|
|
$('#pse-submit').prop('disabled', true).html("Patientez...")
|
|
});
|
|
|
|
$(function() {
|
|
|
|
// Injection du code pour le calendrier
|
|
|
|
flatpickr.localize(flatpickr.l10ns.fr);
|
|
flatpickr(".date-resa", {
|
|
enableTime: true,
|
|
dateFormat: "d.m.Y à H:i",
|
|
time_24hr: true,
|
|
minDate: "today",
|
|
allowInput: "true",
|
|
});
|
|
|
|
|
|
// Mise à jour du prix total en fonction des options choisies, pour le cas standard, et le cas avec legacy attributes
|
|
|
|
var ORIGINAL_PSE = JSON.parse(JSON.stringify(PSE));
|
|
var currencySymbol = "{currency attr="symbol"}";
|
|
|
|
function updateFormattedPrice(priceAsString, delta) {
|
|
var newPrice = delta + parseFloat($.trim(priceAsString.replace(',', '.').replace(currencySymbol, '')));
|
|
|
|
return newPrice.toFixed(2) + ' ' + currencySymbol;
|
|
}
|
|
|
|
function recalculerPrixPack() {
|
|
if ($('.legacy-product-attributes-options').length === 0) {
|
|
recalculerPrixPackPse()
|
|
} else {
|
|
$('.pse-option').first().change();
|
|
}
|
|
}
|
|
|
|
function recalculerPrixPackPse() {
|
|
var delta = 0;
|
|
|
|
$('.select-option:checked').each(function() {
|
|
var quantity = parseInt($($(this).data('input')).val());
|
|
|
|
delta += quantity * parseFloat($(this).data('price'));
|
|
});
|
|
|
|
$.each(ORIGINAL_PSE, function(index, value) {
|
|
PSE[index].price = updateFormattedPrice(ORIGINAL_PSE[index].price, delta);
|
|
PSE[index].promo = updateFormattedPrice(ORIGINAL_PSE[index].promo, delta);
|
|
});
|
|
|
|
var pse = PSE[$('#pse-id').val()];
|
|
|
|
if (pse.isPromo) {
|
|
$('#pse-price-old').html(pse.price);
|
|
$('#pse-price').html(pse.promo);
|
|
} else {
|
|
$('#pse-price-old').html("");
|
|
$('#pse-price').html(pse.price);
|
|
}
|
|
}
|
|
|
|
function recalculerPrixPackLegacy(jsonData) {
|
|
var delta = 0;
|
|
|
|
$('.select-option:checked').each(function() {
|
|
var quantity = parseInt($($(this).data('input')).val());
|
|
|
|
delta += quantity * parseFloat($(this).data('price'));
|
|
});
|
|
|
|
if (jsonData.is_promo) {
|
|
$('#pse-price-old').html(updateFormattedPrice(jsonData.price, delta));
|
|
$('#pse-price').html(updateFormattedPrice(jsonData.promo_price, delta));
|
|
} else {
|
|
$('#pse-price-old').html("");
|
|
$('#pse-price').html(updateFormattedPrice(jsonData.price, delta));
|
|
}
|
|
}
|
|
|
|
$(document).on('click', '.quantity-option', function() {
|
|
recalculerPrixPack();
|
|
});
|
|
|
|
$(document).on('click', '.select-option', function() {
|
|
var disabled = ! $(this).is(':checked');
|
|
|
|
$(($(this).data('input'))).prop('disabled', disabled);
|
|
|
|
recalculerPrixPack();
|
|
});
|
|
|
|
// Cas des legacy product attributes
|
|
$(document).ajaxSuccess(function (event, xhr, settings) {
|
|
console.log(settings.url);
|
|
|
|
if (settings.url.indexOf('get_prices') === -1) {
|
|
return;
|
|
}
|
|
|
|
var jsonData = xhr.responseJSON;
|
|
|
|
recalculerPrixPackLegacy(jsonData);
|
|
});
|
|
|
|
recalculerPrixPack();
|
|
});
|
|
</script>
|
|
{/block}
|