bigdesign Posted September 25, 2013 Share Posted September 25, 2013 Hello How can ad text "Start from" Price on products that have attributes on product-list.tpl ? Ex: if a product has multiple prices option - Price from: 100$ Thanks. 1 Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted September 26, 2013 Share Posted September 26, 2013 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 More sharing options...
bigdesign Posted September 26, 2013 Author Share Posted September 26, 2013 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 More sharing options...
PascalVG Posted September 26, 2013 Share Posted September 26, 2013 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 More sharing options...
vetconcept Posted October 8, 2013 Share Posted October 8, 2013 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 More sharing options...
pansedo Posted November 28, 2013 Share Posted November 28, 2013 I'm interest with this Topic, cos i want add text "From" in front of Price Product. Like the picture that i've attachedSomeone can help this Topic to change product-list.tpl ??? Just add Text "From " in front of '$ 75.00' / '$ 85.00'Thanks Pansedo. 1 Link to comment Share on other sites More sharing options...
PascalVG Posted December 3, 2013 Share Posted December 3, 2013 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 More sharing options...
pansedo Posted December 6, 2013 Share Posted December 6, 2013 (edited) 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 December 6, 2013 by pansedo (see edit history) Link to comment Share on other sites More sharing options...
oracle178 Posted April 14, 2014 Share Posted April 14, 2014 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 1 Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 30, 2017 Share Posted October 30, 2017 (edited) Maybe someone will find it usefull - it is for 1.6 and this solution works -> Just giving answer here because it is high in Google SERPS when asked about this. Edited October 30, 2017 by hakeryk2 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now