addons
2 months ago
templates
2 months ago
check_init.php
2 months ago
feature_tab.php
2 months ago
popup.php
2 months ago
tippy.php
2 months ago
tutorial.php
2 months ago
wpml_compatibility.php
2 months ago
wpml_compatibility.php
15 lines
| 1 | <?php |
| 2 | add_filter('woocommerce_json_search_found_products', 'BR_woocommerce_json_search_found_products'); |
| 3 | function BR_woocommerce_json_search_found_products($products) { |
| 4 | if( ! empty($_GET['is_berocket']) ) { |
| 5 | $new_products = $products; |
| 6 | $products = array(); |
| 7 | $current_language = apply_filters( 'wpml_current_language', NULL ); |
| 8 | foreach($new_products as $product_id => $product_name) { |
| 9 | $product_id = apply_filters( 'wpml_object_id', $product_id, 'product', true, $current_language ); |
| 10 | $products[$product_id] = get_the_title($product_id). ' (#'.$product_id.')'; |
| 11 | } |
| 12 | } |
| 13 | return $products; |
| 14 | } |
| 15 |