This file contains 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 no copy this line of code | |
add_filter('wt_gc_alter_giftcard_predifined_amounts',function($predefined){ | |
if(class_exists('WOOMULTI_CURRENCY_F')){ | |
$curcy_currency_settings = WOOMULTI_CURRENCY_F_Data::get_ins(); | |
$currency_list = $curcy_currency_settings->get_list_currencies(); | |
$current_currency = $curcy_currency_settings->get_current_currency(); | |
$current_currency_rate = floatval( $currency_list[ $current_currency ]['rate'] ); | |
foreach($predefined as $key => $value){ |
This file contains 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_currency_symbol', 'wt_pklist_alter_currency_symbol_fun', 9999, 5); | |
function wt_pklist_alter_currency_symbol_fun($wc_currency_symbol, $symbols, $user_currency, $order, $price) { | |
if ( $order instanceof WC_Order ) { | |
$currency = $order->get_currency(); | |
$symbols = get_woocommerce_currency_symbols(); | |
return $symbols[$currency] ?? $wc_currency_symbol; | |
} |
This file contains 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) { | |
if ( 'shippinglabel' === $template_type ) { | |
// Define address fields to remove from the "From" address | |
$address_fields = [ | |
'address_line1', | |
'address_line2', | |
'city', |
This file contains 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 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 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 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 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 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 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'); |
NewerOlder