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', 10, 5); | |
function wt_pklist_new_prodct_name($order_item_name, $template_type, $_product, $order_item, $order) | |
{ | |
if( 'invoice' === $template_type ){ | |
$qty = $order_item->get_quantity(); | |
if( $qty >= 2 ){ | |
$order_item_name = '<span style="color: red;" >'.$order_item_name.'</span>'; | |
} |
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 add this line of code | |
add_filter('wf_pklist_alter_product_name', 'wt_pklist_new_prodct_name', 10, 5); | |
function wt_pklist_new_prodct_name($order_item_name, $template_type, $_product, $order_item, $order) | |
{ | |
if( 'invoice' === $template_type ){ | |
$order_item_name = '<span style="color: red;" >'.$order_item_name.'</span>'; | |
} | |
return $order_item_name; | |
} |
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_item_quantiy', 'wt_alter_invoice_quantiy', 10 , 5); | |
function wt_alter_invoice_quantiy($item_quantity, $template_type, $_product, $item, $order) | |
{ | |
if( 'invoice' === $template_type ) | |
{ | |
if( $item_quantity>1 ) | |
{ | |
$item_quantity = '<span style="color:red;">'.$item_quantity.'</span>'; | |
} |
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_add_custom_css','wt_pklist_alter_border_style',10,2); | |
function wt_pklist_alter_border_style($custom_css,$template_type) | |
{ | |
if( 'invoice' === $template_type ) | |
{ | |
$custom_css.='body{ margin:30px !important; border:1px solid #000; }'; | |
} | |
return $custom_css; | |
} |
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_find_replace','wt_pklist_show_order_total' ,10,6); | |
function wt_pklist_show_order_total($find_replace, $template_type, $order, $box_packing, $order_package, $html) | |
{ | |
if( 'invoice' === $template_type ) | |
{ | |
$order_id = (WC()->version < '2.7.0') ? $order->id : $order->get_id(); | |
$user_currency = get_post_meta($order_id, '_order_currency', true); | |
$total_price = (WC()->version< '2.7.0' ? $order->order_total : get_post_meta($order_id,'_order_total',true)); | |
if( !empty( $total_price ) ) |
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_cli_excluded_google_vendor_list','wt_excluded_google_vendor_list'); | |
function wt_excluded_google_vendor_list($vendor_list){ | |
return array('61');//key for restrict the provider_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 add this line of code | |
add_filter('wf_pklist_alter_tax_inclusive_text','wf_pklist_remove_tax_text',10,3); | |
function wf_pklist_remove_tax_text($incl_tax_text, $template_type, $order) | |
{ | |
if($template_type=='invoice') | |
{ | |
$incl_tax_text='Incl. GST'; | |
} | |
return $incl_tax_text; | |
} |
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_find_replace', 'wt_pklist_alter_total_fee', 10, 6); | |
function wt_pklist_alter_total_fee($find_replace, $template_type, $order, $box_packing, $order_package, $html) { | |
if ('invoice' === $template_type && !empty($order)) { | |
if (is_object($order)) { | |
$order_id = method_exists($order, 'get_id') ? $order->get_id() : $order->id; | |
$user_currency = get_post_meta($order_id, '_order_currency', true); | |
$fee_details = $order->get_items('fee'); | |
if (!empty($fee_details)) { |
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_tax_inclusive_text','wf_pklist_remove_tax_text',10,3); | |
function wf_pklist_remove_tax_text($incl_tax_text, $template_type, $order) | |
{ | |
if( 'invoice' === $template_type ) | |
{ | |
$incl_tax_text = ''; | |
} | |
return $incl_tax_text; | |
} |
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_sc_alter_giveaway_cart_item_data_before_add_to_cart', function( $cart_item_data, $product_id, $variation_id, $quantity ){ | |
if( isset( $cart_item_data['free_product'] ) && 'wt_give_away_product' === $cart_item_data['free_product'] ){ | |
$_POST['wps_wpr_verify_cart_nonce'] = wp_create_nonce( 'wps-cart-nonce' ); | |
} | |
return $cart_item_data; | |
}, 10, 4 ); |
NewerOlder