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 webtoffee_import_additional_product_variation_images($post_data = array()) { | |
| $key = array_search('woo_variation_gallery_images', array_column($post_data['postmeta'], 'key')); | |
| if (isset($key) && !empty($key) && isset($post_data['postmeta'][$key]['value']) && !empty($post_data['postmeta'][$key]['value'])) { | |
| $imge_urls = explode(',', $post_data['postmeta'][$key]['value']); | |
| if ($imge_urls) { | |
| foreach ($imge_urls as $url) { | |
| $filename = substr(basename($url), 0, -5); |
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 webtoffee_export_additional_product_variation_images($row = array(), $pid = '', $header_row = array()) { | |
| $key = array_search('"meta:woo_variation_gallery_images"', $header_row); | |
| if (isset($row[$key]) && !empty($row[$key])) { | |
| $attachment_ids = json_decode($row[$key]); | |
| foreach ($attachment_ids as $id) { | |
| $attached_file_url[] = wp_get_attachment_url($id); | |
| } | |
| $row[$key] = implode(',', $attached_file_url); |
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('wt_related_products_number', function($number){ return 4; } ); |
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('hf_user_permission_roles', 'add_additional_user_role', 10, 1); | |
| function add_additional_user_role($wf_roles) { | |
| array_push($wf_roles, 'current-role-slug'); | |
| return $wf_roles; | |
| } |
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
| /** | |
| * Check woo-commerce plugin is installed and activated or not. | |
| * @return bool | |
| */ | |
| if ( ! function_exists( 'is_woocommerce_activated' ) ) { |
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 scripts_list() { | |
| $scripts = array( | |
| array( | |
| 'id' => 'googletranslator', | |
| 'label' => 'GoogleTranslator', | |
| 'key' => array('translate.google.com/translate_a/element.js'), | |
| 'category' => 'analytics', | |
| 'status' => 'yes' | |
| ), | |
| ); |
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
| //Hide email | |
| add_filter('wf_alter_billing_email', 'wt_alter_billing_email', 10,2); | |
| function wt_alter_billing_email($email, $order_id){ | |
| $email = ''; | |
| return $email; | |
| } |
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
| //Hide phone number | |
| add_filter('wf_alter_billing_phone_number', 'wt_alter_billing_phone_number', 10,2); | |
| function wt_alter_billing_phone_number($number, $order_id){ | |
| $number = ''; | |
| return $number; | |
| } |