Jump to content

specificPrice


ruisonika

Recommended Posts

Hello developers,

I need some help, in my prestashop store i wanna make this:
In index page (homepage)

when i see all the products that are displayed 

i want to have an icon (that i've already created) but i want to show only when in the product page of the product (detail) has a table of price discount quantity

So the code shoul be something like this:

{hook h='displayProductListSwap' product=$product}
                {if isset($product.color_list)}
                <div class="color-list-container product-colors">{$product.color_list}</div>
                {/if}
                {if isset($product.new) && $product.new == 1}
                <span class="product-label new-box">
                    <span class="new-label">{l s='Novidade'}</span>
                </span>
                {/if}
                {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}
                    <span class="product-label sale-box">
                        <span class="sale-label">{l s='Promoção'}</span>
                    </span>
                {/if}    
                {if isset($product.specificPrice) && !PS_CATALOG_MODE}
                    <span class="product-label moreless-box" title="{l s='mais por menos'}">
                        <span class="moreless-label">{l s='+ por -'}</span>
                    </span>
                    
                {/if}

 

this piece of code above in bolder is my question, in product page the code is this (for the quantities specific price discount)
 

{if (isset($quantity_discounts) && count($quantity_discounts) > 0)}
<!-- quantity discount -->
<div id="quantityDiscount" class="page-product-box tab-pane fade">
<div id="quantityDiscount">
<table class="std table-product-discounts">
<thead>
<tr>
<th>{l s='Quantidade'}</th>
<th>{if $display_discount_price}{l s='Preço'}{else}{l s='Desconto'}{/if}</th>
<th>{l s='Poupas'}</th>
</tr>
</thead>
<tbody>
{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}
<tr id="quantityDiscount_{$quantity_discount.id_product_attribute}" class="quantityDiscount_{$quantity_discount.id_product_attribute}" data-discount-type="{$quantity_discount.reduction_type}" data-discount="{$quantity_discount.real_value|floatval}" data-discount-quantity="{$quantity_discount.quantity|intval}">
<td>
{$quantity_discount.quantity|intval}
</td>
<td>
{if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
{if $display_discount_price}
{if $quantity_discount.reduction_tax == 0 && !$quantity_discount.price}
{convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval}
{else}
{convertPrice price=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
{/if}
{else}
{convertPrice price=$quantity_discount.real_value|floatval}
{/if}
{else}
{if $display_discount_price}
{if $quantity_discount.reduction_tax == 0}
{convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction_with_tax)|floatval}
{else}
{convertPrice price = $productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
{/if}
{else}
{$quantity_discount.real_value|floatval}%
{/if}
{/if}
</td>
<td>
<span>{l s='Até'}</span>
{if $quantity_discount.price >= 0 || $quantity_discount.reduction_type == 'amount'}
{$discountPrice=$productPriceWithoutReduction|floatval-$quantity_discount.real_value|floatval}
{else}
{$discountPrice=$productPriceWithoutReduction|floatval-($productPriceWithoutReduction*$quantity_discount.reduction)|floatval}
{/if}
{$discountPrice=$discountPrice * $quantity_discount.quantity}
{$qtyProductPrice=$productPriceWithoutReduction|floatval * $quantity_discount.quantity}
{convertPrice price=$qtyProductPrice - $discountPrice}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
{/if}


ANY HELP?
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...