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 | |
/* | |
* Hide tax rate label on subtotal cart - checkout and into email order if tax is inclusive - Woocommerce | |
*/ | |
// For Cart and checkout pages | |
add_filter( 'woocommerce_cart_totals_order_total_html', 'hide_iternational_tax_label', 20 ); | |
function hide_iternational_tax_label() { |
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 | |
/** | |
* Insert suffix Jquery if tax is exempt Woocommerce UniCPO Builder | |
*/ | |
add_filter( 'wp_footer', 'bbloomer_price_free_zero'); | |
function bbloomer_price_free_zero() { | |
if ( ! is_product() ) { |
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 | |
add_filter( 'woocommerce_cart_item_subtotal', 'kd_custom_price_message', 10, 3 ); | |
function kd_custom_price_message( $price_html, $cart_item, $cart_item_key ) { | |
if (!empty($cart_item['_cpo_calc_option'])) { | |
foreach ($cart_item as $key => $value) { | |
if(is_array($value)){ | |
if(array_key_exists('uni_cpo_iva10', $value)) { | |
$afterPriceSymbol = ' <small class="tax_label">(IVA incl. 10%)</small>'; |
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 | |
add_filter('wp_footer', 'allow_percentage_and_only_type_number_input_field'); | |
function allow_percentage_and_only_type_number_input_field(){ | |
// Only on the product page. | |
if ( ! is_product() ) { | |
return; | |
} | |
?> |
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 | |
function set_product_parent_categories( $post_id ) { | |
$category = wp_get_post_terms( $post_id, 'product_cat' ); | |
// If multiple categories are set. Bail Out | |
if (count ($category) > 1 ) return; | |
$terms = array($category[0]->term_id); | |
if ($category[0]->parent > 0){ | |
$parent = $category[0]->parent; |
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 | |
/** | |
* Rename "completed" Order Status to "shipped" | |
*/ | |
add_filter( 'wc_order_statuses', 'bbloomer_rename_completed_order_status' ); | |
function bbloomer_rename_completed_order_status( $statuses ) { | |
$statuses['wc-completed'] = 'Spedito'; |
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 | |
// Add a dropdown to filter orders by date range | |
add_action('restrict_manage_posts', 'add_shop_order_filter_by_date'); | |
function add_shop_order_filter_by_date(){ | |
global $pagenow, $typenow; | |
if( 'shop_order' === $typenow && 'edit.php' === $pagenow ) { | |
?> | |
<script> | |
jQuery(document).ready(function($) { | |
$( '#ant_filter_start_date' ).datepicker({ |