• Hi,

    I think this plugin is awesome, but would be even better if there was an option to display a custom stock status for products with unmanaged stock. (Would be great if that option could be enabled globally, and on a per product basis.)

    I’m trying to do something like that in me theme’s functions.php, because I don’t want to modify the plugin itself, but I just can’t get it done….

Viewing 15 replies - 16 through 30 (of 46 total)
  • skafte

    (@skafte)

    Hi @softound – sorry had forgot to change the default privacy settings for the video. Please try again ??

    Plugin Author Softound Solutions

    (@softound)

    Yes, now i can see, let me check if the same issue occur in my local computer. thanks

    Plugin Author Softound Solutions

    (@softound)

    Hi there,

    The above error has been fixed, can you download and check ?
    https://github.com/softound/woo-rename-stock-status/releases/tag/1.2

    thanks

    skafte

    (@skafte)

    Hi @softound,

    Amazing! There are no issues now ?? Thanks!

    One question – would it be possible to make it so that ‘Unmanaged Stock Status’ shows up also when a product is in stock? At the moment it only appears when a product is set to out of stock.

    I am asking because I use the WooCommerce Pre-Orders extension, which requires a product to be in stock before you can pre-order it.

    Thanks!

    • This reply was modified 7 years ago by skafte.
    skafte

    (@skafte)

    PS. Also, if it’s possible to make the out of stock message disappear or not show when pre-orders are disabled, then that would be amazing! In that way the plugin would be fully compatible with WooCommerce Pre-Orders, which I guess is a nice thing ?? -however that’s an extra – the most important thing for now is if it’s possible to make the ‘Unmanaged Stock Status’ show when a product is either in-stock or available for pre-ordering.

    • This reply was modified 7 years ago by skafte.
    Thread Starter brixxo

    (@brixxo)

    Hi @softound,

    Just tested your pre-release. Working great for me!

    Just one thing: I need the stock status to always display right above the add-to-cart button, in our case that is better for conversion.

    What would be the easiest way to achieve that? I guess that could be done through the theme functions.php?

    Or could you implement a setting to choose position? For example ‘below price’, ‘above add-to-cart button’ and ‘in secondary actions wrapper’.

    skafte

    (@skafte)

    Hi there @brixxo and @softound,

    Thanks for adding your input too @brixxo.

    Sorry to add this, but in my case it’s ideal to have the message right below the title instead of above the ‘Add to cart’ button. So ideally moving it would be achieved through an option as you also suggest @brixxo. In that way placing it in either location is made possible ??

    Otherwise a functions.php snippet solution for either moving it below the title or above the ‘Add to cart’ button would be highly appreciated.

    Many thanks to both of you!

    Thread Starter brixxo

    (@brixxo)

    Just tested a bit more with variable products, but it seems stock status doesn’t update anymore. To be sure I tested with the Twenty Seventeen theme, not my custom theme.

    Variable product, stock is managed for variants -> https://www.screencast.com/t/NoTqHgGSeId
    https://www.screencast.com/t/JIMT90af

    Stock status doesn’t update on frontend, even if the variant is out of stock…

    skafte

    (@skafte)

    Hi @brixxo,

    Thanks for sharing this. What does it mean though? Are you saying that it should be working or that we have another problem? Apologies for not completely understanding… Thanks!

    Thread Starter brixxo

    (@brixxo)

    @skafte:

    Well, let’s say you have a variable product with 3 colors: Red (stock: 30 pcs), green (stock 50 pcs) and blue (stock: -10 pcs).

    If a customer selects red or green, the stock status should be ‘In stock’. If the customer selects blue, the stock status should be ‘Out of stock’.

    However, at the moment it’s always ‘In stock’, no matter what…

    skafte

    (@skafte)

    Hi @brixxo,

    Ok. That sounds a bit strange! Do you think it can be solved somehow?

    Anyway, if not, could the ‘Unmanaged Stock Status’ feature then work for simple products only and ignore ‘In stock’ and ‘Out of stock’ statuses, so that it is shown at all times?

    Thanks!

    Plugin Author Softound Solutions

    (@softound)

    Okay, we will check the issue in our local version.

    skafte

    (@skafte)

    Hi again @brixxo – apologies for the confusion before. Thought for a moment that you were the plugin developer, which is why I asked if you thought it could be fixed! ??

    Thread Starter brixxo

    (@brixxo)

    @softound Solutions:

    What if you just keep all code from the current stable release + add a check for simple products with unmanaged stock like below?

    – Status ‘instock’ & product in_stock message not set -> display global in_stock message
    – Status ‘instock’ & product in_stock message set -> display product in_stock message
    – Status ‘outofstock’ & product out_of_stock message not set -> display global out_of_stock message
    – Status ‘outofstock’ & product out_of_stock message set -> display product out_of_stock message

    <?php // Stock info
    //Get the product type
    $type = $product->get_type();
    //Get the stock status
    $stock_status = $product->get_stock_status();
    //Get manage stock
    $stock_managed = $product->get_manage_stock();
    ?>

    <?php if($type == ‘simple’ && $stock_managed == true): ?>
    <?php echo wc_get_stock_html( $product ); //From woocommerce/single-product/add-to-cart/simple.php ?>
    <?php endif; ?>
    <?php if($type == ‘simple’ && $stock_managed == false): ?>
    <?php if($stock_status == ‘instock’): ?>
    <p class=”stock in-stock in_stock_color”><!– Get the global or product in stock message here –></p>
    <?php endif; ?>
    <?php if($stock_status == ‘outofstock’): ?>
    <p class=”stock out-of-stock out_of_stock_color”><!– Get the global or product out of stock message here –></p>
    <?php endif; ?>
    <?php endif; ?>

    It’s getting the global or product in/out-of-stock message where I get stuck.

    skafte

    (@skafte)

    Hi @softound,

    Hope you are well and sorry to follow up on this, but I was just wondering if you have had a chance to look at this?

    It’s just that if you don’t think it will work, then I’ll start considering other options.

    Many thanks!

Viewing 15 replies - 16 through 30 (of 46 total)
  • The topic ‘Custom stock status for products with unmanaged stock’ is closed to new replies.