Jump to content

Prix divisé par 3 ou 2


Recommended Posts

Bonjour,
Sur notre boutique nous proposons le paiement en X fois sans frais et je souhaiterais donc
afficher sur la fiche produit une info toute bête c'est a dire le prix normal
mais avec dessous une indication ( le prix final / 3 ) exemple (payer que 150 € / mois pendant 3 mois)

en faite comment dire a presta dans le tpl "prend le prix afficher avec les remise etc"... "et tu me le divise par 3" =

Merci de votre aide

Link to comment
Share on other sites

Bonjour,

pour cela il faut éditer le fichier themes/prestashop/product.tpl et ajouter la ligne :


{convertPrice price=$product->getPrice(true, $smarty.const.NULL)/3} / mois pendant 3 mois



en-dessous de la ligne contenant :

{if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|da...

Link to comment
Share on other sites

Pour ajouter la mention sur la page order.php, dans le fichier /themes/prestashop/shopping-cart.tpl, ajouter le code


Mensualité pour un paiement en 3x sans frais:
{displayPrice price=$total_price/3}



après le code


{l s='Total (tax incl.):'}
{displayPrice price=$total_price}



et aussi ajouter le code


Mensualité pour un paiement en 3x sans frais:
{displayPrice price=$total_price_without_tax/3}



après le code


{l s='Total:'}
{displayPrice price=$total_price_without_tax}



Je ne sais pas si tu as remarqué, mais la modification pour le bloc panier n'est pas automatique lors de l'ajout d'un produit au panier.

Je ne sais pas comment forcer le panier à mettre à jour ce champs autmatiquement

Link to comment
Share on other sites

Pour le block panier utilise ce code au lieu de l'ancien, celui-ci gère les décimales


Payable en 3 mensualités de

{convertPrice price=$cart->getOrderTotal(true)/3}



Pour la mise à jour automatiquement de ce champ, il faut que je regarde la partie ajax

Link to comment
Share on other sites

Pour la mise à jour automatique dans le block panier utilise le code suivant dans modules/blockcart/blockcart.tpl


Payable en 3 mensualités de
{convertPrice price=$cart->getOrderTotal(true)/3}



et dans modules/blockcart/ajax-cart.js, ajoute

         $('.ajax_block_cart_mensualite').text(float jsonData.total/3);



après le code

   //update general cart informations everywere in the page
   updateCartEverywhere : function(jsonData) {
       $('.ajax_cart_total').text(jsonData.productTotal);
       $('.ajax_cart_shipping_cost').text(jsonData.shippingCost);
       $('.cart_block_wrapping_cost').text(jsonData.wrappingCost);
       $('.ajax_block_cart_total').text(jsonData.total);

Link to comment
Share on other sites

j'ai rajouter ca dans le ajax-cart.js

//update general cart informations everywere in the page
updateCartEverywhere : function(jsonData) {
$('.ajax_cart_total').text(jsonData.productTotal);
$('.ajax_cart_shipping_cost').text(jsonData.shippingCost);
$('.cart_block_wrapping_cost').text(jsonData.wrappingCost);
$('.ajax_block_cart_total').text(jsonData.total);
$('.ajax_block_cart_mensualite').text(float jsonData.total/3);


et ca dans blockcart
{convertPrice price=$cart->getOrderTotal(true)/3}
Link to comment
Share on other sites

Sur ma boutique de test, tout marche suite au modifications de ce sujet.
Sur ta boutique, la partie order.php marche aussi ("Ou votre paiement en 3 X sans frais : ....")
Mais dans le block panier je ne vois rien chez toi, peut importe le montant.

Link to comment
Share on other sites

Je vois effectivement bien le "Payable en 3 mensualités" dans le blockcart à présent.
Est ce que la non mise à jour pourrait venir de la fenêtre modale qui propose de "continuer vos achats" ou "terminer votre commande" ?
Peux tu tester en désactivant cette fenêtre modale ?

Link to comment
Share on other sites

  • 1 year later...

bonjour je suis sous 1.4.9.0

 

j'aimerai également affiché le prix mensualisé par 3 mais je n'ai pas la ligne que vous indiqué :

 

{if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|da...

 

voici mon fichier product.tpl quelqu'un pourrait il me dire ou placer ce code

{convertPrice price=$product->getPrice(true, $smarty.const.NULL)/3} / mois pendant 3 mois

merci à vous

 

 

{include file="$tpl_dir./errors.tpl"}

{if $errors|@count == 0}

<script type="text/javascript">

// <![CDATA[

 

// PrestaShop internal settings

var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';

var currencyRate = '{$currencyRate|floatval}';

var currencyFormat = '{$currencyFormat|intval}';

var currencyBlank = '{$currencyBlank|intval}';

var taxRate = {$tax_rate|floatval};

var jqZoomEnabled = {if $jqZoomEnabled}true{else}false{/if};

 

//JS Hook

var oosHookJsCodeFunctions = new Array();

 

// Parameters

var id_product = '{$product->id|intval}';

var productHasAttributes = {if isset($groups)}true{else}false{/if};

var quantitiesDisplayAllowed = {if $display_qties == 1}true{else}false{/if};

var quantityAvailable = {if $display_qties == 1 && $product->quantity}{$product->quantity}{else}0{/if};

var allowBuyWhenOutOfStock = {if $allow_oosp == 1}true{else}false{/if};

var availableNowValue = '{$product->available_now|escape:'quotes':'UTF-8'}';

var availableLaterValue = '{$product->available_later|escape:'quotes':'UTF-8'}';

var productPriceTaxExcluded = {$product->getPriceWithoutReduct(true)|default:'null'} - {$product->ecotax};

var reduction_percent = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'percentage'}{$product->specificPrice.reduction*100}{else}0{/if};

var reduction_price = {if $product->specificPrice AND $product->specificPrice.reduction AND $product->specificPrice.reduction_type == 'amount'}{$product->specificPrice.reduction}{else}0{/if};

var specific_price = {if $product->specificPrice AND $product->specificPrice.price}{$product->specificPrice.price}{else}0{/if};

var specific_currency = {if $product->specificPrice AND $product->specificPrice.id_currency}true{else}false{/if};

var group_reduction = '{$group_reduction}';

var default_eco_tax = {$product->ecotax};

var ecotaxTax_rate = {$ecotaxTax_rate};

var currentDate = '{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}';

var maxQuantityToAllowDisplayOfLastQuantityMessage = {$last_qties};

var noTaxForThisProduct = {if $no_tax == 1}true{else}false{/if};

var displayPrice = {$priceDisplay};

var productReference = '{$product->reference|escape:'htmlall':'UTF-8'}';

var productAvailableForOrder = {if (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE}'0'{else}'{$product->available_for_order}'{/if};

var productShowPrice = '{if !$PS_CATALOG_MODE}{$product->show_price}{else}0{/if}';

var productUnitPriceRatio = '{$product->unit_price_ratio}';

var idDefaultImage = {if isset($cover.id_image_only)}{$cover.id_image_only}{else}0{/if};

 

// Customizable field

var img_ps_dir = '{$img_ps_dir}';

var customizationFields = new Array();

{assign var='imgIndex' value=0}

{assign var='textFieldIndex' value=0}

{foreach from=$customizationFields item='field' name='customizationFields'}

{assign var="key" value="pictures_`$product->id`_`$field.id_customization_field`"}

customizationFields[{$smarty.foreach.customizationFields.index|intval}] = new Array();

customizationFields[{$smarty.foreach.customizationFields.index|intval}][0] = '{if $field.type|intval == 0}img{$imgIndex++}{else}textField{$textFieldIndex++}{/if}';

customizationFields[{$smarty.foreach.customizationFields.index|intval}][1] = {if $field.type|intval == 0 && isset($pictures.$key) && $pictures.$key}2{else}{$field.required|intval}{/if};

{/foreach}

 

// Images

var img_prod_dir = '{$img_prod_dir}';

var combinationImages = new Array();

 

{if isset($combinationImages)}

{foreach from=$combinationImages item='combination' key='combinationId' name='f_combinationImages'}

combinationImages[{$combinationId}] = new Array();

{foreach from=$combination item='image' name='f_combinationImage'}

combinationImages[{$combinationId}][{$smarty.foreach.f_combinationImage.index}] = {$image.id_image|intval};

{/foreach}

{/foreach}

{/if}

 

combinationImages[0] = new Array();

{if isset($images)}

{foreach from=$images item='image' name='f_defaultImages'}

combinationImages[0][{$smarty.foreach.f_defaultImages.index}] = {$image.id_image};

{/foreach}

{/if}

 

// Translations

var doesntExist = '{l s='The product does not exist in this model. Please choose another.' js=1}';

var doesntExistNoMore = '{l s='This product is no longer in stock' js=1}';

var doesntExistNoMoreBut = '{l s='with those attributes but is available with others' js=1}';

var uploading_in_progress = '{l s='Uploading in progress, please wait...' js=1}';

var fieldRequired = '{l s='Please fill in all required fields' js=1}';

 

{if isset($groups)}

// Combinations

{foreach from=$combinations key=idCombination item=combination}

addCombination({$idCombination|intval}, new Array({$combination.list}), {$combination.quantity}, {$combination.price}, {$combination.ecotax}, {$combination.id_image}, '{$combination.reference|addslashes}', {$combination.unit_impact}, {$combination.minimal_quantity});

{/foreach}

// Colors

{if $colors|@count > 0}

{if $product->id_color_default}var id_color_default = {$product->id_color_default|intval};{/if}

{/if}

{/if}

//]]>

</script>

 

{include file="$tpl_dir./breadcrumb.tpl"}

 

<div id="link">{if $prevLink != NULL}<a href="{$prevLink}" class="left" title="{$prevName}">{l s='Previous'}<span class="black"> :: {$prevName}</span></a>{/if} {if $nextLink != NULL}<a href="{$nextLink}" class="right" title="{$nextName}"><span class="black">{$nextName} :: </span>{l s='Next'}</a>{/if}</div>

 

<div id="primary_block" class="clearfix">

{if isset($adminActionDisplay) && $adminActionDisplay}

<div id="admin-action">

<p>{l s='This product is not visible to your customers.'}

<input type="hidden" id="admin-action-product-id" value="{$product->id}" />

<input type="submit" value="{l s='Publish'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad}', 0)"/>

<input type="submit" value="{l s='Back'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad}', 1)"/>

</p>

<div class="clear" ></div>

<p id="admin-action-result"></p>

</p>

</div>

{/if}

 

{if isset($confirmation) && $confirmation}

<p class="confirmation">

{$confirmation}

</p>

{/if}

 

<!-- right infos-->

<div id="pb-right-column">

<!-- product img-->

<div id="image-block">

{if $have_image}

{if $jqZoomEnabled}<a id="zoom1" class="cloud-zoom" href="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox')}" style="position: relative; display: block;">

 

<img alt="{$product->name|escape:'htmlall':'UTF-8'}" title="{$product->name|escape:'htmlall':'UTF-8'}" id="bigpic" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large')}" style="display: block;"/>

 

</a>

{else}

<img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large')}" id="bigpic" alt="{$product->name|escape:'htmlall':'UTF-8'}" />

{/if}

{else}

<img src="{$img_prod_dir}{$lang_iso}-default-large.jpg" alt="" title="{$product->name|escape:'htmlall':'UTF-8'}" />

{/if}

</div>

 

{if isset($images) && count($images) > 0}

<!-- thumbnails -->

<div id="views_block" {if isset($images) && count($images) < 2}class="hidden"{/if}>

{if isset($images) && count($images) > 3}<span class="view_scroll_spacer"><a id="view_scroll_left" class="hidden" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Previous'}</a></span>{/if}

{if $jqZoomEnabled}

<div id="thumbs_list">

<ul id="thumbs_list_frame">

{foreach from=$images item=image name=thumbnails}

{assign var=imageIds value="`$product->id`-`$image.id_image`"}

<li id="thumbnail_{$image.id_image}">

<a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox')}" class="cloud-zoom-gallery" title="{$image.legend|htmlspecialchars}"

rel="useZoom: 'zoom1', smallImage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'large')}'">

<img src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium')}" alt="{$image.legend|htmlspecialchars}"/></a>

 

</li>

{/foreach}

</ul>

</div>

{else}

<div id="thumbs_list">

<ul id="thumbs_list_frame">

{if isset($images)}

{foreach from=$images item=image name=thumbnails}

{assign var=imageIds value="`$product->id`-`$image.id_image`"}

<li id="thumbnail_{$image.id_image}">

<a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox')}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">

<img id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'medium')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" />

</a>

</li>

{/foreach}

{/if}

</ul>

</div>

{/if}

 

 

 

{if isset($images) && count($images) > 3}<a id="view_scroll_right" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}">{l s='Next'}</a>{/if}

</div>

{/if}

{if isset($images) && count($images) > 1}<p class="align_center clear"><span id="wrapResetImages" style="display: none;"><img src="{$img_dir}icon/cancel_16x18.gif" alt="{l s='Cancel'}" width="16" height="18"/> <a id="resetImages" href="{$link->getProductLink($product)}" onclick="$('span#wrapResetImages').hide('slow');return (false);">{l s='Display all pictures'}</a></span></p>{/if}

</div>

 

<!-- left infos-->

<div id="pb-left-column">

<h1>{$product->name|escape:'htmlall':'UTF-8'}</h1>

 

<!-- Référence-->

<p id="product_reference" {if isset($groups) OR !$product->reference}style="display: none;"{/if}><label for="product_reference">{l s='Reference :'} </label><span class="editable">{$product->reference|escape:'htmlall':'UTF-8'}</span></p>

 

<!-- availability -->

<p id="availability_statut"{if ($product->quantity <= 0 && !$product->available_later && $allow_oosp) OR ($product->quantity > 0 && !$product->available_now) OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>

<span id="availability_label">{l s='Availability:'}</span>

<span id="availability_value"{if $product->quantity <= 0} class="warning_inline"{/if}>

{if $product->quantity <= 0}{if $allow_oosp}{$product->available_later}{else}{l s='This product is no longer in stock'}{/if}{else}{$product->available_now}{/if}

</span>

</p>

 

<!-- number of item in stock OR isset($combination.list)-->

{if (($display_qties == 1 OR $product->quantity <= $last_qties) && !$PS_CATALOG_MODE && $product->available_for_order)}

<p id="pQuantityAvailable"{if $product->quantity <= 0} style="display: none;"{/if}>

<span id="quantityAvailable">{$product->quantity|intval}</span>

<span {if $product->quantity > 1} style="display: none;"{/if} id="quantityAvailableTxt">{l s='item in stock'}</span>

<span {if $product->quantity == 1} style="display: none;"{/if} id="quantityAvailableTxtMultiple">{l s='items in stock'}</span>

</p>

{/if}

<!-- Out of stock hook -->

<p id="oosHook"{if $product->quantity > 0} style="display: none;"{/if}>

{$HOOK_PRODUCT_OOS}

</p>

 

<p class="warning_inline" id="last_quantities"{if ($product->quantity > $last_qties OR $product->quantity <= 0) OR $allow_oosp OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if} >{l s='Warning: Last items in stock!'}</p>

 

<!-- On line only -->

{if $product->online_only}

<p>{l s='Online only'}</p>

{/if}

 

 

{if $product->description_short OR $packItems|@count > 0}

<div id="short_description_block">

{if $product->description_short}

<div id="short_description_content" class="rte align_justify">{$product->description_short}</div>

{/if}

{if $product->description}

<p class="buttons_bottom_block"><a href="javascript:{ldelim}{rdelim}" class="button">{l s='More details'}</a></p>

{/if}

{if $packItems|@count > 0}

<h3>{l s='Pack content'}</h3>

{foreach from=$packItems item=packItem}

<div class="pack_content">

{$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)}">{$packItem.name|escape:'htmlall':'UTF-8'}</a>

<p>{$packItem.description_short}</p>

</div>

{/foreach}

{/if}

</div>

{/if}

 

{if isset($colors) && $colors}

<!-- colors -->

<div id="color_picker">

<p>{l s='Pick a color:' js=1}</p>

<div class="clear"></div>

<ul id="color_to_pick_list">

{foreach from=$colors key='id_attribute' item='color'}

<li><a id="color_{$id_attribute|intval}" class="color_pick" style="background: {$color.value};" onclick="updateColorSelect({$id_attribute|intval});$('#wrapResetImages').show('slow');" title="{$color.name}">{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$color.name}" width="20" height="20" />{/if}</a></li>

{/foreach}

</ul>

<div class="clear"></div>

</div>

{/if}

 

 

</div>

 

 

{if $quantity_discounts}

<!-- quantity discount -->

<ul class="idTabs">

<li><a style="cursor: pointer" class="selected">{l s='Quantity discount'}</a></li>

</ul>

<div id="quantityDiscount">

<table class="std">

<tr>

{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}

<th>{$quantity_discount.quantity|intval}

{if $quantity_discount.quantity|intval > 1}

{l s='quantities'}

{else}

{l s='quantity'}

{/if}

</th>

{/foreach}

</tr>

<tr>

{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}

<td>

{if $quantity_discount.price != 0 OR $quantity_discount.reduction_type == 'amount'}

-{convertPrice price=$quantity_discount.real_value|floatval}

{else}

-{$quantity_discount.real_value|floatval}%

{/if}

</td>

{/foreach}

</tr>

</table>

</div>

{/if}

 

 

<!-- description and features -->

{if $product->description || $features || $attachments || $packItems|@count > 0}

<div id="more_info_block" class="clear">

<ul id="more_info_tabs" class="idTabs idTabsShort">

{if $product->description}<li><a id="more_info_tab_more_info" href="#idTab1">{l s='More info'}</a></li>{/if}

{if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2">{l s='Data sheet'}</a></li>{/if}

{if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if}

{if $packItems|@count > 0}<li><a id="more_info_tab_attachments" href="#idTab4">{l s='Pack content'}</a></li>{/if}

 

</ul>

<div id="more_info_sheets" class="sheets align_justify">

{if $product->description}

<!-- full description -->

<div id="idTab1" class="rte">{$product->description}</div>

{/if}

{if $features}

<!-- product's features -->

<ul id="idTab2" class="bullet">

{foreach from=$features item=feature}

<li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li>

{/foreach}

</ul>

{/if}

{if $attachments}

<ul id="idTab9" class="bullet">

{foreach from=$attachments item=attachment}

<li><a href="{$link->getPageLink('attachment.php', true)}?id_attachment={$attachment.id_attachment}">{$attachment.name|escape:'htmlall':'UTF-8'}</a><br />{$attachment.description|escape:'htmlall':'UTF-8'}</li>

{/foreach}

</ul>

{/if}

{if $packItems|@count > 0}

<div id="idTab4" class="bullet">

{include file="$tpl_dir./product-list.tpl" products=$packItems}

</div>

{/if}

</div>

</div>

{/if}

 

<!-- Customizable products -->

{if $product->customizable}

<h2>{l s='Product customization'}</h2>

<div class="customization_block">

<form method="post" action="{$customizationFormTarget}" enctype="multipart/form-data" id="customizationForm">

<p>

<img src="{$img_dir}icon/infos.gif" alt="Informations" />

{l s='After saving your customized product, remember to add it to your cart.'}

{if $product->uploadable_files}<br />{l s='Allowed file formats are: GIF, JPG, PNG'}{/if}

</p>

{if $product->uploadable_files|intval}

<h3>{l s='Pictures'}</h3>

<ul id="uploadable_files">

{counter start=0 assign='customizationField'}

{foreach from=$customizationFields item='field' name='customizationFields'}

{if $field.type == 0}

<li class="customizationUploadLine{if $field.required} required{/if}">{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}

{if isset($pictures.$key)}

<div class="customizationUploadBrowse">

<img src="{$pic_dir}{$pictures.$key}_small" alt="" />

<a href="{$link->getProductDeletePictureLink($product,{$field.id_customization_field})}" title="{l s='Delete'}" >

<img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" class="customization_delete_icon" width="11" height="13" />

</a>

</div>{/if}

<div class="customizationUploadBrowse"><input type="file" name="file{$field.id_customization_field}" id="img{$customizationField}" class="customization_block_input {if isset($pictures.$key)}filled{/if}" />{if $field.required}<sup>*</sup>{/if}

<div class="customizationUploadBrowseDescription">{if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your hard drive'}{/if}</div>

</div>

</li>

{counter}

{/if}

{/foreach}

</ul>

{/if}

<div class="clear"></div>

{if $product->text_fields|intval}

<h3>{l s='Texts'}</h3>

<ul id="text_fields">

{counter start=0 assign='customizationField'}

{foreach from=$customizationFields item='field' name='customizationFields'}

{if $field.type == 1}

<li class="customizationUploadLine{if $field.required} required{/if}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}

{if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}<textarea type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input" />{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>

</li>

{counter}

{/if}

{/foreach}

</ul>

{/if}

<p style="clear: left;" id="customizedDatas">

<input type="hidden" name="quantityBackup" id="quantityBackup" value="" />

<input type="hidden" name="submitCustomizedDatas" value="1" />

<input type="button" class="button" value="{l s='Save'}" onclick="javascript:saveCustomization()" />

<span id="ajax-loader" style="display:none"><img src="{$img_ps_dir}loader.gif" alt="loader" /></span>

</p>

</form>

<p class="clear required"><sup>*</sup> {l s='required fields'}</p>

</div>

{/if}

 

{$HOOK_PRODUCT_FOOTER}

 

{$HOOK_PRODUCT_TAB_CONTENT}

 

 

</div>

 

<!-- Right Column Product -->

 

<div id="super_right">

{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}

<!-- add to cart form-->

<div id="prices">

<form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart.php')}" method="post">

 

<!-- hidden datas -->

<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>

 

<!-- prices -->

{if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}

<p class="price">

{if !$priceDisplay || $priceDisplay == 2}

{assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL)}

{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}

{elseif $priceDisplay == 1}

{assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL)}

{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}

{/if}

{if $product->on_sale}

<img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>

<span class="on_sale">{l s='On sale!'}</span>

{elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice}

<span class="discount">{l s='Reduced price!'}</span>

<br />

{/if}

 

{if $priceDisplay >= 0 && $priceDisplay <= 2}

<span class="our_price_display">

<span id="our_price_display">{convertPrice price=$productPrice}</span>

{if $tax_enabled && $display_tax_label == 1}

{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}

{/if}

</span>

{/if}

 

{if $priceDisplay == 2}

<br />

<span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'}</span>

{/if}

<br />

</p>

{if $product->specificPrice AND $product->specificPrice.reduction}

<p id="old_price"><span class="bold">

{if $priceDisplay >= 0 && $priceDisplay <= 2}

{if $productPriceWithoutRedution > $productPrice}

<span id="old_price_display">{convertPrice price=$productPriceWithoutRedution}</span>

{if $tax_enabled && $display_tax_label == 1}

{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}

{/if}

{/if}

{/if}

</span>

</p>

{/if}

{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}

<p id="reduction_percent">{l s='(price reduced by'} <span id="reduction_percent_display">{$product->specificPrice.reduction*100}</span> %{l s=')'}</p>

{/if}

{if $packItems|@count}

<p class="pack_price">{l s='instead of'} <span style="text-decoration: line-through;">{convertPrice price=$product->getNoPackPrice()}</span></p>

<br class="clear" />

{/if}

{if $product->ecotax != 0}

<p class="price-ecotax">{l s='include'} <span id="ecotax_price_display">{if $priceDisplay == 2}{$ecotax_tax_exc|convertAndFormatPrice}{else}{$ecotax_tax_inc|convertAndFormatPrice}{/if}</span> {l s='for green tax'}

{if $product->specificPrice AND $product->specificPrice.reduction}

<br />{l s='(not impacted by the discount)'}

{/if}

</p>

{/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:'htmlall':'UTF-8'}</p>

{/if}

{*close if for show price*}

{/if}

 

{if isset($groups)}

<!-- attributes -->

<div id="attributes">

{foreach from=$groups key=id_attribute_group item=group}

{if $group.attributes|@count}

<p>

<label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>

{assign var="groupName" value="group_$id_attribute_group"}

<select name="{$groupName}" id="group_{$id_attribute_group|intval}" onchange="javascript:findCombination();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};">

{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:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option>

{/foreach}

</select>

</p>

{/if}

{/foreach}

</div>

{/if}

 

 

<!-- quantity wanted -->

<p id="quantity_wanted_p"{if (!$allow_oosp && $product->quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>

<label>{l s='Quantity :'}</label>

<input type="text" name="qty" id="quantity_wanted" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}{if $product->minimal_quantity > 1}{$product->minimal_quantity}{else}1{/if}{/if}" size="2" maxlength="3" {if $product->minimal_quantity > 1}onkeyup="checkMinimalQuantity({$product->minimal_quantity});"{/if} />

</p>

 

<p{if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} style="display: none;"{/if} id="add_to_cart" class="buttons_bottom_block"><input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive_large_cart" /></p>

 

{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}

</form>

{/if}

{if $HOOK_PRODUCT_TAB}{$HOOK_PRODUCT_TAB}{/if}

{if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}

</div>

 

{if $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}

 

{if isset($accessories) AND $accessories}

<!-- accessories -->

<div id="accessoires_block" class="block excluprod">

<h4>{l s='Accessories'}</h4>

<div class="block_content">

<ul>

{foreach from=$accessories item=accessory name=accessories_list}

{assign var='accessoryLink' value=$link->getProductLink($accessory.id_product, $accessory.link_rewrite, $accessory.category)}

<li class="ajax_block_product {if $smarty.foreach.accessories_list.first}first_item{elseif $smarty.foreach.accessories_list.last}last_item{else}item{/if} product_accessories_description">

<a href="{$accessoryLink|escape:'htmlall':'UTF-8'}" title="{$accessory.legend|escape:'htmlall':'UTF-8'}" class="product_image left clear"><img src="{$link->getImageLink($accessory.link_rewrite, $accessory.id_image, 'medium')}" alt="{$accessory.legend|escape:'htmlall':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" /></a>

 

<div class="product_desc left">

<h5><a href="{$accessoryLink|escape:'htmlall':'UTF-8'}">{$accessory.name|truncate:22:'...':true|escape:'htmlall':'UTF-8'}</a></h5>

{if $accessory.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price left">{if $priceDisplay != 1}{displayWtPrice p=$accessory.price}{else}{displayWtPrice p=$accessory.price_tax_exc}{/if}</p>{/if}

</div>

</li>

{/foreach}

</ul>

</div>

</div>

<!-- /accessories -->

{/if}

 

{if isset($wishlist_activate) AND $wishlist_activate}

<!-- wishlist -->

<div id="wishlist_block" class="overley_box">

<p id="hidewishlist"><a class="hidewish">x</a></p>

<h4>

<a href="{$base_dir_ssl}/modules/blockwishlist/mywishlist.php">{l s='Wishlist'}</a>

</h4>

<div class="block_content">

<div id="wishlist_block_list" class="expanded">

{if $wishlist_products}

<dl class="products">

{foreach from=$wishlist_products item=product name=i}

<dt class="{if $smarty.foreach.i.first}first_item{elseif $smarty.foreach.i.last}last_item{else}item{/if}">

<span class="quantity-formated"><span class="quantity">{$product.quantity|intval}</span>x</span>

<a class="cart_block_product_name"

href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category_rewrite)}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|truncate:30:'...'|escape:'htmlall':'UTF-8'}</a>

<a class="ajax_cart_block_remove_link" href="javascript:;" onclick="javascript:WishlistCart('wishlist_block_list', 'delete', '{$product.id_product}', {$product.id_product_attribute}, '0', '{$token}');" title="{l s='remove this product from my wishlist'}"><img src="{$img_dir}icon/delete.gif" width="11" height="13" alt="{l s='Delete'}" class="icon" /></a>

</dt>

{if isset($product.attributes_small)}

<dd class="{if $smarty.foreach.i.first}first_item{elseif $smarty.foreach.i.last}last_item{else}item{/if}">

<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category_rewrite)}" title="{l s='Product detail'}">{$product.attributes_small|escape:'htmlall':'UTF-8'}</a>

</dd>

{/if}

{/foreach}

</dl>

{else}

<dl class="products">

<dt>{l s='No products'}</dt>

</dl>

{/if}

</div>

<p class="align_center">

{if $wishlists}

<select name="wishlists" id="wishlists" onchange="WishlistChangeDefault('wishlist_block_list', $('#wishlists').val());">

{foreach from=$wishlists item=wishlist name=i}

<option value="{$wishlist.id_wishlist}"{if $id_wishlist eq $wishlist.id_wishlist or ($id_wishlist == false and $smarty.foreach.i.first)} selected="selected"{/if}>{$wishlist.name|truncate:22:'...'|escape:'htmlall':'UTF-8'}</option>

{/foreach}

</select>

{/if}

<a href="{$base_dir_ssl}modules/blockwishlist/mywishlist.php" class="exclusive" title="{l s='My wishlists'}">{l s='My wishlists'}</a>

</p>

</div>

</div>

<!-- /wishlist -->

{/if}

 

{if isset($viewed_activate) AND $productsViewedObj}

<!-- Block Viewed products -->

<div id="viewed-products_block_left" class="block excluprod">

<h4>{l s='Viewed products'}</h4>

<div class="block_content">

<ul class="products clearfix">

{foreach from=$productsViewedObj item=viewedProduct name=myLoop}

<li class="clearfix left">

<a href="{$link->getProductLink($viewedProduct->id, $viewedProduct->link_rewrite, $viewedProduct->category_rewrite)}" title="{l s='More about'} {$viewedProduct->name|escape:html:'UTF-8'}"><img src="{$link->getImageLink($viewedProduct->link_rewrite, $viewedProduct->cover, 'medium')}" {if $mediumSize} height="{$mediumSize.height}" width="{$mediumSize.width}" {/if} alt="{$viewedProduct->legend|escape:html:'UTF-8'}" /></a>

</li>

{/foreach}

</ul>

</div>

</div>

<!-- /Block Viewed products -->

{/if}

 

 

{if $ajax_allowed}

<script type="text/javascript">

var CUSTOMIZE_TEXTFIELD = {$CUSTOMIZE_TEXTFIELD};

var customizationIdMessage = '{l s='Customization #' js=1}';

var removingLinkText = '{l s='remove this product from my cart' js=1}';

</script>

{/if}

 

<!-- MODULE Block cart -->

<div id="cart_block" class="overley_box">

<p id="hidecartblock"><a class="hidecart">x</a></p>

<h4>{l s='Cart'}</h4>

<div class="block_content">

<!-- block summary -->

<div id="cart_block_summary" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}collapsed{else}expanded{/if}">

<span class="ajax_cart_quantity" {if $cart_qties <= 0}style="display:none;"{/if}>{$cart_qties}</span>

<span class="ajax_cart_product_txt_s" {if $cart_qties <= 1}style="display:none"{/if}>{l s='products'}</span>

<span class="ajax_cart_product_txt" {if $cart_qties > 1}style="display:none"{/if}>{l s='product'}</span>

<span class="ajax_cart_total" {if $cart_qties <= 0}style="display:none"{/if}>{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false)}{else}{convertPrice price=$cart->getOrderTotal(true)}{/if}</span>

<span class="ajax_cart_no_product" {if $cart_qties != 0}style="display:none"{/if}>{l s='(empty)'}</span>

</div>

<!-- block list of products -->

<div id="cart_block_list" class="{if isset($colapseExpandStatus) && $colapseExpandStatus eq 'expanded' || !$ajax_allowed || !isset($colapseExpandStatus)}expanded{else}collapsed{/if}">

{if $products}

<dl class="products">

{foreach from=$products item='product' name='myLoop'}

{assign var='productId' value=$product.id_product}

{assign var='productAttributeId' value=$product.id_product_attribute}

<dt id="cart_block_product_{$product.id_product}{if $product.id_product_attribute}_{$product.id_product_attribute}{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">

<a class="cart_block_product_name" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}" title="{$product.name|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small')}" alt="{$product.name|escape:html:'UTF-8'}" /></a>

<span class="quantity-formated"><span class="quantity">{$product.cart_quantity}</span>x</span>

<a class="cart_block_product_name" href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}" title="{$product.name|escape:html:'UTF-8'}">{t text=$product.name length='10' encode='true'}</a>

<span class="remove_link">{if !isset($customizedDatas.$productId.$productAttributeId)}<a rel="nofollow" class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart.php')}?delete&id_product={$product.id_product}&ipa={$product.id_product_attribute}&token={$static_token}" title="{l s='remove this product from my cart'}"> </a>{/if}</span>

<span class="price">{if $priceDisplay == $smarty.const.PS_TAX_EXC}{displayWtPrice p="`$product.total`"}{else}{displayWtPrice p="`$product.total_wt`"}{/if}</span>

</dt>

{if isset($product.attributes_small)}

<dd id="cart_block_combination_of_{$product.id_product}{if $product.id_product_attribute}_{$product.id_product_attribute}{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">

<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}" title="{l s='Product detail'}">{$product.attributes_small}</a>

{/if}

 

<!-- Customizable datas -->

{if isset($customizedDatas.$productId.$productAttributeId)}

{if !isset($product.attributes_small)}<dd id="cart_block_combination_of_{$product.id_product}{if $product.id_product_attribute}_{$product.id_product_attribute}{/if}" class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}">{/if}

<ul class="cart_block_customizations" id="customization_{$productId}_{$productAttributeId}">

{foreach from=$customizedDatas.$productId.$productAttributeId key='id_customization' item='customization' name='customizations'}

<li name="customization">

<div class="deleteCustomizableProduct" id="deleteCustomizableProduct_{$id_customization|intval}_{$product.id_product|intval}_{$product.id_product_attribute|intval}"><a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart.php')}?delete&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_customization={$id_customization}&token={$static_token}"> </a></div>

<span class="quantity-formated"><span class="quantity">{$customization.quantity}</span>x</span>{if isset($customization.datas.$CUSTOMIZE_TEXTFIELD.0)}{t text=$customization.datas.$CUSTOMIZE_TEXTFIELD.0.value|replace:"<br />":" " length='28' encode='true'}

{else}

{l s='Customization #'}{$id_customization|intval}{l s=':'}

{/if}

</li>

{/foreach}

</ul>

{if !isset($product.attributes_small)}</dd>{/if}

{/if}

 

{if isset($product.attributes_small)}</dd>{/if}

 

{/foreach}

</dl>

{/if}

<p {if $products}class="hidden"{/if} id="cart_block_no_products">{l s='No products'}</p>

 

{if $discounts|@count > 0}<table id="vouchers">

<tbody>

{foreach from=$discounts item=discount}

<tr class="bloc_cart_voucher" id="bloc_cart_voucher_{$discount.id_discount}">

<td class="name" title="{$discount.description}">{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|escape:'htmlall':'UTF-8'}</td>

<td class="price">-{if $discount.value_real != '!'}{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if}{/if}</td>

<td class="delete"><a href="{$link->getPageLink("$order_process.php", true)}?deleteDiscount={$discount.id_discount}" title="{l s='Delete'}"><img src="{$img_dir}icon/delete.gif" alt="{l s='Delete'}" width="11" height="13" class="icon" /></a></td>

</tr>

{/foreach}

</tbody>

</table>

{/if}

 

<p id="cart-prices">

<span>{l s='Shipping'}</span>

<span id="cart_block_shipping_cost" class="price ajax_cart_shipping_cost">{$shipping_cost}</span>

<br/>

{if $show_wrapping}

{assign var='blockcart_cart_flag' value='Cart::ONLY_WRAPPING'|constant}

<span>{l s='Wrapping'}</span>

<span id="cart_block_wrapping_cost" class="price cart_block_wrapping_cost">{if $priceDisplay == 1}{convertPrice price=$cart->getOrderTotal(false, $blockcart_cart_flag)}{else}{convertPrice price=$cart->getOrderTotal(true, $blockcart_cart_flag)}{/if}</span>

<br/>

{/if}

{if $show_tax && isset($tax_cost)}

<span>{l s='Tax'}</span>

<span id="cart_block_tax_cost" class="price ajax_cart_tax_cost">{$tax_cost}</span>

<br/>

{/if}

<span>{l s='Total'}</span>

<span id="cart_block_total" class="price ajax_block_cart_total">{$total}</span>

</p>

{if $use_taxes && $display_tax_label == 1}

{if $priceDisplay == 0}

<p id="cart-price-precisions">

{l s='Prices are tax included'}

</p>

{/if}

{if $priceDisplay == 1}

<p id="cart-price-precisions">

{l s='Prices are tax excluded'}

</p>

{/if}

{/if}

<p id="cart-buttons">

{if $order_process == 'order'}<a href="{$link->getPageLink("$order_process.php", true)}" class="button_small" title="{l s='Cart'}">{l s='Cart'}</a>{/if}

<a href="{$link->getPageLink("$order_process.php", true)}{if $order_process == 'order'}?step=1{/if}" id="button_order_cart" class="exclusive{if $order_process == 'order-opc'}_large{/if}" title="{l s='Check out'}">{l s='Check out'}</a>

</p>

</div>

</div>

</div>

<!-- /MODULE Block cart -->

 

 

 

 

</div>

{/if}

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...