asperon Posted March 29, 2019 Share Posted March 29, 2019 Any solution how to change color of discount prices?I mean i need different color of new price in discount on default prestashop change only color of old price... Link to comment Share on other sites More sharing options...
Yanel Posted March 29, 2019 Share Posted March 29, 2019 you can take the class name of discount prices and modify it in the custom css for exempl .class-name { color: red ; } Link to comment Share on other sites More sharing options...
asperon Posted March 29, 2019 Author Share Posted March 29, 2019 29 minutes ago, labib92 said: you can take the class name of discount prices and modify it in the custom css for exempl .class-name { color: red ; } and what about the class in product-prices.tpl file? Link to comment Share on other sites More sharing options...
Yanel Posted March 29, 2019 Share Posted March 29, 2019 Send me a screenshot please Link to comment Share on other sites More sharing options...
asperon Posted March 29, 2019 Author Share Posted March 29, 2019 41 minutes ago, labib92 said: Send me a screenshot please here you are but you dont need screenshot i need a new class for discount prices look at the screenshot i need red color for new price only with discount Link to comment Share on other sites More sharing options...
asperon Posted March 30, 2019 Author Share Posted March 30, 2019 Any solution here? Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted March 30, 2019 Share Posted March 30, 2019 Your solution is in the first answer, in my opinion. Assuming that you are using v1.7, go to /themes/yourmodule/assets/css and edit the file custom.css. Add the following code: .product-flags .discount, .product-flags .on-sale { color: red; } Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted March 30, 2019 Share Posted March 30, 2019 Ok, I think I misunderstood. You mean.. .red color for product price, not discount, but only when it has a discout? When it doesn't have a discount the color should remain the same? Link to comment Share on other sites More sharing options...
asperon Posted March 30, 2019 Author Share Posted March 30, 2019 7 minutes ago, Rodrigo B Laurindo said: Your solution is in the first answer, in my opinion. Assuming that you are using v1.7, go to /themes/yourmodule/assets/css and edit the file custom.css. Add the following code: .product-flags .discount, .product-flags .on-sale { color: red; } I will check this out but this cannot by a solution on my opinion i think this css code only change badge colors i think Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted March 30, 2019 Share Posted March 30, 2019 Yes, as I said, I think I misunderstood your question. Did you read my last question? 1 Link to comment Share on other sites More sharing options...
asperon Posted March 30, 2019 Author Share Posted March 30, 2019 6 minutes ago, Rodrigo B Laurindo said: Ok, I think I misunderstood. You mean.. .red color for product price, not discount, but only when it has a discout? When it doesn't have a discount the color should remain the same? Yes i mean just that i need color for products on sale only for new price on default prestashop dont have this feature. Link to comment Share on other sites More sharing options...
asperon Posted March 30, 2019 Author Share Posted March 30, 2019 So i need to add proper codes in tpl and css files but what is the code i test many solutions without success Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted March 30, 2019 Share Posted March 30, 2019 (edited) Did you try this? {if $product.has_discount} <div class="current-price" > {else} <div class="current-price current-price-with-discount" > {/if} Edited March 30, 2019 by Rodrigo B Laurindo (see edit history) Link to comment Share on other sites More sharing options...
asperon Posted March 30, 2019 Author Share Posted March 30, 2019 2 minutes ago, Rodrigo B Laurindo said: Did you try this? {if $product.has_discount} <div class="current-price" > {else} <div class="current-price current-price-with-discount" > {/if} Not the same but i will test this one thanks for the help Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted March 30, 2019 Share Posted March 30, 2019 Of course, you would have to add the proper css 😊 Let me know if it works Link to comment Share on other sites More sharing options...
asperon Posted April 1, 2019 Author Share Posted April 1, 2019 On 3/30/2019 at 8:37 PM, Rodrigo B Laurindo said: Of course, you would have to add the proper css 😊 Let me know if it works Unfortunately is not working i add proper css styles and add this code to product-prices.tpl Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted April 1, 2019 Share Posted April 1, 2019 (edited) What CSS code did you use? Is the modification shown in your html page? Have you cleaned the cache? Edited April 1, 2019 by Rodrigo B Laurindo (see edit history) Link to comment Share on other sites More sharing options...
asperon Posted April 1, 2019 Author Share Posted April 1, 2019 1 hour ago, Rodrigo B Laurindo said: Cuál código CSS pusiste y dónde lo pusiste? En tu html aparece la modificación? Has limpiado el cache? i always clear cache after modification Link to comment Share on other sites More sharing options...
Rodrigo B Laurindo Posted April 1, 2019 Share Posted April 1, 2019 (edited) Sorry, I have posted my answer in the wrong language before. I have edited it now. What CSS code did you use? Is the modification shown in your html page? Edited April 1, 2019 by Rodrigo B Laurindo (see edit history) Link to comment Share on other sites More sharing options...
asperon Posted April 1, 2019 Author Share Posted April 1, 2019 12 minutes ago, Rodrigo B Laurindo said: Sorry, I have posted my answer in the wrong language before. I have edited it now. What CSS code did you use? Is the modification shown in your html page? i use current-price for css. But modification is not shown in html page Link to comment Share on other sites More sharing options...
asperon Posted April 1, 2019 Author Share Posted April 1, 2019 this is the schema in product-prices.tpl file without modification {if $product.show_price} <div class="product-prices"> {block name='product_discount'} {if $product.has_discount} <div class="product-discount"> {hook h='displayProductPriceBlock' product=$product type="old_price"} <span class="new-price">{$product.regular_price}</span> </div> {/if} {/block} {block name='product_price'} <div class="product-price h5 {if $product.has_discount}has-discount{/if}" itemprop="offers" itemscope itemtype="https://schema.org/Offer" > <link itemprop="availability" href="https://schema.org/InStock"/> <meta itemprop="priceCurrency" content="{$currency.iso_code}"> <div class="current-price"> <span itemprop="price-new" content="{$product.price_amount}">{$product.price}</span> {if $product.has_discount} {if $product.discount_type === 'percentage'} <span class="discount discount-percentage">{l s='Save %percentage%' d='Shop.Theme.Catalog' sprintf=['%percentage%' => $product.discount_percentage_absolute]}</span> {else} <span class="discount discount-amount"> {l s='Save %amount%' d='Shop.Theme.Catalog' sprintf=['%amount%' => $product.discount_to_display]} </span> {/if} {/if} </div> {block name='product_unit_price'} {if $displayUnitPrice} <p class="product-unit-price sub">{l s='(%unit_price%)' d='Shop.Theme.Catalog' sprintf=['%unit_price%' => $product.unit_price_full]}</p> {/if} {/block} </div> {/block} {block name='product_without_taxes'} {if $priceDisplay == 2} <p class="product-without-taxes">{l s='%price% tax excl.' d='Shop.Theme.Catalog' sprintf=['%price%' => $product.price_tax_exc]}</p> {/if} {/block} {block name='product_pack_price'} {if $displayPackPrice} <p class="product-pack-price"><span>{l s='Instead of %price%' d='Shop.Theme.Catalog' sprintf=['%price%' => $noPackPrice]}</span></p> {/if} {/block} {block name='product_ecotax'} {if $product.ecotax.amount > 0} <p class="price-ecotax">{l s='Including %amount% for ecotax' d='Shop.Theme.Catalog' sprintf=['%amount%' => $product.ecotax.value]} {if $product.has_discount} {l s='(not impacted by the discount)' d='Shop.Theme.Catalog'} {/if} </p> {/if} {/block} {hook h='displayProductPriceBlock' product=$product type="weight" hook_origin='product_sheet'} <div class="tax-shipping-delivery-label"> {if $configuration.display_taxes_label} {$product.labels.tax_long} {/if} {hook h='displayProductPriceBlock' product=$product type="price"} {hook h='displayProductPriceBlock' product=$product type="after_price"} </div> </div> {/if} 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