How to Customize Woocommerce Stock Status? (17 hacks)

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

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

  • @paulsid2048
    @paulsid2048 6 месяцев назад

    Awesome work as always, how can the stock status code be updated to allow for variable products as well please, as have a number of products that have a few colour variations.

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

      Sorry, I haven’t tested it with this

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

    Thank you, your code for How to change “XX in stock” text on Woocommerce single product pages is the only one that worked for me! How can I make it so that it only shows the number in stock when it's below the low stock threshold, not all the time. e.g. I only want it to show xx in stock if it is below 3. It is not doing it even though I have chosen "Only show quantity remaining in stock when low" in Woo inventory settings. Appreciate the help.

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

      Woocommerce has a setting for this. Go to Woocommerce >> Settings >> Products >> Stock

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

    Thank you so much for the great video.
    Wondeirng if you have any snippets or advise on how to change the Allow backrders text for "Allow, but notify customer" when stock management is used with simple or variable products. Looking for something other than the default "can be back ordered" text woocommerce used and possibly configurable per product page simular to the snippet for "How to display Woocommerce backorder text value from custom field"

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

    Thanks a lot for your all’s efforts

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

    Amazing Hacks ! Keep up the good work 💪

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

    Thanks for tips. How I can change position. I need stock status before title.

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

      No, unfortunately you can't as it is hardcoded inside the woocommerce template.

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

    These are great. What I can't seem to figure out/find a snippet for is how to change the "XX in stock" text for a variable product. Any ideas?

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

      Sorry, unfortunately I can’t help you with that at the moment.

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

    Hi Yanek! Thanks for another great tutorial!
    Is there any Snippet you have changing Woo default behaviour - Set the backorder status when the stock qty is less than 1? By default it goes to "Out of Stock" but I am trying to make it change to "Backorder"?
    Thanks for advance!

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

    Hello. Thank you for this amazing tutorial. I have a question please. Is there a way to show "Available on backorder" text on just below the product name on cart, checkout pages and emails? I would really appreciate any help.

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

      Try to use this hook: woocommerce_after_cart_item_name

  • @jeffrussell4094
    @jeffrussell4094 3 месяца назад

    Is there a way to remove the in stock word on the in stock product but still show the out of stock when out of stock?

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

      Sorry, can’t help you with this

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

    Hello! Im new to WP and have had a website built for me. Im just doing some finishing touches. This snipped did not work for me. My site seems to have a lot of plugins. Not sure why its not working. Its a very simple process. Any help would be greatly appreciated.

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

      Since I don’t know what snippet you’re using it’s hard to tell. The most likely reason is that you’re using a page builder (Elementor, Divi, etc) or theme that overrides default Woocommerce hooks.

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

      @@wpsimplehacks using your custom stock label snippet, but yes I have Elementor. will have to try another solution. thank you for the quick reply.

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

      @@wpsimplehacks I got it to work by disabling "Track stock quantity for this product". It almost works exactly how I want. But I dont want customers to be able to buy certain products. Is that possible? Thank you!

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

    Hello. First of all thank you for all the amazing tutorials. The code for this How to change Woocommerce add to cart button text if product is avaliable on backorder does not work. Any idea why please. It used to work fine but now it doesn't. I deactivated all other snippets, switched theme and deactivated plugins but the issue is still there. The text does not change. Thank you

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

      I tested it on a simple product and it works but not on variable product.

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

      See this wpsimplehacks.com/customize-woocommerce-stock-status/#change-woocommerce-add-to-cart-button-textfor-variable-products-if-product-is-avaliable-on-backorder

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

      @@wpsimplehacks thank you so much. You are always so helpful. I will test it out now.

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

    Amazing tutorial👌 however the "read more" snippet seems to only change a few products not all. Any suggestions?

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

      Do you have variable products with variations that are not out of stock?

  • @TheEnemyYT2520
    @TheEnemyYT2520 Месяц назад

    When i add the code for the stock status it appears out of stock on the product page

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

    first of all thanks a lot for this amazing video but when i tried submitting a form on single product page using Contact form 7 , it doesn't show the confirmation of form submission , instead it loads the page and shows i can not add the product as it is out of stock . please help

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

      Sorry, but unfortunately I’m not familiar with Contact Form 7 plugin. My snippet disables the add to cart button for out of stock products and adds a contact form isntead of it.
      Just to test it out, try with some other contact form plugin (Fluent forms, for example). If the other form works, then there’s an issue with the CF7.

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

      Hi,
      I may know what is the issue over there. Please replace "single_add_to_cart_button button alt" with "button alt"

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

    This is fantastic! Great video.
    I've created a custom status --> custom_order - I can't get the notice to show up on the cart page, eg: "Youve got a custom order product in your cart."
    will this line still work if I haven't defined is_custom_order?
    if( $cart_item['data']->is_custom_order( $cart_item['quantity'] ) ) {

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

    What a great video!

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

      ya it's video is too much helpfull

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

      Glad you enjoyed it!

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

    Fantastic Video

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

    By adding the following filter it is possible to display the stock status in exported product csv files?
    function add_custom_stock_csv_data( $_, $product ) { $status = $product->get_stock_status( 'edit' ); switch( $status ) { case 'pre_order': case 'contact_us': return $status; case 'onbackorder': return 'backorder'; case 'instock': return 1; default: return 0; } } add_filter( 'woocommerce_product_export_product_column_stock_status', 'add_custom_stock_csv_data', 10, 2 );

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

    Wonderful videos & easy explanations. Could you please assist? I can't seem to get my labels above placeholder box on the checkout page.

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

      Usually it's a theme related issue. It would be wise to contact your theme supoort team about it.

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

      @@wpsimplehacks thank you for reply. Having a blond moment, it was a build in feature on my builder. All sorted.

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

    how i can hide cod option on specific products

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

      See this video ruclips.net/video/-PI68HRpmdg/видео.html

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

    Hi Sir, I need your help with something. Don't know how to contact you. Please help.

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

      What is it you need my help with?

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

      @@wpsimplehacks I want to move "You Save" element made with Code Snippet, alongside product price.

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

      You wouod need to use a correct hook location and some CSS to make it work. If you don't know how to use CSS then it would be wise to hire someone to do the job. Also, the CSS code to make it work may depend on your theme

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

      @@wpsimplehacks Ok, I am using Kadence theme btw