karmelsc Posted April 26, 2015 Share Posted April 26, 2015 (edited) I want to display the unit price for each combination next to the attribute value. I've managed to get the correct placement but It only displays unit price for attribute selected. PrestaShop version 1.6.0.11 default template http://karmelcollections.com/clean-and-fresh/clean-cotton#/size-16oz_bottle Edited April 26, 2015 by karmelsc (see edit history) Link to comment Share on other sites More sharing options...
sandipchandela Posted April 27, 2015 Share Posted April 27, 2015 you want to display total of product price plus product attribute price or else? Thanks Link to comment Share on other sites More sharing options...
karmelsc Posted April 27, 2015 Author Share Posted April 27, 2015 In the pic I have the unit price to the right of the attribute value. Right now if you select attribute, the unit price changes for the 1oz value. I want to display static unit price next to attribute value Link to comment Share on other sites More sharing options...
sandipchandela Posted April 28, 2015 Share Posted April 28, 2015 In the pic I have the unit price to the right of the attribute value. Right now if you select attribute, the unit price changes for the 1oz value. I want to display static unit price next to attribute value you can any display price that you want to display. you can put following code any where in the product.tpl file. $product->price $product->wholesale_price $product->unit_price Link to comment Share on other sites More sharing options...
karmelsc Posted April 29, 2015 Author Share Posted April 29, 2015 I may not have explained this clearly. I have thousands of products to add that have a unit price and the unit price varies. I would like the unit price to display next to the attribute label. Right now the unit price is next to the attribute but its not the correct unit price for the attribute for that item. It looks like there is a loop in the product.tpl that gets the attribute value but i don't know enough to program the unit price in that loop. I have added the unit price to the attribute name to show what i'm trying to do. Link to comment Share on other sites More sharing options...
sandipchandela Posted April 29, 2015 Share Posted April 29, 2015 (edited) What kind of price you want to display on product page ? Like following way: product price : 10 Size 1oz: attribute : 5 unit price: 10+5 = 15 2oz: attribute : 7 unit price: 10+7 = 17 4oz: attribute : 9 unit price: 10+9 = 19 Edited April 29, 2015 by archSandy (see edit history) Link to comment Share on other sites More sharing options...
karmelsc Posted April 29, 2015 Author Share Posted April 29, 2015 If I set the unit per ounce in the product combination then it display Size 1oz: attribute : 2.99 unit price: 2.99÷1 = 2.99 2oz: attribute : 5 unit price: 5÷2 = 2.5 4oz: attribute : 9 unit price: 9÷4 = 2.25 If I set the unit price in product combination it shows the value I set but only for the radio button of the selected attribute. I want the product combination unit price to show for each attribute all the time. Link to comment Share on other sites More sharing options...
sandipchandela Posted April 29, 2015 Share Posted April 29, 2015 If I set the unit per ounce in the product combination then it display Size 1oz: attribute : 2.99 unit price: 2.99÷1 = 2.99 2oz: attribute : 5 unit price: 5÷2 = 2.5 4oz: attribute : 9 unit price: 9÷4 = 2.25 If I set the unit price in product combination it shows the value I set but only for the radio button of the selected attribute. I want the product combination unit price to show for each attribute all the time. Let me give some time to work. Link to comment Share on other sites More sharing options...
sandipchandela Posted April 30, 2015 Share Posted April 30, 2015 If I set the unit per ounce in the product combination then it display Size 1oz: attribute : 2.99 unit price: 2.99÷1 = 2.99 2oz: attribute : 5 unit price: 5÷2 = 2.5 4oz: attribute : 9 unit price: 9÷4 = 2.25 If I set the unit price in product combination it shows the value I set but only for the radio button of the selected attribute. I want the product combination unit price to show for each attribute all the time. 2.99/1 5/2 is what attribute size? You can't change price from the front end ? display in product.tpl following code and make a search for what you want to display? {$product@var_dump} Link to comment Share on other sites More sharing options...
karmelsc Posted May 1, 2015 Author Share Posted May 1, 2015 I don't understand what your asking Code in product.tplto display unit price {if !empty($product->unity) && $product->unit_price_ratio > 0.000000} {math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price} <p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'html':'UTF-8'}</p> {hook h="displayProductPriceBlock" product=$product type="unit_price"} {/if} what it does what I want it to do Link to comment Share on other sites More sharing options...
robbie007 Posted November 5, 2015 Share Posted November 5, 2015 I don't understand what your asking Code in product.tplto display unit price {if !empty($product->unity) && $product->unit_price_ratio > 0.000000} {math equation="pprice / punit_price" pprice=$productPrice punit_price=$product->unit_price_ratio assign=unit_price} <p class="unit-price"><span id="unit_price_display">{convertPrice price=$unit_price}</span> {l s='per'} {$product->unity|escape:'html':'UTF-8'}</p> {hook h="displayProductPriceBlock" product=$product type="unit_price"} {/if} what it does unit price.jpg what I want it to do unity.png Did you found a solution for this? Link to comment Share on other sites More sharing options...
ballashop Posted March 21, 2017 Share Posted March 21, 2017 is there a module do that? I'm looking for thanks 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