WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Remove "Sale" tag on product image (18 posts)

  1. marc.kleinmann@gmail.com
    Member
    Posted 1 year ago #

    How can I remove the blue "sale" tag over my product images?

    http://wordpress.org/extend/plugins/woocommerce/

  2. IgniteWoo
    Member
    Posted 1 year ago #

    Add some CSS to your theme:

    .onsale { display: none !important; }
  3. mlddev
    Member
    Posted 1 year ago #

    Or avoid the !important and use:

    body.woocommerce span.onsale,
    body.woocommerce-page span.onsale {
       display: none;
    }
  4. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    Or actually remove the markup entirely;

    remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );

  5. mlddev
    Member
    Posted 1 year ago #

    Thanks James :)

  6. marc.kleinmann@gmail.com
    Member
    Posted 1 year ago #

    Can someone please tell me where to add this exactly?

  7. mlddev
    Member
    Posted 1 year ago #

    In your theme functions.php

  8. marc.kleinmann@gmail.com
    Member
    Posted 1 year ago #

    I've tried adding this in several spots with no luck. Sorry to be such pest but can you tell me exactly where in the functions.php?

  9. mlddev
    Member
    Posted 1 year ago #

    I use a child theme that allows me to have a functions.php file to add customizations to, but you could do so in your main theme functions.php file.

    You should be able to just added the code,

    // remove "Sale" icon from product images
    remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );

    to the the end of the functions.php file, before the last ?> if it has one.

  10. marc.kleinmann@gmail.com
    Member
    Posted 1 year ago #

    Sorry - still can;t get this work. I've tried add the code to my main theme functions.php at the very end but it doesnt change anything.

  11. Damboom
    Member
    Posted 1 year ago #

    That worked for the listed items, but what about the product details page?

  12. marc.kleinmann@gmail.com
    Member
    Posted 1 year ago #

    @Damboom - Can you tell me what code and where exactly you inserted it. I cannot get it to work. Thx, Marc - Sorry...I'm not a coder so this is new ground for me.

  13. mlddev
    Member
    Posted 1 year ago #

    Damboom, your right.. it does not seem to affect the product detail page sale icon, although I thought it did at first.

    Got a solution James? I am using WooCommerce for two clients that are either not implementing an actual ecommerce (but may need to in the future), or redirecting to 3rd party (Etsy).

  14. mlddev
    Member
    Posted 1 year ago #

    the code was posted in another thread.

    link to other post

    correct code:

    remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );
    remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );
  15. bollocks187
    Member
    Posted 7 months ago #

    IgniteWoo has the correct answer !

    Getting 'fancy' with function includes and remove actions etc is ONLY required if really necessary.

    Since the 'simple' CSS change does not impact the functionality of woocommerce this is the the better method to use.

  16. Cartographer
    Member
    Posted 7 months ago #

    Is it possible to remove this badge / tag for specific products?

    Regards

  17. Ruson
    Member
    Posted 6 months ago #

    I just removed it inside template

  18. Ruson
    Member
    Posted 6 months ago #

    But first You need to make backup and put template folder inside your theme.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.