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
add_filter('wf_pklist_alter_package_item_quantiy', 'alter_packing_slip_quantiy', 10 , 5); | |
function alter_packing_slip_quantiy($item_quantity, $template_type, $_product, $item, $order) | |
{ | |
if($template_type=='packinglist') | |
{ | |
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 | |
add_filter('wf_pklist_alter_shipping_address','wf_pklist_alter_address_fn',10,3); | |
add_filter('wf_pklist_alter_billing_address','wf_pklist_alter_address_fn',10,3); | |
add_filter('wf_pklist_alter_shipping_from_address','wf_pklist_alter_address_fn',10,3); | |
function wf_pklist_alter_address_fn($address, $template_type, $order) | |
{ | |
$arr=array($address['postcode'], $address['city']); | |
$address['city']=implode( ", ",$arr); | |
unset($address['postcode']); |
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 | |
add_filter('wf_pklist_alter_shipping_address','wf_pklist_alter_address_fn',10,3); | |
add_filter('wf_pklist_alter_billing_address','wf_pklist_alter_address_fn',10,3); | |
add_filter('wf_pklist_alter_shipping_from_address','wf_pklist_alter_address_fn',10,3); | |
function wf_pklist_alter_address_fn($address, $template_type, $order) | |
{ | |
$arr=array($address['postcode'], $address['city']); | |
$address['city']=implode(", ",$arr); | |
unset($address['postcode']); |
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
add_filter('eh_paypal_express_checkout_button', 'webtoffee_paypal_express_checkout_button', 10, 1); | |
function webtoffee_paypal_express_checkout_button($url) { | |
$url = 'https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-medium.png'; // change this URL with the desired image URL | |
return $url; | |
} |
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
add_filter('wf_pklist_alter_additional_fields', 'webtoffee_add_order_status_in_invoice', 10, 3); | |
function webtoffee_add_order_status_in_invoice($extra_fields, $template_type, $order) { | |
$extra_fields['Order status']=$order->get_status(); | |
return $extra_fields; | |
} |
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
add_filter('wf_pklist_alter_package_item_quantiy', 'alter_packing_slip_quantiy', 10 , 5); | |
function alter_packing_slip_quantiy($item_quantity, $template_type, $_product, $item, $order) | |
{ | |
if($template_type=='packinglist') | |
{ | |
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
add_filter('wf_pklist_modify_meta_data', 'webtoffee_modify_meta_data', 10, 2); | |
function webtoffee_modify_meta_data($meta) { | |
// Below are the keys for bundled products and composite products - Change the array keys according to the needs | |
$keys = array( | |
'_bundle_group_mode', | |
'_bundle_cart_key', | |
'_bundle_weight', |
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
add_filter('eh_stripe_charge_description_details', 'webtoffee_stripe_charge_description', 10, 2); | |
function webtoffee_stripe_charge_description($description, $wc_order) { | |
$description = ''; | |
foreach ($wc_order->get_items() as $item) { | |
$description .= $item['name'] . ' * ' . $item['quantity'] . ' | '; | |
} | |
return substr_replace($description, "", -2); | |
} |
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
add_filter('wt_related_products_odrerby', function($odrerby){ | |
return 'date'; // default is 'title' -- see WP Query args for more details | |
}); | |
add_filter('wt_related_products_odrer', function($odrer){ | |
return 'DESC'; // default is 'ASC' -- see WP Query args for more 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
add_filter('wt_related_products_number', function($number){ | |
return 4; // change the number here | |
}); |
OlderNewer