- This topic has 11 replies, 2 voices, and was last updated 4 years, 9 months ago by
David.
-
AuthorPosts
-
May 4, 2018 at 11:21 am #567611
_blank
Hi There
How do I change the shape of the Woocommerce sale badge?
Also it’s pushing the image down which is odd.
I’m using Beaver Themer but don’t think i customised it in there1Thanks
ScottMay 4, 2018 at 7:33 pm #567875Leo
StaffCustomer SupportHi there,
Can you guide me to a page with the sales badge?
This is what the default should look like: http://demo.generatepress.com/shop/
Let me know 🙂
May 7, 2018 at 5:14 am #569505_blank
Hi Leo
Here’s an example
http://mackiedev1.belowthenoise.co.uk/salvesengraham/product-category/lighting/
It’s viewing just above the image rather on top off.
Thanks
ScottMay 7, 2018 at 5:24 am #569521David
StaffCustomer SupportHi Scott, this will keep it’s centered position overlayed on the image:
.woocommerce span.onsale { position: absolute; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); }Do you still need help changing the shape of it? If so how?
May 7, 2018 at 5:57 am #569553_blank
Hi David
Thanks thats really helpful.
If I wanted to adjust the alignment to be either left aligned or right aligned what would i need to change?Thanks
ScottMay 7, 2018 at 6:10 am #569560David
StaffCustomer SupportHi Scott for left its just a simple case of absolute position:
.woocommerce span.onsale { position: absolute; }For right aligned we add Right position to zero:
.woocommerce span.onsale { position: absolute; right: 0; }If you wanted it extend the full width then:
.woocommerce span.onsale { position: absolute; left: 0; right: 0; }May 7, 2018 at 6:22 am #569572_blank
Thanks David
Thats really helpful. I’ve saved those for future use.
Scott
May 7, 2018 at 6:27 am #569578David
StaffCustomer SupportYour welcome Scott
June 15, 2021 at 5:13 am #1822701Julio Merodio
Hello! I can’t see how can i display these badges…Where can i activate it?
Appearance/Customize… something there?
Many thanks in advance!
June 15, 2021 at 5:27 am #1822720David
StaffCustomer SupportHi there,
make sure you have the Woocommerce module activated in Dashboard > Appearance > GeneratePress.
Then in Customizer > Layout > Woocommerce you will see a list of options:https://docs.generatepress.com/article/woocommerce-overview/
Under Shop and Product Tab – enable the one labelled: Display sale flash
June 15, 2021 at 5:37 am #1822734Julio Merodio
Ok great, many thanks David!
And to translate labels, i should do via pomo files?
Thanks again
June 15, 2021 at 6:28 am #1822782David
StaffCustomer SupportThe Sales badge is output by Woocommerce plugin, most Translation plugins will handle it correctly.
But if you want to manually change the text for a single language install then you can use this PHP Snippet:add_filter( 'woocommerce_sale_flash', function() { return '<span class="onsale">YOUR TEXT HERE</span>'; } ); -
AuthorPosts
- You must be logged in to reply to this topic.