add_action( ‘wp’, ‘remove_astra_header_callback’); function remove_astra_header_callback(){ remove_action( ‘astra_header’, ‘astra_header_markup’ ); } add_action(‘wp’, ‘ast_remove_footer’); function ast_remove_footer() { remove_action(‘astra_footer’, array(Astra_Builder_Footer::get_instance(), ‘footer_markup’)); }Continue reading
add_action(‘woocommerce_checkout_create_order’, ‘add_priority_processing_to_shipping_method’, 10, 1); function add_priority_processing_to_shipping_method($order) { $has_priority_fee = false; foreach ($order->get_items(‘fee’) as $fee) { if (stripos($fee->get_name(), ‘Priority Processing’) !== false) { $has_priority_fee = true; break; } } if ($has_priority_fee) { foreach ($order->get_shipping_methods() as $shipping_method) { $shipping_method_name = $shipping_method->get_name(); if…Continue reading
/************************************************/ /* Show image of individual product */ /************************************************/ /* function show_img_producto() { global $post; // Obtener los COAs relacionados con el producto actual $related_coas = get_posts(array( ‘post_type’ => ‘coa’, ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => ‘parent_product’,…Continue reading
add_action(‘woocommerce_checkout_create_order’, function ($order, $data) { $default_postcode = ‘00000’; if (empty($order->get_billing_postcode())) { $order->set_billing_postcode($default_postcode); } }, 10, 2);Continue reading
function enqueue_custom_tabs_script() { ?>Continue reading
/***********************************************************/ /* Convert ‘transaction_id’ query string param as a cookie */ /***********************************************************/ function tune_capture_transaction_id_cookie() { if ( isset($_GET[‘tune_transaction_id’]) ) { $transaction_id = sanitize_text_field($_GET[‘tune_transaction_id’]); // Set cookie for 30 days setcookie( ‘tune_transaction_id’, // Cookie name $transaction_id, // Cookie value time() +…Continue reading
add_filter( ‘woocommerce_product_add_to_cart_text’, ‘bll_archive_custom_cart_button_text’ ); function bll_archive_custom_cart_button_text( $text ) { global $product; if ( $product && ! $product->is_in_stock() ) { return ‘Join the Waitlist’; } return $text; }Continue reading
add_action(‘wp_footer’, function () { ?>Continue reading
add_filter( ‘woocommerce_coupon_message’, ‘hide_coupon_success_message’, 10, 3 ); function hide_coupon_success_message( $msg, $msg_code, $coupon ) { if ( $msg_code === 200 ) { // 200 is the code for a successful coupon application return ”; // Return an empty string to hide the…Continue reading
add_filter(‘woocommerce_coupon_is_valid’, ‘block_employee_coupon_usage’, 10, 3); function block_employee_coupon_usage($valid, $coupon, $discount) { if (is_user_logged_in()) { $user = wp_get_current_user(); if (in_array(’employee’, (array) $user->roles) || in_array(‘owner’, (array) $user->roles)) { wc_add_notice(__(‘Employees are not allowed to use coupons.’, ‘woocommerce’), ‘error’); return false; } } return $valid; }Continue reading