This file contains hidden or 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_table_columns', 'wt_pklist_alter_product_image_size', 10, 5); | |
add_filter('wf_pklist_alter_package_product_table_columns', 'wt_pklist_alter_product_image_size', 10, 5); | |
function wt_pklist_alter_product_image_size($product_row_columns, $template_type, $_product, $order_item, $order) { | |
if ('invoice' === $template_type) { | |
$image_id = $_product->get_image_id(); | |
if ($image_id) { | |
$image_url = wp_get_attachment_url($image_id); |
This file contains hidden or 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 coopy this line of code | |
add_filter("wt_pklist_alter_style_for_email_button", "wt_pklist_alter_document_button_style_email", 10, 2); | |
function wt_pklist_alter_document_button_style_email($style_arr, $template_type) { | |
$style_arr['background'] = '#ff0000'; //Change button background color | |
$style_arr['border-color'] = '#cc0000'; //Change border color | |
$style_arr['box-shadow'] = '0 1px 0 #990000'; //Change button shadow | |
return $style_arr; | |
} |
This file contains hidden or 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 | |
/** | |
* Hide default related products when [wt-related-products] shortcode is used | |
*/ | |
function wt_custom_hide_default_related_products() { | |
if (is_product()) { | |
global $post; | |
if ($post && has_shortcode($post->post_content, 'wt-related-products')) { | |
// Remove WooCommerce's default related products | |
remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20); |
This file contains hidden or 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 | |
/*You can fetch the Order ID based on the _order_number metadata using WooCommerce's REST API. To do this, use the following API endpoint: | |
wp-json/wc/v3/orders?meta_key=_order_number&meta_value=123 | |
Simply replace 123 with the desired order number to retrieve the corresponding Order ID.*/ | |
add_filter( 'woocommerce_rest_shop_order_object_query', function( $args, $request ) { | |
if (! empty($request['meta_key'] ) &&! empty( $request['meta_value'] ) ) { | |
$args ['meta_query'] = array( | |
array ( |
This file contains hidden or 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
//Do not copy this line of code | |
/** | |
* Set block checkout values on page load. | |
*/ | |
add_action( 'wp_head', function() { | |
?> | |
<script> | |
jQuery(document).ready(function($){ | |
setTimeout(() => wbte_set_block_checkout_values(), 100); |
This file contains hidden or 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_subtotal', 'wbte_sc_ctm_alter_cart_item_price', 1001, 2 ); | |
add_filter( 'woocommerce_cart_item_price', function( $price, $cart_item ) { | |
return wbte_sc_ctm_alter_cart_item_price( $price, $cart_item, false ); | |
}, 11, 2 ); | |
function wbte_sc_ctm_alter_cart_item_price( $price, $cart_item, $is_total = true ) | |
{ | |
$out = $price; |
This file contains hidden or 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 include this line of code | |
add_filter( 'wt_import_csv_parser_keep_bom', '__return_false' ); |
This file contains hidden or 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_stripe_same_account_for_all_sites", "__return_true"); |
This file contains hidden or 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(){ | |
?> | |
<style> | |
.wt-sc-coupon-description { float: left; background:none; opacity:0.7; line-height:22px; max-width:100%; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; } | |
</style> | |
<script> | |
jQuery(document).ready(function($){ |
This file contains hidden or 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('admin_init', 'wt_gc_add_demo_giftcard_product'); | |
function wt_gc_add_demo_giftcard_product() { | |
$existing_product = get_posts(array( | |
'post_type' => 'product', | |
'post_status' => array('publish', 'draft', 'pending', 'private', 'future', 'trash'), | |
'meta_query' => array( | |
'relation' => 'AND', | |
array( |
NewerOlder