Backup config

This commit is contained in:
Michael RICOIS 2017-10-13 10:31:23 +02:00
parent 3c6b56ea2d
commit a4f9d4ceb3
2 changed files with 310 additions and 3 deletions

View File

@ -0,0 +1,305 @@
{assign var=noSimulator value=false}
{assign var='arrNoSimulator' value=","|explode:'8,9,10,11,12,13'}
{if in_array($product->id_simulator, $arrNoSimulator)}
{assign var=noSimulator value=true}
{/if}
{assign var=bgGrey value=0}
{assign var=arrThemeWhiteInit value='30,31,39,29,47,48,49,50,74,38'}
{assign var=arrThemeWhite value=","|explode:$arrThemeWhiteInit}
{foreach Product::getProductCategories($smarty.get.id_product) as $categ}
{if in_array($categ, $arrThemeWhite)}
{assign var=bgGrey value=1}
{/if}
{/foreach}
{addJsDefL name=msgParfums1}{l s='Vous devez sélectionner au moins un parfums' js=1}{/addJsDefL}
{addJsDefL name=msgParfums2}{l s='Vous devez sélectionner au moins un parfums' js=1}{/addJsDefL}
<main class="product-main configurator std {if $bgGrey}bg-grey-simulator{/if}">
<section itemscope itemtype="http://schema.org/Product" {if $content_only}class="frame"{else}class="container-big bg-green"{/if}>
<header class="page-heading">
{include file="$tpl_dir./breadcrumb.tpl"}
<div class="ctn">
<h1 class="title-arrow"><span>{$product->name|escape:'html':'UTF-8'}</span></h1>
<div class="subtitle">{l s='Choisissez vos options et personnalisez votre produit afin dobtenir les détails et tarifs et un produit unique !'}</div>
<div class="title-drop">{l s='Découvrez des exemples de ce produit mis en situation'}</div>
<a href="#images-suggestion-config" class="btn btn3 scrollto" data-offset="170">{l s='Je veux voir'}</a>
</div>
{if isset($confirmation) && $confirmation}
<p class="confirmation">
{$confirmation}
</p>
{/if}
</header>
<div class="content container">
<div class="bg">
<div class="row">
<!-- Images-->
<div id="image-block" class="md6 xxs12 {if $noSimulator}noSimulator{/if}">
{if $percentReduction > 0}
<span class="product-reduction product-pin">-<span>{$percentReduction}</span><sup>%</sup></span>
{/if}
{if $have_image}
<span class="view_full_size">
{if $jqZoomEnabled && $have_image && !$content_only}
<a class="jqzoom" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" rel="gal1" href="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')|escape:'html':'UTF-8'}">
<img itemprop="image" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html':'UTF-8'}" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" alt="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}"/>
</a>
{else}
<img id="bigpic" itemprop="image" class="img-responsive" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')|escape:'html':'UTF-8'}" title="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" alt="{if !empty($cover.legend)}{$cover.legend|escape:'html':'UTF-8'}{else}{$product->name|escape:'html':'UTF-8'}{/if}" width="{$largeSize.width}" height="{$largeSize.height}"/>
{/if}
</span>
{else}
<span id="view_full_size">
<img itemprop="image" src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg" id="bigpic" alt="" title="{$product->name|escape:'html':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}"/>
</span>
{/if}
<!-- Thumbs-->
{if isset($images) && count($images) > 0}
<!-- thumbnails -->
<div class="clearfix img-list valign-middle">
<div id="thumbnails" class="flexslider clearfix {if isset($images) && count($images) < 2}hidden{/if}">
<ul id="thumbs_list_frame" class="slides">
{if isset($images)}
{foreach from=$images item=image name=thumbnails}
{assign var=imageIds value="`$product->id`-`$image.id_image`"}
{if !empty($image.legend)}
{assign var=imageTitle value=$image.legend|escape:'html':'UTF-8'}
{else}
{assign var=imageTitle value=$product->name|escape:'html':'UTF-8'}
{/if}
<li id="thumbnail_{$image.id_image}"{if $smarty.foreach.thumbnails.last} class="last"{/if} data-src="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}" data-sub-html="{$imageTitle}">
<a{if $jqZoomEnabled && $have_image && !$content_only} href="javascript:void(0);" rel="{literal}{{/literal}gallery: 'gal1', smallimage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'large_default')|escape:'html':'UTF-8'}',largeimage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}'{literal}}{/literal}"{else} href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}" data-fancybox-group="other-views" class="fancybox{if $image.id_image == $cover.id_image} shown{/if}"{/if} title="{$imageTitle}">
<img class="img-responsive" id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'cart_default')|escape:'html':'UTF-8'}" alt="{$imageTitle}" title="{$imageTitle}"{if isset($cartSize)} height="{$cartSize.height}" width="{$cartSize.width}"{/if} itemprop="image" />
</a>
</li>
{/foreach}
{/if}
</ul>
</div>
</div>
{/if}
</div>
<!-- Add to cart-->
<form method="post" class="md6 xxs12" id="buy_block" {if $PS_CATALOG_MODE && !isset($groups) && $product->quantity > 0} class="hidden"{/if} action="{$link->getPageLink('cart')|escape:'html':'UTF-8'}" >
<!-- Infos produits -->
<div class="row">
<div id="main-info" class="lg6 md12 sm6 xxs12">
{hook h='displayNotes'}
{hook h='displayProductForm' mod='antadisconfigurator'}
<!-- Description -->
{*{if $product->description_short || $packItems|@count > 0}
{if $product->description_short}
<div class="resume" itemprop="description">
{$product->description_short}
</div>
{/if}
{/if}*}
{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}
</div>
<div id="product-actions" class="lg6 md12 sm6 xxs12">
<div class="bg-pink-dark clearfix">
<!-- Quantité -->
<div id="quantity" class="clear invisible no-print hidden">
{if !$PS_CATALOG_MODE}
<label for="quantity_wanted">{l s='Quantité'}</label>
<div id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
<div class="valign-middle form-group">
<div class="qtyInputs {if $quantity_discounts|@count > 0}spectific-btn{/if}">
{* Configurator + quantity_discounts => gestion des quantités par palier *}
{*
{if $quantity_discounts|@count > 0}
{if $product->minimal_quantity == 0}
<span>{l s='Quantité(s) non définie sur le produit'}</span>
{else}
<select name="qty" id="quantity_wanted" class="custom-input form-control" data-url="./?controller=product&impactprice=1&ajax=1">
<option value="{$product->minimal_quantity}"{if isset($quantityBackup) && $quantityBackup==$product->minimal_quantity} selected{/if}>{$product->minimal_quantity}</option>
{foreach from=$quantity_discounts key=k item=qty}
<option value="{$qty.quantity}"{if isset($quantityBackup) && $quantityBackup==$qty.quantity} selected{/if}>{$qty.quantity}</option>
{/foreach}
</select>
{/if}
{else}
<a href="#" data-field-qty="qty" class="product_quantity_down">
<i class="icon icon-minus"></i>
</a>
<input type="text" name="qty" id="quantity_wanted" class="form-control" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" />
<a href="#" data-field-qty="qty" class="product_quantity_up">
<i class="icon icon-plus"></i>
</a>
{/if}
*}
<a href="#" data-field-qty="qty" class="product_quantity_down">
<i class="icon icon-minus"></i>
</a>
<input type="text" name="qty" id="quantity_wanted" class="form-control" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" />
<a href="#" data-field-qty="qty" class="product_quantity_up">
<i class="icon icon-plus"></i>
</a>
</div>
</div>
<!-- minimal quantity wanted -->
<p id="minimal_quantity_wanted_p"{if $product->minimal_quantity <= 1 || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
{l s='The minimum purchase order quantity for the product is'} <b id="minimal_quantity_label">{$product->minimal_quantity}</b>
</p>
</div>
{/if}
</div>
<p class="hidden">
<input type="hidden" name="token" value="{$static_token}" />
<input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="id_product_attribute" id="idCombination" value="" />
</p>
<!-- availability or doesntExist -->
<p id="availability_statut" {if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
{if $product->quantity <= 0}
{if $PS_STOCK_MANAGEMENT && $allow_oosp}
{$product->available_later}
{else}
<span id="availability_value" class="label-warning">{l s='Hors stock'}</span>
{/if}
{elseif $PS_STOCK_MANAGEMENT}
<span id="availability_value">{$product->available_now}</span>
{/if}
</span>
</p>
<!-- Attributs produits -->
<div class="product_attributes clearfix">
{if $impactPrice > 0}
<div class="hidden">Options sélectionnés: {displayPrice price=$impactPrice}</div>
{/if}
<!-- Prix -->
{if $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}
<div class="price">
<p itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
{if $priceDisplay >= 0 && $priceDisplay <= 2}
{if $quantity_discounts|@count > 0}
{if isset($quantityBackup)}
{assign var=quantityTotal value=$quantityBackup}
{else}
{assign var=quantityTotal value=$product->minimal_quantity}
{/if}
<span id="our_price_display" class="current-price" itemprop="price">{convertPrice price=$productPrice*$quantityTotal+$impactPrice}</span>
<small style="display:none;" id="unit_price_display">{convertPrice price=$productPrice}</small>
<span class="old-price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>
{if $percentReduction > 0}
{l s='au lieu de '}<span class="barre">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction*$quantityTotal}{/if}</span>
{/if}
</span>
{else}
<span id="our_price_display" class="current-price" itemprop="price">{convertPrice price=$productPrice}</span>
<span class="old-price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}>{if $percentReduction > 0}{l s='au lieu de '}<span class="barre">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span>
{/if}
</span>
{/if}
<meta itemprop="priceCurrency" content="{$currency->iso_code}" />
{hook h="displayProductPriceBlock" product=$product type="price"}
{/if}
</p>
</div> <!-- end prices -->
{if $packItems|@count && $productPrice < $product->getNoPackPrice()}
<div class="pack-price">{l s='Price of products purchased separately : '}{convertPrice price=$product->getNoPackPrice()}</div>
{/if}
{if !empty($product->unity) && $product->unit_price_ratio > 0.000000}
{math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price}
<p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'html':'UTF-8'}</p>
{hook h="displayProductPriceBlock" product=$product type="unit_price"}
{/if}
{/if}
<!-- Attributs -->
{if isset($groups)}
<div id="attributes" class="clear">
{foreach from=$groups key=id_attribute_group item=group}
{if $group.attributes|@count}
<fieldset>
<label>{$group.name|escape:'html':'UTF-8'}&nbsp;</label>
{assign var="groupName" value="group_$id_attribute_group"}
<div class="attribute_list">
{if ($group.group_type == 'select')}
<select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="custom-input form-control attribute_select no-print">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option>
{/foreach}
</select>
{elseif ($group.group_type == 'color')}
<ul class="color">
{assign var="default_colorpicker" value=""}
{foreach from=$group.attributes key=id_attribute item=group_attribute}
{assign var='img_color_exists' value=file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
<li{if $group.default == $id_attribute} class="selected"{/if}>
<a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}"{if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background:{$colors.$id_attribute.value|escape:'html':'UTF-8'};"{/if} title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}">
{if $img_color_exists}
<img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="35" height="35" />
{/if}
</a>
</li>
{if ($group.default == $id_attribute)}
{$default_colorpicker = $id_attribute}
{/if}
{/foreach}
</ul>
<input type="hidden" class="color_pick_hidden" name="{$groupName|escape:'html':'UTF-8'}" value="{$default_colorpicker|intval}" />
{elseif ($group.group_type == 'radio')}
<ul>
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li>
<input type="radio" class="custom-input attribute_radio" name="{$groupName|escape:'html':'UTF-8'}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} />
<span>{$group_attribute|escape:'html':'UTF-8'}</span>
</li>
{/foreach}
</ul>
{/if}
</div>
</fieldset>
{/if}
{/foreach}
</div>
{/if}
</div>
<p id="availability_date"{if ($product->quantity > 0) || !$product->available_for_order || $PS_CATALOG_MODE || !isset($product->available_date) || $product->available_date < $smarty.now|date_format:'%Y-%m-%d'} style="display: none;"{/if}>
<span id="availability_date_label">{l s='Ce produit sera de nouveau disponible à partir du '}</span>
<span id="availability_date_value">{if Validate::isDate($product->available_date)}{dateFormat date=$product->available_date full=false}{/if}</span>
</p>
<div class="box-cart-bottom">
<div{if (!$allow_oosp && $product->quantity <= 0) || !$product->available_for_order || (isset($restricted_country_mode) && $restricted_country_mode) || $PS_CATALOG_MODE} class="unvisible"{/if}>
<p>
<button type="submit" name="Submit" class="btn btn-full-width">
<span>{if $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Add to cart'}{/if}</span>
</button>
</p>
</div>
</div>
</div>
{hook h="displayReinsurranceProduct"}
{hook h='displayBottomColumnProduct'}
</div>
</div>
</form>
</div>
</div>
</div>
<div class="ctn">
<div class="ctn-reassurance">
{hook h='displayReassurance2'}
</div>
</div>
</section>
</main>

View File

@ -266,9 +266,11 @@
</div>
<div class="config-backup">
<div class="form-control-ctn">
<input type="text" name="config-email" class="form-control" value="" placeholder="{l s='Email'}"/>
</div>
<div class="clearfix form-group" style="margin:0;">
<div class="ctn-input">
<input type="text" name="config-email" class="form-control" value="" placeholder="{l s='Email'}"/>
</div>
</div>
<button type="button" id="config-backup" name="configBackup" class="btn btn2 btn-full-width">
<span>{l s='Backup your configuration' mod='antadisconfigurator'}</span>
</button>