Jump to content

mise en page de pourcentage fixe


Recommended Posts

sur chaque produit, je veux mettre en % les réductions et elle ne s'affiche pas

voici le bout de code.

comment faire ?

 

                            <div class="right-block">
                                <h5 class="product-name">
                                    {if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}
                                    <a href="{$product.link|escape:'html'}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a>
                                </h5>
                                    <div class="pr-rt">
                                            {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
                                                 {if isset($FIELD_categoryShowAvgRating) && $FIELD_categoryShowAvgRating || !isset($FIELD_categoryShowAvgRating)}
                                                         {hook h='displayProductListReviews' product=$product}
                                                 {/if}
                                                <div class="content_price">
                                                        {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
                                                        {if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction}
                                                                        <span class="old-price product-price">
                                                                                {displayWtPrice p=$product.price_without_reduction}
                                                                        </span>
                                                                {/if}
                                                                <span class="price product-price">
                                                                        {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
                                                                </span>
                                {if $product.specific_prices.reduction_type == 'percentage'}
                                    <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span>
                                {/if}                                                              
                                                        {/if}
                                                </div>
                                            {/if}                                     
                                    </div>
                            </div>

Link to comment
Share on other sites

Avant la ligne 

{if $product.specific_prices.reduction_type == 'percentage'}
 <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span>
{/if}                                                              

Essayez : 

 

{$$product.specific_prices.reduction_type|print_r}

 

Pour un debug et voir ce qui en sort

Link to comment
Share on other sites

Avant la ligne 

{if $product.specific_prices.reduction_type == 'percentage'}
 <span class="price-percent-reduction">-{$product.specific_prices.reduction * 100}%</span>
{/if}                                                              

Essayez : 

 

{$product.specific_prices.reduction_type|print_r}

 

Pour un debug et voir ce qui en sort

Edited by Bakhouche Akram (see edit history)
Link to comment
Share on other sites

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