How to Customize Woocommerce Stock Status? (17 hacks)

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ก.ค. 2022
  • Let’s take a look at how to customize Woocommerce stock status without any fancy plugin.
    All snippets shown in the video are here: wpsimplehacks.com/customize-w...
    WPCodeBox with 20% discount: wpsimplehacks.com/wpcodebox (SAVE 20% Coupon WPSH20)
    Blocksy and Kadence are currently two of the best WordPress themes. So, if you’re interested, then you can grab:
    🅱️ Blocksy theme wpsimplehacks.com/blocksy (SAVE 10% Coupon WPSH10)
    🔵 Kadence theme here: wpsimplehacks.com/kadence (SAVE 10% Coupon SIMPLEHACKS)
    ✅ If you want to be the first to be notified about the new tutorials then please subscribe to this channel. / @wpsimplehacks
    ✅ BEST WORDPRESS THEMES:
    Blocksy theme: wpsimplehacks.com/blocksy (SAVE 10% Coupon WPSH10)
    Kadence Theme: wpsimplehacks.com/kadence (SAVE 10% Coupon SIMPLEHACKS)
    Astra Theme: wpsimplehacks.com/astra
    GeneratePress: wpsimplehacks.com/generatepress
    OceanWP: wpsimplehacks.com/oceanwp (SAVE 10% Coupon WPSH10)
    ✅ MY FAVOURITE WEBHOSTING PROVIDERS:
    Verpex Hosting wpsimplehacks.com/verpex (SAVE 22% Coupon WPSH22)
    A2 hosting wpsimplehacks.com/a2-hosting
    ✅ AWESOME WORDPRESS PLUGINS:
    WPCodeBox wpsimplehacks.com/wpcodebox (SAVE 20% Coupon WPSH20)
    WooLentor Elementor/Gutenberg add-on wpsimplehacks.com/woolentor (SAVE 20% Coupon WPSH20)
    Best Wordpress Backup, Migration and Staging plugin - WpVivid Pro wpsimplehacks.com/wpvidid (SAVE 20% Coupon WPSH20)
    Best Gutenberg Blocks addon - Kadence Blocks wpsimplehacks.com/kadenceblocks (SAVE 10% Coupon SIMPLEHACKS)
    Best forms plugin - Fluent Forms: wpsimplehacks.com/fluentforms (SAVE 20% Coupon: WPSH20)
    WP Social Ninja wpsimplehacks.com/socialninja (SAVE 20% Coupon: WPSH20)
    Best for email marketing - Fluent CRM: wpsimplehacks.com/fluentcrm (SAVE 20% Coupon: WPSH20)
    Best for creating tables - Ninja Tables wpsimplehacks.com/ninjatables (SAVE 20% Coupon: WPSH20)
    Best events calendar and ticket selling plugin - WP Eventin wpsimplehacks.com/wp-eventin (SAVE 20% Coupon: WPSH20)
    Best Wordpress LMS - Tutor LMS wpsimplehacks.com/tutorlms (SAVE 20% Coupon thmwelcome20)
    Best Wordpress SEO plugin - SEOPress wpsimplehacks.com/seopress
    Image Map Pro - wpsimplehacks.com/imagemap
    ✅ AWESOME WOOOCOMMERCE EXTENSIONS:
    Best Woocommerce Swiss Knife tool - Kadence WooExtras wpsimplehacks.com/wooextras (SAVE 10% Coupon SIMPLEHACKS)
    Advanced Dynamic Pricing Pro wpsimplehacks.com/dynamic-pri... (SAVE 20% Coupon: WPSH20)
    Phone orders For Woocommerce Pro wpsimplehacks.com/phone-order... (SAVE 20% coupon: WPSH20)
    Advanced Orders Export Pro wpsimplehacks.com/export-orde... (SAVE 20% coupon: WPSH20)
    Best Woocommerce sidecart plugin - Woocommerce Cart in One wpsimplehacks.com/cartinone
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 50

  • @andersonward8064
    @andersonward8064 2 ปีที่แล้ว

    Thanks a lot for your all’s efforts

  • @antonisfio
    @antonisfio ปีที่แล้ว

    Amazing Hacks ! Keep up the good work 💪

  • @xnwebdesign1024
    @xnwebdesign1024 2 ปีที่แล้ว

    Fantastic Video

  • @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!

  • @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!

    • @wpsimplehacks
      @wpsimplehacks  ปีที่แล้ว

      Sorry, can’t help you with that

  • @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"

    • @wpsimplehacks
      @wpsimplehacks  ปีที่แล้ว

      Sorry, can’t help you with that.

  • @paulsid2048
    @paulsid2048 หลายเดือนก่อน

    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  21 วันที่ผ่านมา

      Sorry, I haven’t tested it with this

  • @pixelgap
    @pixelgap ปีที่แล้ว

    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  ปีที่แล้ว

      Try to use this hook: woocommerce_after_cart_item_name

  • @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.

  • @michaelakubas
    @michaelakubas ปีที่แล้ว

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

    • @wpsimplehacks
      @wpsimplehacks  ปีที่แล้ว

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

  • @28692kabelo
    @28692kabelo 2 หลายเดือนก่อน

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

    • @wpsimplehacks
      @wpsimplehacks  2 หลายเดือนก่อน

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

  • @souravsaha6511
    @souravsaha6511 ปีที่แล้ว

    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  ปีที่แล้ว +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  ปีที่แล้ว

      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'] ) ) {

  • @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.

  • @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 );

  • @anuragahreiki
    @anuragahreiki 4 หลายเดือนก่อน

    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  4 หลายเดือนก่อน +1

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

  • @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!

  • @Peebals
    @Peebals 2 ปีที่แล้ว

    how i can hide cod option on specific products

    • @wpsimplehacks
      @wpsimplehacks  2 ปีที่แล้ว

      See this video th-cam.com/video/-PI68HRpmdg/w-d-xo.html

  • @elizabeth_8791
    @elizabeth_8791 ปีที่แล้ว

    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  ปีที่แล้ว +1

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

    • @elizabeth_8791
      @elizabeth_8791 ปีที่แล้ว

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

  • @jcnation5393
    @jcnation5393 ปีที่แล้ว

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

    • @wpsimplehacks
      @wpsimplehacks  ปีที่แล้ว

      What is it you need my help with?

    • @jcnation5393
      @jcnation5393 ปีที่แล้ว

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

    • @wpsimplehacks
      @wpsimplehacks  ปีที่แล้ว

      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 ปีที่แล้ว

      @@wpsimplehacks Ok, I am using Kadence theme btw