how to pass the variable product.tpl or modal.tpl in in prestashoap 1.7 - prestashop

I have a problem that I can not solve. in prestashop 1.7 I have a tpl file called product.tpl where inside, besides the various data, I call a file with the following code:
`{block name='product_variants'}
{include file='catalog/_partials/product-variants.tpl'}
{/block}
{block name='product_miniature_item'}
<article class="product-miniature js-product-miniature" data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}" itemscope itemtype="http://schema.org/Product">
<div class="thumbnail-container">
{block name='product_thumbnail'}
<a href="{$product.url}" class="thumbnail product-thumbnail">
<img
src = "{$product.cover.bySize.home_default.url}"
alt = "{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}"
data-full-size-image-url = "{$product.cover.large.url}"
>
</a>
{/block}
<div class="product-description">
{block name='product_name'}
<h1 class="h3 product-title" itemprop="name">{$product.name|truncate:30:'...'}</h1>
{/block}
{block name='product_price_and_shipping'}
{if $product.show_price}
<div class="product-price-and-shipping">
{if $product.has_discount}
{hook h='displayProductPriceBlock' product=$product type="old_price"}
<span class="sr-only">{l s='Regular price' d='Shop.Theme.Catalog'}</span>
<span class="regular-price">{$product.regular_price}</span>
{if $product.discount_type === 'percentage'}
<span class="discount-percentage">{$product.discount_percentage}</span>
{/if}
{/if}
{hook h='displayProductPriceBlock' product=$product type="before_price"}
<span class="sr-only">{l s='Price' d='Shop.Theme.Catalog'}</span>
<span itemprop="price" class="price">{$product.price}</span>
{hook h='displayProductPriceBlock' product=$product type='unit_price'}
{hook h='displayProductPriceBlock' product=$product type='weight'}
<div class="add">
<form action="{$urls.pages.cart}" method="post">
<input type="hidden" value="{$product.id_product}" name="id_product">
<!--<input type="number" style="padding: 3px 13px; float:left; width:30%; margin-left: 10px;" class="input-group form-control" name="qty" min="1" value="1">-->
<a style="cursor: pointer; padding: 3px 13px; margin-left: 10px; background: #ff9600; color: #fff;" data-button-action="add-to-cart" class="addtocart-btn"
{if !$product.add_to_cart_url}
disabled
{/if}>
<i class="material-icons shopping-cart"></i>
{l s='Add' d='Shop.Theme.Actions'}
<a href="{$product.url}" style=" padding: 3px 13px; margin-left: 10px;" class="view-dtls-btn">
{if {$language.iso_code} === 'ar'}
{l s='رأي' d='Shop.Theme.Actions'}
{else}
{l s='View' d='Shop.Theme.Actions'}
{/if}
</a>
</form>
</div>
</div>
{/if}
{/block}
{block name='product_reviews'}
{hook h='displayProductListReviews' product=$product}
{/block}
</div>
{block name='product_flags'}
<ul class="product-flags">
{foreach from=$product.flags item=flag}
<li class="product-flag {$flag.type}">{$flag.label}</li>
{/foreach}
</ul>
{/block}
<div class="highlighted-informations{if !$product.main_variants} no-variants{/if} hidden-sm-down">
{block name='quick_view'}
<a class="quick-view" href="#" data-link-action="quickview">
<i class="material-icons search"></i> {l s='Quick view' d='Shop.Theme.Actions'}
</a>
{/block}
{block name='product_variants'}
{if $product.main_variants}
{include file='catalog/_partials/variant-links.tpl' variants=$product.main_variants}
{/if}
{/block}
</div>
</div>
</article>
{/block}`
and everything works correctly.
what interests me most specifically is the portion of code referred to in this block
{block name='product_variants'}
{include file='catalog/_partials/product-variants.tpl'}
{/block}
The code is:
`<div class="product-variants">
{foreach from=$groups key=id_attribute_group item=group}
<div class="clearfix product-variants-item">
<span class="control-label">{$group.name}</span>
{if $group.group_type == 'select'}
<select
class="form-control form-control-select"
id="group_{$id_attribute_group}"
data-product-attribute="{$id_attribute_group}"
name="group[{$id_attribute_group}]">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selected} selected="selected"{/if}>{$group_attribute.name}</option>
{/foreach}
</select>
{elseif $group.group_type == 'color'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li class="float-xs-left input-container">
<label>
<input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span
{if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if}
{if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if}
><span class="sr-only">{$group_attribute.name}</span></span>
</label>
</li>
{/foreach}
</ul>
{elseif $group.group_type == 'radio'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li class="input-container float-xs-left">
<label>
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span class="radio-label">{$group_attribute.name}</span>
</label>
</li>
{/foreach}
</ul>
{/if}
</div>
{/foreach}
</div>`
then I modified the tpl file of the module product.tpl and modal.tpl and inside the main file "product.tpl and modal.tpl", inside the foreach I inserted a part of the code to display the variants and some product html design.
what happens is that I visualize perfectly the formatting but all the values ​​of the variants do not let me see them, specifically this portion of code does not work`<div class="product-variants">
{foreach from=$groups key=id_attribute_group item=group}
<div class="clearfix product-variants-item">
<span class="control-label">{$group.name}</span>
{if $group.group_type == 'select'}
<select
class="form-control form-control-select"
id="group_{$id_attribute_group}"
data-product-attribute="{$id_attribute_group}"
name="group[{$id_attribute_group}]">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selected} selected="selected"{/if}>{$group_attribute.name}</option>
{/foreach}
</select>
{elseif $group.group_type == 'color'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li class="float-xs-left input-container">
<label>
<input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span
{if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if}
{if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if}
><span class="sr-only">{$group_attribute.name}</span></span>
</label>
</li>
{/foreach}
</ul>
{elseif $group.group_type == 'radio'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li class="input-container float-xs-left">
<label>
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span class="radio-label">{$group_attribute.name}</span>
</label>
</li>
{/foreach}
</ul>
{/if}
</div>
{/foreach}
</div>`
Obviously the same code in the product page recalls all the variables, while in the home where I recall the contents on the homepage I can not recover them. Where am I wrong? I put hands on prestashop only a few weeks ago and I think I have a confused ideas. I hope little I have been clear, thanks to those who have the patience to answer.
or optional we want to pass the $groups variable in modal.tpl inside ps_shoppingcart please help me..
thnx in advance

Related

WHMCS Changing <select> input to multiple boxes

https://prnt.sc/vo986i - this is the default select dropdown menu that WHMCS provides.
https://prnt.sc/vo98m5 - this is the design I made in Figma.
I don't often work with WHMCS, I want to keep the functionality and just make it a multiple boxes choice rather than a dropdown.
{if $pricing.type eq "recurring"}
<div class="field-container">
<div class="form-group">
<label for="inputBillingcycle">{$LANG.cartchoosecycle}</label>
<select name="billingcycle" id="inputBillingcycle" class="form-control select-inline" onchange="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}">
{if $pricing.monthly}
<option value="monthly"{if $billingcycle eq "monthly"} selected{/if}>
{$pricing.monthly}
</option>
{/if}
{if $pricing.quarterly}
<option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}>
{$pricing.quarterly}
</option>
{/if}
{if $pricing.semiannually}
<option value="semiannually"{if $billingcycle eq "semiannually"} selected{/if}>
{$pricing.semiannually}
</option>
{/if}
{if $pricing.annually}
<option value="annually"{if $billingcycle eq "annually"} selected{/if}>
{$pricing.annually}
</option>
{/if}
{if $pricing.biennially}
<option value="biennially"{if $billingcycle eq "biennially"} selected{/if}>
{$pricing.biennially}
</option>
{/if}
{if $pricing.triennially}
<option value="triennially"{if $billingcycle eq "triennially"} selected{/if}>
{$pricing.triennially}
</option>
{/if}
</select>
</div>
</div>
{/if}
This is the code that WHMCS provides for the default billing cycle choice.
Thanks
Give this a go, it should work, changed the option values to radio boxes and stripped out the select box.
You will need to add your own classes for the design.
<div class="field-container">
<div class="form-group">
<label for="inputBillingcycle">{$LANG.cartchoosecycle}</label>
{if $pricing.monthly}
<input onclick="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}" type="radio" id="monthly" name="billingcycle" value="monthly"> {$pricing.monthly}
{/if}
{if $pricing.quarterly}
<input onclick="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}" type="radio" id="quarterly" name="billingcycle" value="quarterly"> {$pricing.quarterly}
{/if}
{if $pricing.semiannually}
<input onclick="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}" type="radio" id="semiannually" name="billingcycle" value="semiannually"> {$pricing.semiannually}
{/if}
{if $pricing.annually}
<input onclick="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}" type="radio" id="annually" name="billingcycle" value="annually"> {$pricing.annually}
{/if}
{if $pricing.biennially}
<input onclick="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}" type="radio" id="biennially" name="billingcycle" value="biennially"> {$pricing.biennially}
{/if}
{if $pricing.triennially}
<input onclick="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}" type="radio" id="biennially" name="billingcycle" value="biennially"> {$pricing.triennially}
{/if}
</div>
</div>
{/if}```

Display product availability on Prestashop 1.7.6 cart

I use Prestashop 1.7.6
I need to display the product availability on each product detail on Cart.
What have i to add to the cart-detailed-product-line.tpl and/or other files?
Try with:
{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">
{if ($product.allow_oosp || $product.quantity > 0)}
<span class="{if $product.quantity <= 0 && !$product.allow_oosp}out-of-stock{else}available-now{/if}">
<link itemprop="availability" href="http://schema.org/InStock" />{if $product.quantity <= 0}{if $product.allow_oosp}{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='In Stock'}{/if}{else}{l s='Out of stock'}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
</span>
{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
<span class="available-dif">
<link itemprop="availability" href="http://schema.org/LimitedAvailability" />{l s='Product available with different options'}
</span>
{else}
<span class="out-of-stock">
<link itemprop="availability" href="http://schema.org/OutOfStock" />{l s='Out of stock'}
</span>
{/if}
</span>
{/if}
{/if}
Add it where you want to display this information.
**UPDATE*
Try with this code:
<div class="product-line-grid">
<!-- product left content: image-->
<div class="product-line-grid-left col-md-3 col-xs-3">
<span class="product-image media-middle">
<img src="{$product.cover.bySize.cart_default.url}" alt="{$product.name|escape:'quotes'}">
</span>
</div>
<!-- product left body: description -->
<div class="product-line-grid-body col-md-4 col-xs-6">
<div class="product-line-info">
<a class="label" href="{$product.url}" data-id_customization="{$product.id_customization|intval}">{$product.name}</a>
</div>
<div class="product-line-info product-price h5 {if $product.has_discount}has-discount{/if}">
{if $product.has_discount}
<div class="product-discount">
<span class="regular-price">{$product.regular_price}</span>
<!--{if $product.discount_type === 'percentage'}
<span class="discount discount-percentage">
-{$product.discount_percentage_absolute}
</span>
{else}
<span class="discount discount-amount">
-{$product.discount_to_display}
</span>
{/if}-->
</div>
{/if}
<!--<div class="current-price">
<span class="price">{$product.price}</span>
{if $product.unit_price_full}
<div class="unit-price-cart">{$product.unit_price_full}</div>
{/if}
</div>-->
{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">
{if ($product.allow_oosp || $product.quantity > 0)}
<span class="{if $product.quantity <= 0 && !$product.allow_oosp}out-of-stock{else}available-now{/if}">
<link itemprop="availability" href="http://schema.org/InStock" />{if $product.quantity <= 0}{if $product.allow_oosp}{if isset($product.available_later) && $product.available_later}{$product.available_later}{else}{l s='In Stock'}{/if}{else}{l s='Out of stock'}{/if}{else}{if isset($product.available_now) && $product.available_now}{$product.available_now}{else}{l s='In Stock'}{/if}{/if}
</span>
{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
<span class="available-dif">
<link itemprop="availability" href="http://schema.org/LimitedAvailability" />{l s='Product available with different options'}
</span>
{else}
<span class="out-of-stock">
<link itemprop="availability" href="http://schema.org/OutOfStock" />{l s='Out of stock'}
</span>
{/if}
</span>
{/if}
{/if}
</div>
<br/>
{foreach from=$product.attributes key="attribute" item="value"}
<div class="product-line-info">
<span class="label">{$attribute}:</span>
<span class="value">{$value}</span>
</div>
{/foreach}
<div class="col-md-2 col-xs-6 text-xs-right delete">
<div class="cart-line-product-actions">
<a
class = "remove-from-cart"
rel = "nofollow"
href = "{$product.remove_from_cart_url}"
data-link-action = "delete-from-cart"
data-id-product = "{$product.id_product|escape:'javascript'}"
data-id-product-attribute = "{$product.id_product_attribute|escape:'javascript'}"
data-id-customization = "{$product.id_customization|escape:'javascript'}"
>
{if !isset($product.is_gift) || !$product.is_gift}
<span class="float-xs-left"><!--<i class="material-icons">delete_forever</i>-->Rimuovi</span>
{/if}
</a>
{block name='hook_cart_extra_product_actions'}
{hook h='displayCartExtraProductActions' product=$product}
{/block}
</div>
</div>
{if is_array($product.customizations) && $product.customizations|count}
<br>
{block name='cart_detailed_product_line_customization'}
{foreach from=$product.customizations item="customization"}
{l s='Product customization' d='Shop.Theme.Catalog'}
<div class="modal fade customization-modal" id="product-customizations-modal-{$customization.id_customization}" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">{l s='Product customization' d='Shop.Theme.Catalog'}</h4>
</div>
<div class="modal-body">
{foreach from=$customization.fields item="field"}
<div class="product-customization-line row">
<div class="col-sm-3 col-xs-4 label">
{$field.label}
</div>
<div class="col-sm-9 col-xs-8 value">
{if $field.type == 'text'}
{if (int)$field.id_module}
{$field.text nofilter}
{else}
{$field.text}
{/if}
{elseif $field.type == 'image'}
<img src="{$field.image.small.url}">
{/if}
</div>
</div>
{/foreach}
</div>
</div>
</div>
</div>
{/foreach}
{/block}
{/if}
</div>
<!-- product left body: description -->
<div class="product-line-grid-right product-line-actions col-md-5 col-xs-3">
<div class="row">
<!--<div class="col-xs-4 hidden-md-up"></div>-->
<div class="col-md-10 col-xs-12">
<div class="row">
<div class="col-md-6 col-xs-12 price">
<span class="product-price">
<strong>
{if isset($product.is_gift) && $product.is_gift}
<span class="gift">{l s='Gift' d='Shop.Theme.Checkout'}</span>
{else}
{$product.total}
{/if}
</strong>
</span>
</div>
<div class="col-md-6 col-xs-12 qty">
{if isset($product.is_gift) && $product.is_gift}
<span class="gift-quantity">{$product.quantity}</span>
{else}
<input
class="js-cart-line-product-quantity"
data-down-url="{$product.down_quantity_url}"
data-up-url="{$product.up_quantity_url}"
data-update-url="{$product.update_quantity_url}"
data-product-id="{$product.id_product}"
type="number"
value="{$product.quantity}"
name="product-quantity-spin"
min="{$product.minimal_quantity}"
/>
{/if}
</div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>

"un-group" Product Features

In product-details.tpl the features, when grouped, are printed inside a single
For example:
<dl>
<dt>FEATURE</dt>
<dd>Value1 Value2 Value3</dd>
</dl>
I want to print the following:
Code:
<dl>
<dt>FEATURE</dt>
<dd>
<span title="value1">Value1</span>
<span title="value2">Value2</span>
<span title="value2">Value3</span>
</dd>
</dl>
This is the original code
{block name='product_features'}
{if $product.grouped_features}
<section>
<h3>{l s='Data sheet' d='Shop.Theme.Catalog'}</h3>
<dl>
{foreach from=$product.grouped_features item=feature}
<dt>{$feature.name}</dt>
<dd>{$feature.value|escape:'htmlall'|nl2br nofilter}</dd>
{/foreach}
</dl>
</section>
{/if}
{/block}
I tried
{if $product.grouped_features}
<section>
<h3>{l s='Data sheet' d='Shop.Theme.Catalog'}</h3>
<dl>
{foreach from=$product.grouped_features item=feature}
<dt>{$feature.name}</dt>
<dd>{foreach $feature.value}<span title="{$feature.value|replace:' ':'_'}">{$feature.value|escape:'htmlall'|nl2br nofilter}</span>{/foreach}</dd>
{/foreach}
</dl>
</section>
{/if}
But of course doesn't work..
Most grateful for any help possible.
Thank you
Try with:
{block name='product_features'}
{if $product.grouped_features}
<section>
<h3>{l s='Data sheet' d='Shop.Theme.Catalog'}</h3>
<dl>
{foreach from=$product.grouped_features item=feature}
<dt>{$feature.name}</dt>
{assign var=detail_feature value="<br />"|explode:$feature.value}
<dd>
{foreach from=$detail_feature item=det_feature}
<span title="{$det_feature|escape:'htmlall'|nl2br nofilter}">{$det_feature|escape:'htmlall'|nl2br nofilter}</span>
{/foreach}
</dd>
{/foreach}
</dl>
</section>
{/if}
{/block}

Prestashop 1.7 template not pass variable

I have a problem that I can not solve.
in prestashop 1.7 I have a tpl file called product.tpl where inside, besides the various data, I call a file with the following code:
<div class="product-actions">
{block name='product_buy'}
<form action="{$urls.pages.cart}" method="post" id="add-to-cart-or-refresh">
<input type="hidden" name="token" value="{$static_token}">
<input type="hidden" name="id_product" value="{$product.id}" id="product_page_product_id">
<input type="hidden" name="id_customization" value="{$product.customization_id}" id="product_customization_id">
{block name='product_variants'}
{include file='catalog/_partials/product-variants.tpl'}
{/block}
{block name='product_pack'}
{if $packItems}
<section class="product-pack">
<h3 class="h4">{l s='This pack contains' d='Shop.Theme.Catalog'}</h3>
{foreach from=$packItems item="product_pack"}
{block name='product_miniature'}
{include file='catalog/_partials/miniatures/pack-product.tpl' product=$product_pack}
{/block}
{/foreach}
</section>
{/if}
{/block}
{block name='product_discounts'}
{include file='catalog/_partials/product-discounts.tpl'}
{/block}
{block name='product_add_to_cart'}
{include file='catalog/_partials/product-add-to-cart.tpl'}
{/block}
{block name='product_additional_info'}
{include file='catalog/_partials/product-additional-info.tpl'}
{/block}
{block name='product_refresh'}
<input class="product-refresh ps-hidden-by-js" name="refresh" type="submit" value="{l s='Refresh' d='Shop.Theme.Actions'}">
{/block}
</form>
{/block}
</div>
and everything works correctly.
what interests me most specifically is the portion of code referred to in this block
{block name='product_variants'}
{include file='catalog/_partials/product-variants.tpl'}
{/block}
The code is:
<div class="product-variants">
{foreach from=$groups key=id_attribute_group item=group}
<div class="clearfix product-variants-item">
<span class="control-label">{$group.name}</span>
{if $group.group_type == 'select'}
<select
class="form-control form-control-select"
id="group_{$id_attribute_group}"
data-product-attribute="{$id_attribute_group}"
name="group[{$id_attribute_group}]">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selected} selected="selected"{/if}>{$group_attribute.name}</option>
{/foreach}
</select>
{elseif $group.group_type == 'color'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li class="float-xs-left input-container">
<label>
<input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span
{if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if}
{if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if}
><span class="sr-only">{$group_attribute.name}</span></span>
</label>
</li>
{/foreach}
</ul>
{elseif $group.group_type == 'radio'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li class="input-container float-xs-left">
<label>
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span class="radio-label">{$group_attribute.name}</span>
</label>
</li>
{/foreach}
</ul>
{/if}
</div>
{/foreach}
</div>
then I modified the tpl file of the module ps_featuredproducts and inside the main file "ps_featuredproducts.tpl", inside the foreach I inserted a part of the code to display the variants and some product html design.
what happens is that I visualize perfectly the formatting but all the values ​​of the variants do not let me see them, specifically this portion of code does not work
<div class="product-variants">
{foreach from=$groups key=id_attribute_group item=group}
<div class="clearfix product-variants-item">
<span class="control-label">{$group.name}</span>
{if $group.group_type == 'select'}
<select
class="form-control form-control-select"
id="group_{$id_attribute_group}"
data-product-attribute="{$id_attribute_group}"
name="group[{$id_attribute_group}]">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selected} selected="selected"{/if}>{$group_attribute.name}</option>
{/foreach}
</select>
{elseif $group.group_type == 'color'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li class="float-xs-left input-container">
<label>
<input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span
{if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if}
{if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if}
><span class="sr-only">{$group_attribute.name}</span></span>
</label>
</li>
{/foreach}
</ul>
{elseif $group.group_type == 'radio'}
<ul id="group_{$id_attribute_group}">
{foreach from=$group.attributes key=id_attribute item=group_attribute}
<li class="input-container float-xs-left">
<label>
<input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}>
<span class="radio-label">{$group_attribute.name}</span>
</label>
</li>
{/foreach}
</ul>
{/if}
</div>
{/foreach}
</div>
Obviously the same code in the product page recalls all the variables, while in the home where I recall the contents on the homepage I can not recover them. Where am I wrong? I put hands on prestashop only a few weeks ago and I think I have a confused ideas.
I hope little I have been clear, thanks to those who have the patience to answer.
The variable $groups does not exist in ps_featuredproducts. You have to add it to the module if you want to use it on your home page.
In order to do that, you have to modify function getWidgetVariables() in ps_featuredproducts.php like this.
public function getWidgetVariables($hookName = null, array $configuration = [])
{
$products = $this->getProducts();
foreach ($products as &$product) {
$product_object = new Product((int)$product['id_product']);
$groups = array();
$attributes_groups = $product_object->getAttributesGroups($this->context->language->id);
if (is_array($attributes_groups) && $attributes_groups) {
foreach ($attributes_groups as $k => $row) {
if (!isset($groups[$row['id_attribute_group']])) {
$groups[$row['id_attribute_group']] = array(
'group_name' => $row['group_name'],
'name' => $row['public_group_name'],
'group_type' => $row['group_type'],
'default' => -1,
);
}
$groups[$row['id_attribute_group']]['attributes'][$row['id_attribute']] = array(
'name' => $row['attribute_name'],
'html_color_code' => $row['attribute_color'],
'texture' => (#filemtime(_PS_COL_IMG_DIR_.$row['id_attribute'].'.jpg')) ? _THEME_COL_DIR_.$row['id_attribute'].'.jpg' : '',
'selected' => (isset($product_for_template['attributes'][$row['id_attribute_group']]['id_attribute']) && $product_for_template['attributes'][$row['id_attribute_group']]['id_attribute'] == $row['id_attribute']) ? true : false,
);
if ($row['default_on'] && $groups[$row['id_attribute_group']]['default'] == -1) {
$groups[$row['id_attribute_group']]['default'] = (int) $row['id_attribute'];
}
if (!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) {
$groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0;
}
$groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] += (int) $row['quantity'];
}
// wash attributes list (if some attributes are unavailables and if allowed to wash it)
if (!Product::isAvailableWhenOutOfStock($product_object->out_of_stock) && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) {
foreach ($groups as &$group) {
foreach ($group['attributes_quantity'] as $key => &$quantity) {
if ($quantity <= 0) {
unset($group['attributes'][$key]);
}
}
}
}
}
$product['groups'] = $groups;
}
if (!empty($products)) {
return array(
'products' => $products,
'allProductsLink' => Context::getContext()->link->getCategoryLink($this->getConfigFieldsValues()['HOME_FEATURED_CAT']),
);
}
return false;
}
I am using here a part of the code from the function ProductController::assignAttributesGroups() to get only $groups variable.
Finally, in ps_featuredproducts.tpl, you have to replace:
<div class="product-variants">
{foreach from=$groups key=id_attribute_group item=group}
<div class="clearfix product-variants-item">
By:
<div class="product-variants">
{foreach from=$product.groups key=id_attribute_group item=group}
<div class="clearfix product-variants-item">
And then, all variables will be displayed like on product page.
The variable $groups that is used in catalog/_partials/product-variants.tpl is passed from PoductController.php and is available only on product info page. You cannot use it on your homepage or elsewhere. If you want to achieve the same result you need to create some similar variable within your module and pass it to your own template. The variable created in the file controller/front/ProductController.php within method assignAttributesGroups but it is pretty complicated I think you can create something much simpler.

recognize prestashop module issue

I have a little problem in prestashop, I can't locate and find the name of the module which allows to place on the product some text and choose it's font and the color.
I enclose the image of an example page with this module as well as link to the page itself.
http://europasaz.eu/tmp8/nappes/546-nappe-xxl-modele-ana-fond-gris-moyen-rayures-gris-clair-et-gris-anthracite-2x3m.html#.VliAuvkvfIX
Thank you very much in advance for your time and help. Mike
This is the product.tpl file
<div class="content">
<div class="row">
<section id="center_column" class="span12">
{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|floatval}{else}0{/if};
var specific_price = {if $product->specificPrice AND $product->specificPrice.price}{$product->specificPrice.price}{else}0{/if};
var product_specific_price = new Array();
{foreach from=$product->specificPrice key='key_specific_price' item='specific_price_value'}
product_specific_price['{$key_specific_price}'] = '{$specific_price_value}';
{/foreach}
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};
var stock_management = {$stock_management|intval};
{if !isset($priceDisplayPrecision)}
{assign var='priceDisplayPrecision' value=2}
{/if}
{if !$priceDisplay || $priceDisplay == 2}
{assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL, $priceDisplayPrecision)}
{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)}
{elseif $priceDisplay == 1}
{assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL, $priceDisplayPrecision)}
{assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)}
{/if}
var productPriceWithoutRedution = '{$productPriceWithoutRedution}';
var productPrice = '{$productPrice}';
// 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}
$(window).load(function() {
$('.ajax_add_to_cart_button').removeAttr('disabled');
$('.color_to_pick_list a[title=Noir]').click();
var dirty_bit = document.getElementById('page_is_dirty');
if (dirty_bit.value == '1') window.location.reload();
function mark_page_dirty() {
dirty_bit.value = '1';
}
mark_page_dirty();
$('.newPriceHolder').text($('#our_price_display').text());
$('#our_price_display').on('change',function(event){
$('.newPriceHolder').text($(this).text());
});
//console.log($(location).attr('hash'));
$('#image-block .new').text("{l s='Nouveau'}");
$('#image-block .on_sale').text("{l s='ON SALE'}");
$('#image-block .discount').text("{l s='DISCOUNT'}");
var firstClick=0;
$('#brodezfouta').click(function(event){
$('#brodezfouta').hide();
$('#annulerboderie').show();
$('#attributes1').slideDown();
if(firstClick==0)
{
$('#content-texte').slideUp();
$('#content-logo').slideUp();
$('.police_list').slideUp();
}
firstClick=1;
});
$('#annulerboderie').click(function(event){
$('#annulerboderie').hide();
$('#brodezfouta').show();
$('#attributes1').slideUp();
if($('#logo_monogramme').is(':checked'))
$('#logo_monogramme').click();
if($('#texte_monochrome').is(':checked'))
$('#texte_monochrome').click();
brodPrice = parseFloat(productPrice);
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
$('#content-texte').slideUp();
$('#content-logo').slideUp();
$('.police_list').slideUp();
});
$('textarea#texte_monochrome_value').on('input',function(){
$('#preview-text').html($('textarea#texte_monochrome_value').val() );
if(($('textarea#texte_monochrome_value').val().trim().length ==0) )
$('#preview-text').html('Aperçu');
});
if($('#preview-text') && $('#preview-text').html().trim().length==0)
$('#preview-text').html('Aperçu');
if(($('textarea#texte_monochrome_value').val() && $('textarea#texte_monochrome_value').val().trim().length >0) )
$('#preview-text').html($('textarea#texte_monochrome_value').val() );
/*document.getElementById("logo_img").onchange = function () {
document.getElementById("uploadFile").value = this.value;
}*/
$('#texte_monochrome').on('click',function(){
if($(this).is(':checked'))
{
$('#content-texte').slideDown();
$('.police_list').slideDown();
if($('#logo_monogramme').is(':checked'))
{
brodPrice = parseFloat(productPrice)+25;
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
}
else
{
brodPrice = parseFloat(productPrice)+10;
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
}
}
else
{
$('#content-texte').slideUp();
$('.police_list').slideUp();
if($('#logo_monogramme').is(':checked'))
{
brodPrice = parseFloat(productPrice)+15;
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
}
else
{
brodPrice = parseFloat(productPrice);
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
}
}
});
$('#logo_monogramme').on('click',function(){
if($(this).is(':checked'))
{
$('#content-logo').slideDown();
if($('#texte_monochrome').is(':checked'))
{
brodPrice = parseFloat(productPrice)+25;
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
}
else
{
brodPrice = parseFloat(productPrice)+15;
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
}
}
else
{
$('#content-logo').slideUp();
if($('#texte_monochrome').is(':checked'))
{
brodPrice = parseFloat(productPrice)+10;
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
}
else
{
brodPrice = parseFloat(productPrice);
$('.newPriceHolder').text(brodPrice.toFixed(2)+' €');
$('#our_price_display').text(brodPrice.toFixed(2)+' €');
}
}
});
$('#buy_block').on('submit',function(){
error_msg='';
if($('#logo_monogramme').is(':checked') && $('#uploadFile').val().trim().length==0)
error_msg+='<li>Choisir votre logo</li>';
if($('#texte_monochrome').is(':checked') && $('#texte_monochrome_value').val().trim().length==0)
error_msg+='<li>Saisir votre texte</li>';
if(error_msg)
{
alertMsg='<span style="color:#6666FF;">Vous avez choisi de boder votre fouta. Avant de continuer, veuillez : </span>';
bootbox.alert(alertMsg+'<ol>'+error_msg+'</ol>');
return false;
}
else
return true;
});
$('#content-logo').slideUp();
$('#content-texte').slideUp();
$('.police_list').slideUp();
});
</script>
<form name="ignore_me">
<input type="text" id="page_is_dirty" name="page_is_dirty" value="0" style="display:none" />
</form>
{literal}
<style>
.broderie6{position:absolute;left:-99999px;top:-99999px;}
.blink_me{color: red;font-size: 13px;float:right;padding-right: 85px;padding-top: 21px;}
</style>
{/literal}
{include file="$tpl_dir./breadcrumb.tpl"}
<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|escape:'htmlall':'UTF-8'}', 0, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
<input type="submit" value="{l s='Back'}" class="exclusive" onclick="submitPublishProduct('{$base_dir}{$smarty.get.ad|escape:'htmlall':'UTF-8'}', 1, '{$smarty.get.adtoken|escape:'htmlall':'UTF-8'}')"/>
</p>
<p id="admin-action-result"></p>
</p>
</div>
{/if}
{if isset($confirmation) && $confirmation}
<p class="confirmation">
{$confirmation}
</p>
{/if}
<div class="row">
<!-- right infos-->
<div id="pb-right-column" class="span6">
<!-- product img-->
<div id="image-block">
{if isset($product->on_sale) && $product->on_sale && isset($product->show_price) && $product->show_price && !$PS_CATALOG_MODE}<span class="on_sale">{l s='ON SALE'}{if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'}{/if}</span>
{elseif isset($product->specificPrice.reduction) && $product->specificPrice.reduction && isset($product->show_price) && $product->show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='ON SALE'}</span>
{elseif isset($product->new) && $product->new == 1}<span class="new">{l s='Nouveau'}</span>
{/if}
{if $have_image}
<span id="view_full_size" class="visible-desktop">
<img style="border: 1px solid #e3e3e3;
padding: 5px;
background: #fff;
margin: 0px 10px 0px 0px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;" src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')}" {if $jqZoomEnabled}class="jqzoom" alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic" />
<span class="span_link">{l s=''}</span>
</span>
<span id="view_full_size" class="hidden-desktop">
<img src="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'large_default')}" {if $jqZoomEnabled} alt="{$link->getImageLink($product->link_rewrite, $cover.id_image, 'thickbox_default')}"{else} title="{$product->name|escape:'htmlall':'UTF-8'}" alt="{$product->name|escape:'htmlall':'UTF-8'}" {/if} id="bigpic" />
<span class="span_link">{l s=''}</span>
</span>
{else}
<span id="view_full_size">
<img src="{$img_prod_dir}{$lang_iso}-default-large_default.jpg" id="bigpic" alt="" title="{$product->name|escape:'htmlall':'UTF-8'}" width="{$largeSize.width}" height="{$largeSize.height}" />
</span>
{/if}
</div>
{if isset($images) && count($images) > 0}
<!-- thumbnails -->
<div id="views_block" class="clearfix {if isset($images) && count($images) < 2}hidden{/if}">
{if isset($images) && count($images) > 4}<span class="view_scroll_spacer"><a id="view_scroll_left" class="shidden" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}"></a></span>{/if}
<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_default)}" 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_default')}" alt="{$image.legend|htmlspecialchars}" height="{$mediumSize.height}" width="{$mediumSize.width}" />
</a>
</li>
{/foreach}
{/if}
</ul>
</div>
{if isset($images) && count($images) > 4}<a id="view_scroll_right" title="{l s='Other views'}" href="javascript:{ldelim}{rdelim}"></a>{/if}
</div>
{/if}
{if isset($images) && count($images) > 1}<p class="resetimg clear"><span id="wrapResetImages" style="display: none;"><img src="{$img_dir}icon/cancel_11x13.gif" alt="{l s='Cancel'}" width="11" height="13"/> <a id="resetImages" href="{$link->getProductLink($product)}" onclick="$('span#wrapResetImages').hide('slow');return (false);">{l s='Display all pictures'}</a></span></p>{/if}
<!-- usefull links-->
<div class="additional">
<div class="row">
<div class="span6">
{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}
{$HOOK_PRODUCT_ACTIONS}
{/if}
<ul id="usefull_link_block">
{if $HOOK_EXTRA_LEFT}{$HOOK_EXTRA_LEFT}{/if}
<li class="print">{l s='Print'}<li>
{if $have_image && !$jqZoomEnabled}
{/if}
</ul>
</div>
</div>
</div>
</div>
<!-- left infos-->
<div id="pb-left-column" class="span6">
<div class="row">
<div class="span6">
<h1>{$product->name|escape:'htmlall':'UTF-8'}</h1>
{if $product->reference}
<h6>{l s='Reference: '} {$product->reference|escape:'htmlall':'UTF-8'}</h6>
{else}
{/if}
{if $product->manufacturer_name} <span class="manufacturername"><label for="manufacturer_name">{l s='Manufacturer :'} </label>{$product->manufacturer_name|escape:'htmlall':'UTF-8'}
</span>
{/if}
</div>
<div class="span2">
<span class="price newPriceHolder our_price_display" style="display:none;" ></span>
{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
{if isset($product->brode) && $product->brode==1}
<div class="span6">
<h1 style="top: 385px;
color: #b97a57!important;
label class="button" for="group_6_54" id="brodezfouta" style="display:block;float:right;margin-bottom:5px; "><span class="button" style="
margin-left: 15px;
position: absolute;
left: 50%;
display: block;
float: right;
margin-bottom: 5px;
top: 385px;
background-color: #b97a57!important;
width: 170px;
height: 16px;
text-align: center;
">Brodez votre fouta</span></label-->
<label class="button" for="group_6_55" id="annulerboderie" style="display:none;float:right;margin-bottom:5px; margin-right:-35px;"><span style="background-color:#b97a57!important;width:151px;" class="button">Annuler la broderie</span></label>
{/if}
{/if}
{$HOOK_PRODUCT_OOS}
</div>
</div>
{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
<form id="buy_block" style="margin-bottom:20px;" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart')}" method="post" enctype="multipart/form-data">
<div id="attributes1" style="margin-bottom:20px;">
<div class="brod-brief"><span>Délai de livraison</span><span style="color:red"> (7 jours ouvrés)</span> <br/>
Vous pouvez personnaliser votre fouta par l’ajout d’un logo, monogramme, prénom ou message à broder de votre choix.<br/>
Vous pouvez choisir votre couleur de fil et la police d’écriture.</br>
Si vous avez des questions, n'hésitez pas à demander</div>
<div class="broderie-container">
<div class="broderie-side-container">
<span class="header-side-broderie">
<input class="check_attrib" type="checkbox" name="texte_monochrome" value="1" id="texte_monochrome"><label for="texte_monochrome" style="cursor:pointer"><span></span>Ajoutez un texte</label><span style="color:red"> +10 €</span></span>
<div id="content-texte">
<label>Initiales / Nom / Prénom / Message à broder (max 20 car)</label>
<span class="text_monochrome_container"><textarea id="texte_monochrome_value" name="texte_monochrome_value" maxlength="20"></textarea></span>
<p id="preview-text"></p>
<label class="couleur-broderie">Couleur de la broderie :</label>
<ul class="clearfix color_to_pick_list"><li> <a class="color_pick" style="background: #000000;" title="Noir" onclick="changeColor('#000000');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #e67e30;" title="Abricot" onclick="changeColor('#e67e30');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #88421d;" title="Acajou" onclick="changeColor('#88421d');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #303030;" title="Anthracite" onclick="changeColor('#303030');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #cecece;" title="Gris argenté" onclick="changeColor('#cecece');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #c8ad7f;" title="Beige" onclick="changeColor('#c8ad7f');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #fefee2;" title="Blanc cassé" onclick="changeColor('#fefee2');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #77b5fe;" title="Bleu ciel" onclick="changeColor('#77b5fe');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #003366;" title="Bleu de minuit" onclick="changeColor('#003366');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #dff2ff;" title="Bleu dragée" onclick="changeColor('#dff2ff');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #6d071a;" title="Bordeaux" onclick="changeColor('#6d071a');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #de3163;" title="Cerise" onclick="changeColor('#de3163');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #e73e01;" title="Corail" onclick="changeColor('#e73e01');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #c72c48;" title="Framboise" onclick="changeColor('#c72c48');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #fd3f92;" title="Fuchsia" onclick="changeColor('#fd3f92');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #ee1010;" title="Garance" onclick="changeColor('#ee1010');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #606060;" title="Gris" onclick="changeColor('#606060');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #ffff00;" title="Jaune" onclick="changeColor('#ffff00');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #94812b;" title="Kaki" onclick="changeColor('#94812b');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #582900;" title="Marron" onclick="changeColor('#582900');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #955628;" title="Noisette" onclick="changeColor('#955628');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #ff7f00;" title="Orange" onclick="changeColor('#ff7f00');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #cfa0e9;" title="Parme" onclick="changeColor('#cfa0e9');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #bef574;" title="Pistache" onclick="changeColor('#bef574');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #fd6c9e;" title="Rose" onclick="changeColor('#fd6c9e');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #e32636;" title="Rouge" onclick="changeColor('#e32636');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #25fde9;" title="Turquoise" onclick="changeColor('#25fde9');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #b0f2b6;" title="Vert d'eau" onclick="changeColor('#b0f2b6');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #679f5a;" title="Vert " onclick="changeColor('#679f5a');colorPickerText(this);"> </a></li><li> <a class="color_pick" style="background: #7f00ff;" title="Violet" onclick="changeColor('#7f00ff');colorPickerText(this);"> </a></li></ul>
</div>
</div>
<!--div class="broderie-side-container">
<span class="header-side-broderie">
<input class="check_attrib" type="checkbox" name="logo_monogramme" value="1" id="logo_monogramme"><label for="logo_monogramme" style="cursor:pointer"><span></span>Ajoutez un logo</label><span style="color:red"> +15 €</span></span>
<div id="content-logo">
<label>Logo / Monogramme <span class="gris">(monochrome)</span> : GIF, JPG, PNG</label>
<span id="upload_logo"><span>Ajoutez logo</span><input type="file" name="logo_img" id="logo_img" accept="image/gif, image/jpeg, image/png" />
<input id="uploadFile" placeholder="Choisissez un logo" disabled="disabled" /></span>
<label class="couleur-broderie">Couleur du logo :</label>
<ul class="clearfix color_to_pick_list">
<li><a class="color_pick_logo" style="background: #000000;" title="Noir" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #e67e30;" title="Abricot" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #88421d;" title="Acajou" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #303030;" title="Anthracite" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #cecece;" title="Gris argenté" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #c8ad7f;" title="Beige" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #fefee2;" title="Blanc cassé" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #77b5fe;" title="Bleu ciel" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #003366;" title="Bleu de minuit" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #dff2ff;" title="Bleu dragée" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #6d071a;" title="Bordeaux" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #de3163;" title="Cerise" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #e73e01;" title="Corail" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #c72c48;" title="Framboise" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #fd3f92;" title="Fuchsia" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #ee1010;" title="Garance" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #606060;" title="Gris" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #ffff00;" title="Jaune" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #94812b;" title="Kaki" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #582900;" title="Marron" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #955628;" title="Noisette" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #ff7f00;" title="Orange" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #cfa0e9;" title="Parme" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #bef574;" title="Pistache" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #fd6c9e;" title="Rose" onclick="colorPickerLogo(this);"> </a></li>
<li> <a class="color_pick_logo" style="background: #e32636;" title="Rouge" onclick="colorPickerLogo(this);"> </a></li>