Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi,

    You can do that by overriding templates/cart/cart.php template into your theme. Then find ‘backorder notification’ on line 72.

    // Backorder notification
    if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item['quantity'] ) )
    	echo '<p class="backorder_notification">' . __( 'Available on backorder', 'woocommerce' ) . '</p>';

    There you can replace ‘backorder’ string to ‘preorder’.

    I hope it helps.

    Thread Starter dintan

    (@dintan)

    Hi there,

    Thanks for the speedy reply.

    I tried on override my PHP file, but it doesn’t seem working. I have noticed a minor difference in my file, not sure if that is the reasons.

    // Backorder notification
    if ( $_product->backorders_require_notification() && $_product>is_on_backorder( $cart_item['quantity'] ) )
    echo '<p class="backorder_notification">' . __( 'Available for pre-order', 'swiftframework' ) . '</p>';

    Noticed that it is ‘swiftframework’ instead of ‘woocommerce’.

    Thanks ??

    __('Available for pre-order', 'swiftframework')

    The text domain is not the problem.

    Let me confirm. Have you tried to add product to cart then checked your cart page?

    Thread Starter dintan

    (@dintan)

    Oh yes, the cart page is updated.

    But what about the product description/detail page? https://www.blancheur.co/shop/product/bs001/

    Thanks.

    The code was intended for the cart page only.

    Please wait, I will get back. I am busy right now.

    Cheers!

    Hello there,

    Sorry for the late reply.

    Insert these codes on your theme’s functions.php file.

    add_filter('woocommerce_backordered_item_meta_name', 'blancheur_backordered_item_meta_name');
    function blancheur_backordered_item_meta_name(){
      return __('Preordered', 'blancheur');
    }
    
    add_filter('woocommerce_get_availability', 'blancheur_modify_availability', 10, 2);
    function blancheur_modify_availability($availability, $class){
    
      if( get_option( 'woocommerce_stock_format' ) == 'low_amount' && backorders_allowed() && backorders_require_notification() ){
        $availability = __('can be preordered', 'blancheur');
      } elseif( backorders_allowed() && backorders_require_notification() ){
        $availability = __( 'Available on preorder', 'blancheur' );
      }
    
      return array(
        'availability' => $availability,
        'class' => $class
      );
    
    }

    Let me know how it works for you.

    Cheers!

    Thread Starter dintan

    (@dintan)

    Hi there,

    Tried, it doesn’t work. It made my buttons disappear.

    Thanks ??

    Thread Starter dintan

    (@dintan)

    Hi Kharis Sulistiyono,

    I actually have another more important problem: There is no email notification for new order. I have tried my settings and solutions, can’t seem to get it fix. Do you have any advice?

    Thanks.

    Tried, it doesn’t work. It made my buttons disappear.

    Could you please tell me what button it is?

    I actually have another more important problem: There is no email notification for new order. I have tried my settings and solutions, can’t seem to get it fix. Do you have any advice?

    I think it doesn’t relate to the current topic. However, I was thinking there was similar issue solved. Could you please go here?

    Regards

    I would also like to change the “Available on backorder” language to read “Available to pre-order” on the Product page. Did you guys ever find a fix for this?

    Here’s the link to my site:
    https://www.salmonhookup.com/product/king-salmon/

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Did you guys ever find a fix for this?

    Nothing was broken – it was customisation. The snippet above has one error; the filer is passed an array of availability and class, they are not passed separately. But the concept is sound.

    If you need help, jobs.wordpress.net

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Change the "backorder" to "preorder"’ is closed to new replies.