Support » Plugin: Woo Custom Stock Status » Showing two stock status

  • Resolved kfasterholdt

    (@kfasterholdt)


    Hi I am having a problem with the stock status. If there is stock, and at the same time it is set to “can be back ordered” it shows both in stock (på lager) and the text from can be backordered (leveringstid 4-5 dage) I only want the last part to be showing if there is nothing in stock – is there a way to make that work?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author softound

    (@softound)

    We are checking the issue and fix it ASAP

    Plugin Author softound

    (@softound)

    Hello,

    It is default feature of woocommerce to show the both status when product has stock and enabled the back order, Please see the screenshot https://prnt.sc/j4lm1h

    For now you can use the following script in your child theme to remove the first part of the stock status

    jQuery.each(jQuery('.stock.in-stock.s_in_stock_color.can_be_backordered_color'), function(){jQuery(this).text(jQuery(this).text().replace('på lager ', ''));});

    thanks

    Thread Starter kfasterholdt

    (@kfasterholdt)

    Thanks for your reply – can you be a bit more specific in where to place the script as I am not much of a coder. Is it in the functions.php?

    I tried that and it gives me an error:

    Uncaught Error: Call to undefined function jQuery() in wp-content/themes/flatsome-child/functions.php:4
    Stack trace:
    #0 wp-settings.php(424): include()
    #1 wp-config.php(90): require_once(‘/var/www/osterg…’)
    #2 wp-load.php(37): require_once(‘/var/www/osterg…’)
    #3 wp-admin/admin.php(31): require_once(‘/var/www/osterg…’)
    #4 wp-admin/theme-editor.php(10): require_once(‘/var/www/osterg…’)
    #5 {main}
    thrown

    Hope you can help
    Best regards Karin

    Plugin Author softound

    (@softound)

    Hi,

    add the following code at end of your functions.php

    add_action('wp_head', 'woo_custom_stock_status_replace_script');
    function woo_custom_stock_status_replace_script(){
    	echo "<script>jQuery(function(){jQuery.each(jQuery('.stock.in-stock.s_in_stock_color.can_be_backordered_color'), function(){jQuery(this).text(jQuery(this).text().replace('på lager ', ''));});});</script>";
    }

    thanks

    Thread Starter kfasterholdt

    (@kfasterholdt)

    Thanks, that seemed to do the trick

    Plugin Author softound

    (@softound)

    Good

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Showing two stock status’ is closed to new replies.