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_shipping_from_address', 'wt_pklist_alter_from_addr', 10, 3); | |
| function wt_pklist_alter_from_addr($fromaddress, $template_type, $order) { | |
| // Define address fields to remove from the "From" address | |
| $address_fields = [ | |
| 'address_line1', | |
| 'address_line2', | |
| 'city', | |
| 'state', |
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('wp_footer',function() { | |
| if( class_exists('Custom_Related_Products')) { | |
| ?> | |
| <style> | |
| .wt-crp-content-wrapper > .wt_cart_button { | |
| display: none; | |
| } | |
| .wt-related-products > .products > .product > .button.nbo_ajax_add_to_cart { | |
| display: none; |
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_document_button_label', 'alter_document_btn_label', 10, 4); | |
| function alter_document_btn_label($label, $action, $where, $template_type) { | |
| if ( 'invoice' === $template_type ) { | |
| // Order details page | |
| if ( 'my_account_order_details' === $where ) { | |
| // Customize the print invoice button on the order details page | |
| if ( 'print' === $action ) { |
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_grouping_term_names', 'wt_pklist_group_by_parent_cat_invoice', 10, 4); | |
| function wt_pklist_group_by_parent_cat_invoice($term_name_arr, $product_id, $template_type, $order) { | |
| if ( 'packinglist' === $template_type ) { | |
| $terms = get_the_terms($product_id, 'product_cat'); | |
| if ( $terms ) { | |
| $main_category_name = ''; | |
| $visited_terms = 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('wf_pklist_alter_product_name', 'wt_pklist_new_prodct_name_for_user', 10, 5); | |
| function wt_pklist_new_prodct_name_for_user($order_item_name, $template_type, $_product, $order_item, $order) { | |
| $target_product_id = 1186; | |
| $target_user_id = 0; | |
| if ( 'invoice' === $template_type && is_object($_product) && is_object($order) ) { | |
| $product_id = $_product->get_id(); | |
| $user_id = $order->get_user_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('wt_sequential_is_draft_order', 'wt_sequential_skip_pending_order',10,2); | |
| function wt_sequential_skip_pending_order($is_draft_order, $order){ | |
| if(!$is_draft_order && ('pending'=== $order->get_status())){ | |
| $is_draft_order = true; | |
| } | |
| return $is_draft_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 | |
| function wt_admin_show_assembly_cost_on_giftcard() { | |
| ?> | |
| <script> | |
| jQuery(document).ready(function() { | |
| setTimeout(function() { | |
| if(jQuery('._wt_gc_amounts_field').length){ | |
| jQuery('._has_assembly_field').insertAfter('._wt_gc_amounts_field'); | |
| jQuery('._disable_assembly_field').insertAfter('._wt_gc_amounts_field'); |
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 | |
| function wt_ier_delete_existing_product_in_certain_category($query_args) | |
| { | |
| $query_args['tax_query'][] = array( | |
| 'taxonomy' => 'product_cat', | |
| 'field' => 'slug', | |
| 'terms' => array('category1', 'category2', 'category3') | |
| ); | |
| return $query_args; |
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_gc_admin_coupon_set_email_restriction', '__return_false'); |
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_gc_coupon_set_email_restriction', '__return_false'); |