Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    I don’t see ‘lead time’ – where is this currently?

    3. Also this is not saying “in stock” when the product isn’t on back order. When it is indeed in stock nothing says “in stock”. We would like this to show, please could someone advise how this is possible.

    WooCommerce > Settings > inventory > stock display format.

    Thread Starter jamesscaife

    (@jamesscaife)

    Thanks Mike ??

    I do have this turned on – The ‘availible on bakorder’ message has been replaced with the custom field ‘Lead Time:’ you can see this in the link below, the 28cm pan is in stock whilst the 24cm pan is out of stock – 24cm displays the custom field when selected, although the 28cm is in stock and unfortunatley does not display the in stock message.

    https://olsonbaker.com/product/tools-frying-pan/

    Again thank you for your help.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    I do have this turned on

    Set to what exactly?

    Has your code removed messages when not on backorder? Can you paste it here?

    Thread Starter jamesscaife

    (@jamesscaife)

    Hi Mike,

    The Stock Display Format is set to show as ‘always show stock ie 12 in stock’

    I added the following to functions php…

    function custom_backorder_text( $available_array, $product_object ) {

    if( $available_array[“availability”] == “Available on backorder” ){

    $custom_meta_value = get_post_meta( $product_object->id, ‘Lead Time’, true );

    $available_array[“availability”] = “Lead Time: “.$custom_meta_value;

    $available_array[“class”] = “prod-code pc-leadtime”;

    return $available_array;

    }

    }

    add_filter( ‘woocommerce_get_availability’, ‘custom_backorder_text’, 99, 2);

    I can send everything I’ve added so far if that will help?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    You need to move the return $available_array; to the bottom of your function. You’re making it return nothing for all other cases.

    Thread Starter jamesscaife

    (@jamesscaife)

    LEGEND!

    Thanks again ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Woocommerce – Moving Custom Field/Changing Stock Status – But Struggling’ is closed to new replies.