add_filter( ‘wc_order_statuses’, ‘ts_rename_order_status_msg’, 20, 1 ); function ts_rename_order_status_msg( $order_statuses ) { $order_statuses[‘wc-on-hold’] = _x( ‘In attesa di pagamento’, ‘Order status’, ‘woocommerce’ ); return $order_statuses; }Continue reading
add_filter( ‘get_terms’, ‘ts_get_subcategory_terms’, 10, 3 ); function ts_get_subcategory_terms( $terms, $taxonomies, $args ) { $new_terms = array(); // if it is a product category and on the shop page if ( in_array( ‘product_cat’, $taxonomies ) && ! is_admin() &&is_shop() ) {…Continue reading
/** * Block specific coupons during set hours (1:00 PM – 3:00 PM) */ function block_coupon_during_specific_hours($valid, $coupon) { if (!$valid) return $valid; // List of coupon codes to block during specific hours $blocked_coupons = array( ‘YOUR_COUPON_CODE_HERE’, // Replace with your…Continue reading
// Add store credit info to WooCommerce new order email notification // Store credits as coupon (before tax). $coupons = $order->get_coupons(); foreach ( $coupons as $coupon ) { if ( strtolower( $coupon->get_code() ) === ‘store credit’ ) { $sc_amount =…Continue reading
if ( ! function_exists( ‘wcvendors_show_vendor_policies’ ) ) { /** * Show WC Vendors vendor policies on the vendor store page */ function wcvendors_show_vendor_policies() { if ( ! is_wcv_pro_active() ) { return; } if ( ! WCV_Vendors::is_vendor_page() ) { return; }…Continue reading
/** * Force downloadable checkbox to be checked using MutationObserver */ function force_downloadable_checkbox_checked() { ?>Continue reading
/* Styling the Cookies plugin by CookiesYes * Authored by John Foliot – Foliot Digital Accessibility Services (https://fdas.ca) */ /* * This plugin is a bugger to style – why I don’t know and I never bothered to investigate. The…Continue reading
add_action(‘pre_get_posts’, ‘change_archive_order’); function change_archive_order( $query ) { if ( $query->is_main_query() && !is_admin() && is_post_type_archive(‘post’) ) { // Replace ‘post’ with your desired post type $query->set(‘orderby’, ‘title’); $query->set(‘order’, ‘ASC’); } }Continue reading
//https://fibosearch.com/documentation/tips-tricks/how-to-search-for-brands/ add_filter( ‘dgwt/wcas/indexer/taxonomies’, function ( $taxonomies ) { $taxonomies[] = array( ‘taxonomy’ => ‘pa_brand’, ‘labels’ => array( ‘name’ => ‘Brands’, ‘singular_name’ => ‘Brand’, ), ‘image_support’ => true, ); return $taxonomies; } );Continue reading