• Dear,

    I have activated a code snippet in order to adjust the message shown for the products that are available on back order only.

    In this case, the products say “Available on backorder. Please allow 3-5 days …” and the message gets well displayed on the product page & cart page.

    However, when the same product is added to the whishlist, this message isn’t getting displayed. Even the WooCommerce default message of backorder availability isn’t getting displayed. How come?

    Thanks a lot

    https://gevcen.tinytake.com/sf/MzQ3NDU1N18xMDQxNjgwOQ

    [ Please do not bump. ]

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    If you added this in the product page with a custom code, you have to use the same code to add this in the wishlist table.

    You can modify the template “/yith-woocommerce-wishlist/templates/wishlist-view.php”, adding it in your theme “your_theme_name/woocommerce/wishlist-view.php”.

    In your case, you have to make the next, inside this template, replace the next code:

    <?php if( $show_stock_status ) : ?>
           <td class="product-stock-status">
             <?php echo $stock_status == 'out-of-stock' ? '<span class="wishlist-out-of-stock">' . __( 'Out of Stock', 'yith-woocommerce-wishlist' ) . '</span>' : '<span class="wishlist-in-stock">' . __( 'In Stock', 'yith-woocommerce-wishlist' ) . '</span>'; ?>
            </td>
    <?php endif ?>

    By this new one:

    <?php if( $show_stock_status ) : ?>
        <td class="product-stock-status">
            <?php
            $get_stock_status = $product->get_stock_status();
    
            if ( $get_stock_status == 'onbackorder'){
               echo '<span class="wishlist-in-stock">' . __( 'Available on backorder. Please allow 3-5 days', 'yith-woocommerce-wishlist' ) . '</span>';
             }
             if ( $get_stock_status == 'out-of-stock'){
               echo'<span class="wishlist-out-of-stock">' . __( 'Out of Stock', 'yith-woocommerce-wishlist' ) . '</span>';
              }
              if ( $get_stock_status == 'instock'){
                echo '<span class="wishlist-in-stock">' . __( 'In Stock', 'yith-woocommerce-wishlist' ) . '</span>';
               }
               ?>
         </td>
    <?php endif ?>

    Could you check it and let us know if you have any doubt, please?

    Have a nice day!

    • This reply was modified 5 years, 7 months ago by YITHEMES.
    Thread Starter gevcen

    (@gevcen)

    Thanks for the code. I just have question about the edit.

    Have a look at my video here : https://gevcen.tinytake.com/tt/MzQ5MjEyOV8xMDQ4MDg2Nw

    Also, you told me to edit the parent theme, but that means I would lose things upon updating my theme right?

    [ Please do not bump. ]

    Plugin Author YITHEMES

    (@yithemes)

    Hello there,

    I hope you are doing well!

    Unfortunately, the video does not load correctly.

    About your question:

    If you have a parent theme, you will lose all the change when you update it.
    We recommend you to create a child theme and put the custom files there. In this way, you will not lose any change in updating the theme.

    Have a nice day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stock value not properly adjusted’ is closed to new replies.