borkolivic

Custom poruka na stranici s 0 rezultata pretrage

Dec 8th, 2021
1,071
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action( 'woocommerce_no_products_found', function(){
  2.     remove_action( 'woocommerce_no_products_found', 'wc_no_products_found', 10 );
  3.     // dohvati pojam pretrage
  4.     $search_query = get_search_query();
  5.     // Promijeni tekst poruke
  6.     $message = __( 'Nema rezultata pretrage za pojam '. $search_query.'. <a href="/kontakt/">Kontaktiraj nas</a>', 'woocommerce' );
  7.  
  8.     echo '<p class="woocommerce-info">' . $message .'</p>';
  9. }, 9 );
RAW Paste Data