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
<? | |
/* | |
* Add custom avaibility in stock status Woocommerce | |
*/ | |
// Add new stock status options | |
function filter_woocommerce_product_stock_status_options( $status ) { | |
// Add new statuses | |
$status['in_arrivo'] = __( 'In arrivo', 'woocommerce' ); |
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
<? | |
/* | |
* Insert and remove product automatically after certain quantity counts into cart | |
*/ | |
add_action( 'woocommerce_before_calculate_totals', 'add_remove_freebie', 50, 1 ); | |
function add_remove_freebie( $cart ) { | |
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
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 | |
/* | |
* Show only first variation dropdown product variable if user logged out - Woocommerce - Single Product Page | |
*/ | |
add_filter('woocommerce_after_add_to_cart_button','sei_partita_iva', 10, 1); | |
function sei_partita_iva(){ | |
if ( !is_user_logged_in() ) { | |
echo '<div style="margin: 20px 0 20px 0;"><h4>Hai una Partita IVA? <a href="https://www.tittex.com/mio-account/?action=register" style="color:#dd3333; text-decoration: underline;" >Registrati</a> per visualizzare i prezzi riservati per te!</h4></div>'; |
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
<? | |
/* | |
* Display current weight product based on quantity number - Woocommerce - Single Product Page - Cart - Checkout | |
*/ | |
add_action( 'woocommerce_single_product_summary','woocommerce_total_product_price', 31 ); | |
function woocommerce_total_product_price() { | |
global $woocommerce, $product; | |
//$weight = $product->get_weight() / 1000; |
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_after_add_to_cart_button','sei_partita_iva', 10, 1); | |
function sei_partita_iva(){ | |
if ( !is_user_logged_in() ) { | |
echo '<div style="margin: 20px 0 20px 0;"><h4>Hai una Partita IVA? <a href="https://staging.tittex.com/mio-account/?action=register" style="color:#dd3333; text-decoration: underline;" >Registrati</a> per visualizzare i prezzi riservati per te!</h4></div>'; | |
} | |
} | |
add_filter('woocommerce_dropdown_variation_attribute_options_args','fun_select_default_option', 10, 1); |
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 | |
/* | |
* Custom Field (Codice fiscale & Partita IVA) at checkout with conditional checkbox - Checkout - Woocommerce | |
*/ | |
add_filter( 'woocommerce_checkout_fields' , 'cbi_cf_chkbox' ); | |
function cbi_cf_chkbox ( $fields ) { | |
//if ( ICL_LANGUAGE_CODE !='it' ) return $fields; // Only for Italy |
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 | |
/** | |
* @snippet TOT remaining to Free Shipping Progress Bar @ WooCommerce Cart - Widget Cart | |
*/ | |
function goya_custom_bar_free_shipping() | |
{ | |
$current = WC()->cart->get_cart_contents_total(); |
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 filter dropdown for specific product attribute in woocommerce admin product list - Admin Page Product List | |
*/ | |
add_action('restrict_manage_posts', 'product_attribute_sorting_dropdown'); | |
function product_attribute_sorting_dropdown() { | |
global $typenow; | |
$taxonomy = 'pa_fornitori'; |