- This topic has 21 replies, 4 voices, and was last updated 3 years, 11 months ago by
David.
-
AuthorPosts
-
April 16, 2019 at 3:18 pm #870976
Tom
Lead DeveloperLead DeveloperFirst, you’ll want to remove any customization you’ve made to the badge in Elementor.
Then you can add this CSS:
.woocommerce #content span.onsale, .woocommerce #content ul.products li.product .onsale { height: 75px; width: 75px; line-height: 75px; border-radius: 100%; background: orange; position: absolute; top: -20px; left: -20px; font-size: 10px; padding: 0; }
To change the text, try this function:
add_filter( 'woocommerce_sale_flash', function() { return '<span class="onsale">YOUR TEXT HERE</span>'; } );
April 18, 2019 at 6:50 am #872651Antonio
Thank you very much Tom, for all your help. Now with that bit of code I have a base to experiment a bit with the style.
Thanks!
ππ
m.
April 18, 2019 at 8:52 am #872755Tom
Lead DeveloperLead DeveloperYou’re welcome π
June 25, 2019 at 12:30 am #940216Sam
I’m jumping in this thread because it seems like an appropriate place to post my issue, but I can start a new one if you’d prefer.
I have set up a Single Product template using Elementor Pro Theme Builder.
All works pretty much as you’d expect, but…when you add an “Add to Cart” module, the nice “+” and “-” buttons aren’t displayed. I have double checked that I’ve correctly set the option to show those buttons (in the Customizer) and they are displaying correctly when using a standard Woocommerce template.
I had a look through the code and it seems like you’re actively removing the “do-quantity-buttons” class via JS specifically for Elementor “Add to Cart” modules, I am wondering why.
Is it possible to get those nice buttons to display?
Thanks so much.
~Sam
June 25, 2019 at 3:09 am #940347David
StaffCustomer SupportHi there,
Unfortunately not, Elementor does not provide any filters to remove their button and the way they output the button conflicts with the GP +/- buttons.
June 25, 2019 at 9:21 pm #941284Sam
Thanks for your reply David,
I had a look into the way that Elementor adds the “Add To Cart” (when using the “Product Add to Cart” module) and it looked like it was using standard Woocommerce methods, nothing that should interfere with the functionality of GPP, so I simply removed that chunk of conditional logic from the JS and it works like a charm π
Just thought I would mention it, in case Tom wants to test/revisit it in a future release. I like those buttons. hehehe.
Thanks,
~SamJune 26, 2019 at 3:15 am #941513David
StaffCustomer SupportThanks for feeding back – it is something we may look closer at. The issue with Elementor is not the function but they way the add markup around the element.
Currently the only the method we could see was to add an elementor specific condition to the theme. Which we are reluctant to do as it leads to potential breakages or code redundancy that is stuck in the theme if/when Elementor makes changes.
Also be aware that any changes made to the parent theme or plugin functions will be overwritten when updates are made.
-
AuthorPosts
- You must be logged in to reply to this topic.