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-related-products .owl-theme .owl-nav { margin-top: 25px !important; } | |
</style> | |
<?php | |
},10); |
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_iew_importer_do_import_basic', 'filter_products_by_brand', 1, 4); | |
function filter_products_by_brand($data_arr, $to_process, $step, $selected_template_data) { | |
// Define allowed brands (normalized to uppercase and trimmed) | |
$allowed_brands = array_map('strtoupper', array_map('trim', array('Brand1', 'Brand2', 'Brand3'))); | |
foreach ($data_arr as $key => $product) { | |
if (isset($product['meta_mapping_fields']['taxonomies']['tax:product_brand'])) { | |
$raw_brand = $product['meta_mapping_fields']['taxonomies']['tax:product_brand']; |
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 () { | |
if (is_product()) { | |
?> | |
<script> | |
jQuery(document).ready(function () { | |
const container = jQuery('.wt-related-products'); | |
if (container.length > 0) { | |
const h1 = container.find('.wt-crp-heading'); | |
if (h1.length) { |
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_smart_coupon_display_invalid_coupons', '__return_false' ); | |
add_filter( 'wt_sc_alter_user_coupons', 'wbte_sc_remove_applied_coupons_from_user_coupons' ); | |
if ( ! function_exists( 'wbte_sc_remove_applied_coupons_from_user_coupons' ) ) { | |
/** | |
* Remove applied coupons from user coupons list | |
* | |
* @param array $post_ids Array of coupon post IDs. |
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 () { | |
if (is_product()) { | |
?> | |
<script> | |
jQuery(document).ready(function () { | |
const container = jQuery('.wt-related-products'); | |
if (container.length > 0) { | |
const h2 = container.find('.wt-crp-heading'); | |
if (h2.length) { |
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_template_html', 'wt_remove_tax_items_row_from_invoice', 10, 2); | |
function wt_remove_tax_items_row_from_invoice( $html, $template_type ) { | |
if ( $template_type === 'invoice' && strpos( $html, 'data-row-type="wfte_tax_items"' ) !== false ) { | |
// Only run regex if pattern likely exists | |
$html = preg_replace( | |
'/<tr[^>]*data-row-type="wfte_tax_items"[^>]*>.*?<\/tr>/is', | |
'', | |
$html | |
); |
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_find_replace','wf_pklist_alter_fee_details',10,6); | |
function wf_pklist_alter_fee_details($find_replace, $template_type, $order, $box_packing, $order_package, $html) | |
{ | |
if($template_type=='invoice') | |
{ | |
$order_id = (WC()->version < '2.7.0') ? $order->id : $order->get_id(); | |
$user_currency=get_post_meta($order_id, '_order_currency', true); | |
$fee_details=$order->get_items('fee'); | |
if(!empty($fee_details)) |
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_template_html', 'wt_pklist_change_product_table_body_bg_font', 10, 2); | |
function wt_pklist_change_product_table_body_bg_font($html, $template_type) { | |
if ('invoice' === $template_type) { // or 'packinglist' if needed | |
$html .= '<style type="text/css"> | |
.wfte_product_table_head th { | |
font-size: 18px; /* Font size for header */ | |
} | |
.wfte_product_table_body td, |
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('woocommerce_order_item_meta_end', function($item_id, $item, $order, $plain_text) { | |
$product = $item->get_product(); | |
if (!$product) return; | |
$weight = $product->get_weight(); | |
if(!empty($weight)){ | |
echo '<br><b class="wt_product_weight">' . __('Weight:', 'woocommerce') . '</b> ' . ($weight . ' ' . get_option('woocommerce_weight_unit') ); | |
} | |
} |
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); |
NewerOlder