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('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('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 | |
}); |
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
<script> | |
function getCookie(name) { | |
var re = new RegExp(name + "=([^;]+)"); | |
var value = re.exec(document.cookie); | |
return (value != null) ? unescape(value[1]) : 'no'; | |
} | |
if (getCookie('cky-consent') == 'yes' && getCookie('cookieyes-analytics') == 'yes') { |
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 or modify WooCommerce States | |
*/ | |
add_filter( 'woocommerce_states', 'webtoffee_woocommerce_states' ); | |
function webtoffee_woocommerce_states( $states ) { | |
$states['XX'] = array( | |
'XX1' => 'State 1', |
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_action( 'wp_footer', 'webtoffee_checkout_shipping_filter_it_states' ); | |
function webtoffee_checkout_shipping_filter_it_states() { | |
if ( ! is_checkout() ) { | |
return; | |
} | |
?> | |
<script> | |
jQuery(document).ready(function($) { |
OlderNewer