Advertisement
Guest User

Untitled

a guest
Feb 4th, 2022
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <?php
  2. // Change WooCommerce "Related products" text - But makes Similar hotels untranslateable
  3.  
  4. add_filter('gettext', 'change_rp_text', 10, 3);
  5. add_filter('ngettext', 'change_rp_text', 10, 3);
  6.  
  7. function change_rp_text($translated, $text, $domain)
  8. {
  9. if ($text === 'Related products' && $domain === 'woocommerce') {
  10. $translated = esc_html__('Similar hotel deals', $domain);
  11. }
  12. return $translated;
  13. }
  14.  
  15.  
  16. /**
  17. * Rename product data tabs - but makes Booking information untranslatable
  18. */
  19. add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
  20.  
  21. function woo_rename_tabs( $tabs ) {
  22. $tabs['additional_information']['title'] = __( 'Booking information' ); // Rename the additional information tab
  23.  
  24. return $tabs;
  25. }
  26.  
  27.  
  28. // Change default sorting in Woocommerce to A to Z - bit makes Sort from A to Z untranslatable
  29. add_filter( 'woocommerce_catalog_orderby', 'misha_rename_default_sorting_options' );
  30.  
  31. function misha_rename_default_sorting_options( $options ){
  32.  
  33. unset( $options[ 'menu_order' ] ); // remove
  34. $options[ 'menu_order' ] = 'Sort from A to Z'; // rename
  35.  
  36. return $options;
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement