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
| <?php //Do not copy this line of code | |
| add_action('admin_init', 'wt_gc_add_demo_giftcard_product'); | |
| function wt_gc_add_demo_giftcard_product() { | |
| $existing_product = get_posts(array( | |
| 'post_type' => 'product', | |
| 'post_status' => array('publish', 'draft', 'pending', 'private', 'future', 'trash'), | |
| 'meta_query' => array( | |
| 'relation' => 'AND', | |
| array( |
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
| <?php //Do not copy this line of code | |
| add_filter('wt_feed_filter_product_brand', 'wt_feed_filter_product_brand', 10, 2); | |
| function wt_feed_filter_product_brand($brand, $product) { | |
| $category_id = 38; // Replace with your category ID | |
| $pid = $product->get_id(); | |
| if ($product->is_type('variation')) { | |
| $pid = $product->get_parent_id(); |
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
| <?php //Do not copy this line of code | |
| add_filter('hf_alter_csv_order_data', 'hf_alter_csv_order_data_callback', 10, 2); | |
| function hf_alter_csv_order_data_callback($order_export_data, $filter_args ) { | |
| $order_id = $order_export_data['order_id']; | |
| if( $order_id ){ | |
| $order = wc_get_order($order_id); | |
| // Get the shipping state code from the order |
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
| <?php //Do not copy this line of code | |
| add_filter('wt_feed_facebook_product_id', 'wt_feed_facebook_product_id', 10, 3); | |
| function wt_feed_facebook_product_id($fb_retailer_id, $product, $form_data) { | |
| return $product->get_id(); | |
| } |
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
| <?php //do not copy this line of code | |
| add_filter( 'wf_pklist_alter_product_table_head', 'add_total_wieght_column_head', 10, 3); | |
| function add_total_wieght_column_head( $columns_list_arr, $template_type, $order ) { | |
| if ( 'packinglist' === $template_type ) { | |
| if ( isset( $columns_list_arr['-total_weight'] ) ) { | |
| $columns_list_arr['total_weight'] = $columns_list_arr['-total_weight']; | |
| unset( $columns_list_arr['-total_weight'] ); | |
| } | |
| } |
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
| <?php //Do not copy this line of code | |
| add_filter('wf_pklist_alter_product_table_head', 'wt_pklist_remove_columns', 10, 3); | |
| function wt_pklist_remove_columns($columns_list_arr, $template_type, $order) { | |
| if ( 'deliverynote' === $template_type && is_array( $columns_list_arr ) ) { | |
| unset( $columns_list_arr['total_price'] ); | |
| unset( $columns_list_arr['price'] ); | |
| } | |
| return $columns_list_arr; |
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
| <?php //Do not add this line of code | |
| add_filter('wt_feed_filter_product_link','wt_feed_filter_product_link_utm', 10, 2); | |
| function wt_feed_filter_product_link_utm($link, $product){ | |
| return $link.'?utm_source=summer-sale&utm_medium=feed&utm_campaign=summer-sale'; | |
| } |
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
| <?php //Do not add this line of code | |
| function wt_iew_category_custom_filter_import_file($file_name, $path) { | |
| $file_pa = fopen($path, 'r'); | |
| while (($line = fgetcsv($file_pa)) !== FALSE) { | |
| $lines[] = $line; | |
| } | |
| fclose($file_pa); | |
| if (!empty($lines[0])) { | |
| $header = $lines[0]; // Assuming the header is in the first row |
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
| <?php //Do not copy this line of code | |
| add_filter('wt_pklist_alter_product_image_url', 'wt_pklist_alter_product_image_url_fn', 10, 4); | |
| /** | |
| * Filter to customize the product image URL in packing lists. | |
| * | |
| * This function allows you to set a custom image URL for a product. | |
| * If a custom image URL is available, update the `$img_url` variable to use that URL. | |
| * @return string The updated image URL to be used in the packing list. | |
| */ | |
| function wt_pklist_alter_product_image_url_fn($img_url, $product_id, $variation_id, $parent_id) { |
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
| <?php //Do not add this line of code | |
| add_filter('wf_pklist_alter_order_date', 'wt_pklist_change_order_date_format', 10, 3); | |
| function wt_pklist_change_order_date_format($order_date, $template_type, $order) { | |
| if ( is_object( $order ) ) { | |
| $order_id = is_object($order) ? $order->get_id() : ''; | |
| $order_date_format = 'd/m/y'; | |
| $order_date = get_the_date( $order_date_format, $order_id ); | |
| } | |