Jump to content

How to add "Price start from"


bigdesign

Recommended Posts

i really did it practically without sale

http://botqhomeneeds.com/demox/music-ipods/2-ipod-shuffle.html

with sale

http://botqhomeneeds.com/demox/home/8-this-is-an-example-of-long-title-that-wouldnt-overflow.html

need to add this line colored red

 

<p class="our_price_display">
                {if $priceDisplay >= 0 && $priceDisplay <= 2}
    {if $product->on_sale}<span class="price starts" style="font-size:13px;">{l s='starts from'}</span>{/if}
                    <span id="our_price_display">{convertPrice price=$productPrice}</span>
                    <!--{if $tax_enabled  && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))}
                        {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}
                    {/if}-->
                {/if}
                </p>

Link to comment
Share on other sites

Thanks for reply, but this is not o solution for me.

A product can have multiple prices without to be on sale.

 

A very good point to start is an option that prestashop has: Display the "add to cart" button when a product has attributes set to NO

 

I need this function inverse. if this option is enabled product that doesn't display "Add to cart" button to display custom text.

I can't figure out how can i do that.

Link to comment
Share on other sites

Probably walk though attributes of product (foreach..)

 

Something like: (very rough "pseudo code")

$from_price = $product.price;

$upto_price = $product.price;

foreach (product->getAttributeCombinations(...)  as $attribute) {

if ( $product.price +$attribute->unit_price_impact < $from_price)

 $from_price = $product.price +$attribute->unit_price_impact;

if ( $product.price +$attribute->unit_price_impact > $upto_price)

 $upto_price = $product.price +$attribute->unit_price_impact;

}

 

if (from_price = upto_price)

display "price ="...;

else

display "from .... (up to...)";

 

Very roughly...

 

pascal

Link to comment
Share on other sites

  • 2 weeks later...

I'm also interested in this. I want in product-list to show, at products with combinations, "from" in front of the price.

 

How can you check if the product has combinations in the product-list.tpl. I guess you only need to check if the product has combinations and if it has then put the word "from" in front. 

 

I'm still new to presta and i'm not sure how to acces that variable.

 

So far i've only put the word "from" in front of every price on pricelist view.

Link to comment
Share on other sites

  • 1 month later...

I'm interest with this Topic, cos i want add text "From" in front of Price Product.

Like the picture that i've attached

Someone can help this Topic to change product-list.tpl ???

 
Just add Text "From " in front of '$ 75.00' / '$ 85.00'

Thanks
Pansedo.

post-715367-0-15388800-1385628174_thumb.jpg

  • Like 1
Link to comment
Share on other sites

Hi Pansedo. Something like this:

			<div class="right_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!'}</span>
				{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced price!'}</span>{/if}
				{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
				<div class="content_price">
					{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">From: {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}
					{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if}
				</div>

Do you see it? I added 'From: ' in this line:

{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">From: {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}

 

hope that helps,

pascal

Link to comment
Share on other sites

Hi Pansedo. Something like this:

			<div class="right_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!'}</span>
				{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced price!'}</span>{/if}
				{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
				<div class="content_price">
					{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">From: {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}
					{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if}
				</div>

Do you see it? I added 'From: ' in this line:

{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">From: {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}

 

hope that helps,

pascal

 

Thank's pascal

I have update it before u replied it, but the Text don't Show.

 

After googling i found the solution.

Don't forget to delete all file in compile folder. The folder is located in 'tools/smarty/compile'.

After that go to your shop and 'ctrl + R' / refresh your Browser, Tadaaaaa the Text will display.

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

  • 4 months later...

maybe someone has a solution for PS v1.5.x, really need to display "from" before product price in products list, where not only are the combinations, but their prices are different. If product has several combinations, but their prices are the same, do not to display "from".

 

Thanks

  • Like 1
Link to comment
Share on other sites

  • 3 years 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...