This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Add noindex meta tag to filtered pages with only one product | |
| add_action('wp_head', 'override_robots_meta_for_filtered_pages', 1); // Priority set to 1 to override Rank Math | |
| function override_robots_meta_for_filtered_pages() { | |
| if( class_exists( 'FilterEverything\Filter\Container' ) && flrt_is_filter_request() ) { | |
| global $wp_query; | |
| // Check if there's only one product on the filtered page | |
| if ( $wp_query->found_posts == 1 ) { | |
| // Remove the existing robots meta tag output by SEO plugins like Rank Math | |
| remove_action('rank_math/head', 'RankMath\\Frontend\\Robots::robots_meta'); | |
| echo '<meta name="robots" content="noindex, follow"/>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('rank_math/frontend/robots', function ($robots) { | |
| $url = home_url($_SERVER['REQUEST_URI']); | |
| if ((strpos($url, '?add_to_wishlist=') !== false) || (strpos($url, '?add-to-cart=') !== false)) { | |
| $robots["index"] = 'noindex'; | |
| $robots["follow"] = 'follow'; | |
| } | |
| return $robots; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hide_free_shipping_text() { | |
| ?> | |
| <style> | |
| .wc-block-components-totals-item__value strong, | |
| .wc-block-components-shipping-rates-control__package__description--free { | |
| display: none; | |
| } | |
| </style> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function($) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function bd_rrp_price_html( $price, $product ) { | |
| $return_string = 'Ціна: ' . $price; | |
| return $return_string; | |
| } | |
| add_filter( 'woocommerce_get_price_html', 'bd_rrp_price_html', 100, 2 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Change add to cart text on product archives page | |
| add_filter( 'woocommerce_product_add_to_cart_text', 'woocommerce_add_to_cart_button_text_archives' ); | |
| function woocommerce_add_to_cart_button_text_archives() { | |
| return __( 'КУПИТИ', 'woocommerce' ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Change add to cart text on single product page | |
| add_filter( 'woocommerce_product_single_add_to_cart_text', 'woocommerce_add_to_cart_button_text_single' ); | |
| function woocommerce_add_to_cart_button_text_single() { | |
| return __( 'КУПИТИ', 'woocommerce' ); | |
| } |