Advertisement
Guest User

Untitled

a guest
May 29th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?php
  2.  
  3. function backorder_text( $availability, $product ) {
  4.  
  5. $product_ids = array( 1, 2, 3, 4, 5 );
  6.  
  7.  
  8. if ( in_array( $product->get_id(), $product_ids ) ){
  9.  
  10. foreach( $availability as $i ) {
  11. $availability = str_replace( 'Available on backorder', 'This item may take 3-4 weeks to deliver', $availability );
  12. }
  13. }
  14.  
  15.  
  16. return $availability;
  17.  
  18. }
  19.  
  20. add_filter('woocommerce_get_availability', 'backorder_text', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement