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_action( 'woocommerce_new_coupon', 'wbte_sc_show_new_coupon_in_my_account', 20 ); | |
add_action( 'woocommerce_process_shop_coupon_meta', 'wbte_sc_show_new_coupon_in_my_account', 20 ); | |
function wbte_sc_show_new_coupon_in_my_account( $coupon_id ) { | |
$location_data = get_post_meta( $coupon_id , '_wc_make_coupon_available', true ); | |
if ( $location_data ) { | |
$locations = explode( ',', $location_data ); | |
if ( ! in_array( 'my_account', $locations ) ) { |
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_woocommerce_product_importer_pre_parse_data', 'wt_alter_image_urls'); | |
function wt_alter_image_urls($data) { | |
// Check if 'images' key exists in the data array | |
if (isset($data['images'])) { | |
// Split the images string into an array | |
$image_urls = explode(', ', $data['images']); | |
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( 'wbte_sc_clear_error_before_coupon_auto_apply', '__return_false' ); |
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_head', 'wt_cli_consent_mode_integration', 9); | |
function wt_cli_consent_mode_integration() { | |
if (!class_exists('Cookie_Law_Info')) { | |
return; | |
} | |
$cli_bypass = isset($_GET['cli_bypass']) ? 1 : 0; | |
$cli_advertisement_cookie = isset($_COOKIE['cookielawinfo-checkbox-advertisement']) ? $_COOKIE['cookielawinfo-checkbox-advertisement'] : 'no'; | |
$cli_functional_cookie = isset($_COOKIE['cookielawinfo-checkbox-functional']) ? $_COOKIE['cookielawinfo-checkbox-functional'] : 'no'; |
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 copyt this line of code | |
add_filter('wf_pklist_alter_product_table_head', 'wt_pklist_add_product_column', 10, 3); | |
function wt_pklist_add_product_column($columns_list_arr, $template_type, $order) { | |
if( 'invoice' == $template_type ) { | |
$out=array(); | |
foreach ( $columns_list_arr as $key => $value ) { | |
$out[$key]=$value; | |
if('price' == $key || '-price' == $key ) { | |
$out['wfte_product_table_discount_amount']=__('Discount Amount'); | |
$out['wfte_product_table_discount_percentage']=__('Discount Percentage'); |
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( 'woocommerce_cart_item_class', function($excisting_class, $cart_item, $cart_item_key ){ | |
$product = $cart_item['data']; | |
$categories = $product->get_category_ids(); | |
$prefix = "wt_sc_product_category_"; | |
$categories = array_map(function($element) use ($prefix) { | |
return $prefix . $element; | |
}, $categories); | |
$categories = implode(" ", $categories); | |
return $excisting_class . ' ' . $categories; |
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_the_css_in_templates',10,3); | |
function wt_pklist_alter_the_css_in_templates($custom_css,$template_type,$template_for_pdf) | |
{ | |
if("invoice" === $template_type) | |
{ | |
$custom_css.='*{font-family: serif !important;}'; // change the font family, and make sure your language in this font is supported in pdf. This will work only on domPdf | |
} | |
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 copyt this line of code | |
add_filter('wt_pklist_alter_document_button_label','alter_btn_label',10,4); | |
function alter_btn_label($label,$action,$where,$template_type) { | |
if( "invoice" === $template_type) { | |
if("print" === $action) { | |
$label = __("Print Invoice","print-invoices-packing-slip-labels-for-woocommerce"); // Change label for print invoice button on my account order list, order details and order mail | |
} | |
if("download" === $action) { | |
$label = __("Download Invoice","print-invoices-packing-slip-labels-for-woocommerce"); // Change label for download invoice button on my account order list and order details pages |
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('woocommerce_order_status_changed', 'wt_woocommerce_order_status_changed', 10, 3); | |
function wt_woocommerce_order_status_changed($order_id, $old_status, $new_status) | |
{ | |
if(!$order_id){ | |
return; | |
} | |
$order = wc_get_order($order_id); | |
if(!$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 | |
add_filter('wt_woomail_no_order_body_text','wbtf_add_custom_placeholder_to_user_emails',10,2); | |
function wbtf_add_custom_placeholder_to_user_emails($body_text, $email) { | |
if ( is_a( $email->object, 'WP_User' ) ) { | |
$body_text = str_replace( '{custom_value}', 'Actual data to replace', $body_text ); // Replace placeholder and value here | |
} |