How to Create Custom Product Badges in Woocommerce for Free?

Поделиться
HTML-код
  • Опубликовано: 16 ноя 2024

Комментарии • 102

  • @wpsimplehacks
    @wpsimplehacks  2 года назад +2

    Did everything work out for you as shown in the video? Let me know in the comments.

    • @ArtsyArias
      @ArtsyArias 2 года назад +1

      Great Video, Thank you !!. However, there seems a slight Glitch in this. I encountered this while I tried impementing this on my site.
      1). I found that, when we use an Input field option - "display Woocommerce product badge with custom text" (the last option in your Blog post), it works correctly. Everything seems working fine initially. But the moment we Add out custom Text and Save it at Backend (Product options), then I found that I CANNOT remove that custom text (if at all I want to, for some reason). That gets Saved permanently.
      That is, when I tried to remove (empty that custom text field), and Save the product page, it still shows that Custom text afterwards (in the backend as well as frontend). Not sure, why ??
      What actually works is, if we change or replace our Custom text, then it works perfectly again. Means, it is changing or updating the Custom text, but not completely removing (emptying) it. When we already saved it, once.
      Can you please try to replicate at your end. Means by first adding custom text and saving it and seeing at frontend. Then, at backend, try to remove that custom text (making field empty), and Re-saving it. If that is working or not
      Please suggest me how to resolve this issue.
      Regards

    • @BlackJacketJones
      @BlackJacketJones 2 года назад

      nope. didnt work.

    • @miguelappsaplicacionesyjue9224
      @miguelappsaplicacionesyjue9224 Год назад

      Thanks for this video
      How can I put labels under the title and above the price in the product catalog?
      Thank you

    • @wpsimplehacks
      @wpsimplehacks  Год назад +1

      @@miguelappsaplicacionesyjue9224 Use a correct hook location. Default ones are these www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/
      If your theme or page builder (like Elementor) overrides default Woocommerce hooks then use the ones your theme or page builder provides.

    • @miguelappsaplicacionesyjue9224
      @miguelappsaplicacionesyjue9224 Год назад

      @@wpsimplehacks Thank you for your quick response and for such a detailed explanation. I am using a theme
      I don't understand what I should do exactly, but don't worry.
      I do not understand that. I'll keep looking on Google.
      With your quick response, even if I can't do what I need, you have managed to get me to subscribe to your channel.
      Thank you

  • @schmidt7672
    @schmidt7672 2 года назад +2

    You have not just helped me with this project but also with many other projects. Please keep up the good work. Your videos are detailed and easy to understand. Thank you. Much appreciated!

  • @lancelillie628
    @lancelillie628 2 года назад +1

    I 'm finding your videos SUPER USEFUL! I'm adding hacks you've shown to all my customers sites! EXCELLENT!

  • @faforyou9235
    @faforyou9235 Год назад

    Hi very thankful for your tutorial video! But I had some problem here..
    I currently using Astra Theme and ori sales badge is circle shape, can I know how to change the shape to rectangle same as you?

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      Astra Pro version has some Sale badge modification options, but it would be wise to ask about it from the Astra support team.

  • @webdevelopment801
    @webdevelopment801 2 года назад

    You deserve a lot subscriber. Try bring more videos on regular basis. Hopefully people will recognise your effort sooner or later. Good luck

  • @paulhere404
    @paulhere404 2 года назад

    Thanks for the video, will be checking out your other videos. With the free shipping will it show on the shop page also, as think it would be as useful there.
    Also what plugin are you using to show hooks?
    Thanks

    • @wpsimplehacks
      @wpsimplehacks  2 года назад +1

      The theme I am using (Blocksy Pro) has a built in feature that allows me to see the hooks. 10% discount coupon is in the video description.
      You can also Google “Woocommerce visual hooks”
      Shipping info ahould also work on category/shop pages - just use the correct hook to display it in the right position.

    • @paulhere404
      @paulhere404 2 года назад

      @@wpsimplehacks ok thanks, realized it was part of the theme after I sent the message, I'll take a look in the morning now. Just need to find the hooks for it then...

  • @gemorzo_bh
    @gemorzo_bh 2 года назад

    Working like a charm, would love to see a video where we can sort out the products by discount percentage.

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      When a discount/sale price is applied to WooCommerce products, it is saved as the sale price in the database and not stored as a percentage value. For this reason, it is not possible to sort by percentage values, as these are not stored values in the database

    • @gemorzo_bh
      @gemorzo_bh 2 года назад

      @@wpsimplehacks i have seen this product sorting option on a website, and really wanted to have it on mine. I wonder how they achieve that.

  • @zensukai
    @zensukai 2 года назад

    Wow, I just found your page ... fantastic work, thank you for these great tutorials!

  • @solo-j4v
    @solo-j4v 2 года назад

    Excellent work. Thanks so much. How would I best go about adding the version of the checkbox, instead of the existing "free shipping" location, putting it where the up to 20% bit is and also adding it on the archives? Thanks in advanced.

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Please explain a bit: as I understand you want the checkbox version but what should it contain and where do you need it?

  • @BenAnderson1
    @BenAnderson1 Год назад

    When I add text to the Custom Badge form and save but I don't want the text there later if I delete the text it doesn't update. So for example: I enter "New Design" for a product badge. Then I want to change that to have no badge in a couple of weeks I can't just delete "New Design" and the badge disappears. Once the field has been used it retains that input until it's replaced with something else. I want the badge to disappear when I delete the text in that field.

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      Hi,
      Take a look at this modified code here and this should do the trick wpsimplehacks.com/custom-product-badges-for-woocommerce/#how-to-display-woocommerce-product-badge-with-custom-text

  • @alexandreboechat8994
    @alexandreboechat8994 Год назад

    Great work buddy, keep going! nice.

  • @zemtoyscomapny5512
    @zemtoyscomapny5512 2 года назад

    Hello. dear sir Thanks for your great efforts. i have pasted the code in codesnippets, but it didnt worked for me. can you please help, why?

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      I don’t know because there may be a lot of reasons. For example, maybe your theme doesn’t support Woocommerce hooks. Or maybe it overrides it? Also, Elementor overrides Woo hooks.

  • @GregorMima
    @GregorMima 2 года назад

    Hi, cheers for your help! What im not getting tho is _where_ do you actually activate your badge to show at all? (btw im also using Blocksy) ... Any hints? Thank you!

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      I add the snippet to the Code Snippets (it is a plugin) code box. You have to use the correct hook for it, otherwise the badge will not show up. Also, Blocksy has two layouts for archive pages. In my video I use Type 1, because Type 2 uses Blocksy own hooks.

    • @GregorMima
      @GregorMima 2 года назад

      @@wpsimplehacks Cheers got it, was missing the checkbox "backend" and found it on the products page! Great Help Thank You!

  • @johnmiller1281
    @johnmiller1281 9 месяцев назад

    I am using the blocksy theme and I am unable to control the location of the new product badge. I can only display it in the center top. I had to remove the top and right from the css or it would not display at all. Any ideas? Thanks!

    • @wpsimplehacks
      @wpsimplehacks  9 месяцев назад

      It would be wise to ask about it from the Blocksy support. They are pretty responsive

  • @alper4921
    @alper4921 2 года назад

    Thanks for the detailed video and codes on your website. Would you be able to share a code for displaying a badge (png) based on attributes? For example, showing products brand (or made in EU badge etc.)? Cheers

    • @wpsimplehacks
      @wpsimplehacks  2 года назад +3

      Sorry, this is out of my scope right now. Maybe in the future I will have a bit more free time to modify the snippet. Can’t promise, though. I hope you understand.

  • @anastasiades.konstantinos
    @anastasiades.konstantinos 2 года назад

    I need to apply a custom badge to a specific product id. Is there a way to filter through every product id loop item and apply the badge on the loop item with the specific id?

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      You would have to use conditionals. See here www.businessbloomer.com/woocommerce-conditional-logic-ultimate-php-guide/#php-do-something-if-product-id-xyz

  • @marcof6273
    @marcof6273 2 года назад

    Hi! Great code! I have used your code on my site and it works when I do the product edit, however when I do "quick edit" of the product the badge disappears it doesn't keep it in memory. Has this ever happened to you? Can you give me some indication?

  • @viralclout4570
    @viralclout4570 2 года назад

    Thanks for this great video. I changed the Sale badge to % and it worked great. However, when I use the WooCommerce Best Seller Block or the New Products Block it doesn't work.

    • @wpsimplehacks
      @wpsimplehacks  2 года назад +1

      It’s because Woocommerce blocks are overriding default Woo hooks

    • @viralclout4570
      @viralclout4570 2 года назад

      @@wpsimplehacks Is there a workaround?

    • @wpsimplehacks
      @wpsimplehacks  2 года назад +1

      Use Woocommerce shortcodes (see their docs) to output best selling products. These should display products in a built in way.

    • @viralclout4570
      @viralclout4570 2 года назад

      @@wpsimplehacks It worked with the shortcuts. Thanks!

  • @Luigi-wp6rf
    @Luigi-wp6rf 2 года назад

    valuable tips, thanks for what you do. Have you ever made a content about delivery time estimates ? I have found a code but I am having difficulty making it suitable for my needs. I can't apply the rule [> = day]. I would need it to report: * // monday> get it for wednesday * // tuesday> get it for thursday * // Wednesday> get it for Friday * // Thursday / Friday / Saturday / Sunday> get it on Tuesday the message text would be: order now to receive it {day label} the snippet I prepared works. but skip Thursdays 😅😅😅. Save Me 🙏🙏🙏

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      See whether this video helps you out ruclips.net/video/Ni8VezPG-cg/видео.html
      Take a look at the 5:24 mark.

  • @mallorydurrick
    @mallorydurrick 2 года назад

    Works great. Thank you!

  • @gergoremete3011
    @gergoremete3011 Год назад

    If I want to use with JetWooBuilder isn't works. :(
    And I didn't found jetwoo hooks

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      It would be wise to ask about it from JetWooBuilder team.

  • @jennyonyinye1955
    @jennyonyinye1955 2 года назад

    Very great content. I used all of it and i love it

  • @morecolors1266
    @morecolors1266 2 года назад

    Hello :) How can I add custom badge to product archive page like discount badge?

  • @faisal.enayat
    @faisal.enayat 2 года назад

    Can we use this code with other archive widgets or does it only work with elementor's archive widget? thank you

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Sorry, but I don’t use Elementor :)
      Also, since Elementor overrides Woocommerce default hooks then most likely it’s not working with the Elementor. You can test it out and let me know though.

  • @zaifhossain8509
    @zaifhossain8509 2 года назад

    You are a snippet master 😍😍👌👌

  • @sheikhnasim3048
    @sheikhnasim3048 Год назад

    Possible For You To Updatee Css For Kadence...

  • @saveriometra2538
    @saveriometra2538 2 года назад

    Hi I have an ecommerce site and I built the template with elementor and I tried to do the procedure you showed but it doesn't work, how can I do?

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Elwmentor overrides default Woocommerce hooks. So, you need to find out what hooks Elementor uses and use these.

    • @saveriometra2538
      @saveriometra2538 2 года назад

      @@wpsimplehacks Thanks a lot

    • @saveriometra2538
      @saveriometra2538 2 года назад

      @@wpsimplehacks Whats the hame of plugin taht you use in the video? For show the hooks

  • @RiccardoTurcato
    @RiccardoTurcato 2 года назад

    There's something wrong with Blocksy update, the new badge have not the position correct. Could you check your code with new updates? TY

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      I just tested with the latest Blocksy and it’s workind well.
      Single product page cln.sh/EhHFtT
      Archive page cln.sh/n7mEVi

    • @RiccardoTurcato
      @RiccardoTurcato 2 года назад

      @@wpsimplehacks Pro versione of blocky Is different? Ive try in two different sites and doesnt works well

    • @RiccardoTurcato
      @RiccardoTurcato 2 года назад

      Could be the card type of archive products?

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Which cart type you’re using? Because Type two has some additional and different hooks. Try with Type one card - it uses default Woocommerce hooks.

  • @BmxAddict08
    @BmxAddict08 7 месяцев назад

    is there a snippet to show badge if product is in stock and hide when out of stock?

    • @wpsimplehacks
      @wpsimplehacks  7 месяцев назад

      Not that I know of. Although, out of curiosity, why would need on because all products are in stoxk by default? If they are out of stock, then "Out of stock" badge is displayed.

    • @BmxAddict08
      @BmxAddict08 7 месяцев назад

      @@wpsimplehacks Thank you for reply! For example i am selling bicycles, and would be nice to have a badge "fast shipping " to show which bikes can be delivered fast from our store, and which bikes are out of stock ( are not in our store), to make backorders but needs to wait 2-3 weeks from manufacturer.

    • @BmxAddict08
      @BmxAddict08 7 месяцев назад

      @@wpsimplehacks i know i can make from your tutorial with custom field and make as a check option on every product that is in stock manually. But automatically would be less headache :)

    • @wpsimplehacks
      @wpsimplehacks  7 месяцев назад +1

      Maybe this helps you out a bit: ruclips.net/video/DzIX7RSY0v4/видео.html
      You have to find the right Woocommerce hook and mess a bit with CSS to display it as a badge on product image.

  • @TiagoDezan
    @TiagoDezan 2 года назад

    Great video!! Thanks for this one!!

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Glad you liked it

    • @akindia8519
      @akindia8519 2 года назад

      @@wpsimplehacks hi. Is there a way for footer add to cart button for woocommerce, especially for variable products

  • @carlosbotellanavarro5073
    @carlosbotellanavarro5073 2 года назад

    Hi, is there any way to do the same thing with custom stock status? I would like to display a badge if the product has a certain stock status (seen this on the video you published about stock statuses thnx)

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      I haven't tried with custom statuses and therefore unfortunately I can't help you with that.

    • @carlosbotellanavarro5073
      @carlosbotellanavarro5073 2 года назад

      @@wpsimplehacks and where could I find how to do it? Any idea? Sorry for the insistence 😅

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      "If anything else fails, read the manual" Murphy's law
      Where's the manual? Here woocommerce.com/document/variable-product/
      🙂

  • @slingsandarrows
    @slingsandarrows Год назад

    How would I make this work if I wanted to use images as badges?

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      You would need to modify CSS for it.

    • @slingsandarrows
      @slingsandarrows Год назад

      @@wpsimplehacks Do you mean use a background-image? Also, do you have a video on creating a product filter for the shop page? I've been trying to figure out a way to seperate my product categories under different headings in a filter sidebar.

  • @slingsandarrows
    @slingsandarrows Год назад

    Is there code to add the custom badge to the archive image?

    • @wpsimplehacks
      @wpsimplehacks  Год назад

      Try to add a hook from the archive page. For example, add_action( 'woocommerce_before_shop_loop_item_title', 'new_badge', 3 );

  • @kashfulbangladesh
    @kashfulbangladesh 2 года назад

    thank you so much sir!!

  • @GregorMima
    @GregorMima 2 года назад

    Never mind found it thanks!

  • @datboyfemi
    @datboyfemi 2 года назад

    Great work, error code on line 8 for code snippet to create woocommerce custome text badge.

    • @datboyfemi
      @datboyfemi 2 года назад

      showing "Cannot redeclare function woo_add_custom_fields."

    • @wpsimplehacks
      @wpsimplehacks  2 года назад +1

      I just tested it on my site and it works wi5hout any issues. Just pasted the inside Code Snippets box, activated it and no problems whatsoever.

    • @datboyfemi
      @datboyfemi 2 года назад

      I would try it again

  • @Wake_saa
    @Wake_saa 2 года назад

    👍👍👍👍

  • @jeffreyhuen
    @jeffreyhuen 2 года назад

    🌟🌟

  • @patrickkwamebonsi4650
    @patrickkwamebonsi4650 2 года назад

    am using flatsome theme. this is your css code .ct-woo-card-extra.new-badge{ Please what should my css code of my theme (am trying to create new label for my products)

    • @wpsimplehacks
      @wpsimplehacks  2 года назад

      Sorry, unfortunately I'm not familiar with the Flatsome theme.