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 | |
// Aggiungi un menu a discesa per filtrare gli ordini per stato e nazione | |
add_action('restrict_manage_posts', 'add_shop_order_filter_by_state_and_country'); | |
function add_shop_order_filter_by_state_and_country(){ | |
global $pagenow, $typenow; | |
if( 'shop_order' === $typenow && 'edit.php' === $pagenow ) { | |
// Ottieni i codici dei paesi disponibili con i codici/nomi degli stati | |
$nazioni = WC()->countries->get_allowed_country_states(); |
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 | |
if ( ! defined( 'ABSPATH' ) ) exit(); | |
/* | |
Plugin Name: Additional Order Filters for WooCommerce | |
Description: Adds additional order filters for WooCommerce | |
Version: 1.10 | |
Author: Anton Bond | |
Author URI: facebook.com/antonbondarevych | |
License: GPL2 | |
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 | |
// Display the custom actions on admin Orders bulk action dropdown | |
add_filter('bulk_actions-edit-shop_order', 'orders_bulk_action_delivery_collect_calc'); | |
function orders_bulk_action_delivery_collect_calc($bulk_actions) | |
{ | |
$bulk_actions['delivery-collect'] = __("Calcolo quantità degli ordini", 'woocommerce'); | |
return $bulk_actions; | |
} |
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 | |
// Register a new column that will show if an order was a first order for a customer | |
add_filter( 'manage_edit-shop_order_columns', 'register_is_first_order_column', 10, 1 ); | |
function register_is_first_order_column( $columns ) { | |
$columns['is_first_order'] = 'Primo ordine'; | |
return $columns; | |
} | |
// Show a checkmark emoji in the column if it's true | |
add_action( 'manage_shop_order_posts_custom_column', 'display_is_first_order_column', 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 | |
/** | |
* First Order Coupon Manager for WooCommerce | |
*/ | |
class FirstOrderCouponManager | |
{ | |
public function __construct(){} |
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 | |
// Concatenate remove link after item qty | |
function filter_woocommerce_checkout_cart_item_quantity( $product_quantity, $cart_item, $cart_item_key ) { | |
// Trash icon remove item | |
$remove_link = apply_filters('woocommerce_cart_item_remove_link', sprintf( | |
'<a href="%s" rel="nofollow" class="remove"><svg style="color: red; margin-left: 10px;" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16"> <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" fill="red"></path> <path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" fill="red"></path> </svg></a>', esc_url(wc_get_cart_remove_url($cart_item_key)), | |
__('R |
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 | |
// Concatenate remove link after item qty | |
function filter_woocommerce_checkout_cart_item_quantity( $item_qty, $cart_item, $cart_item_key ) { | |
$remove_link = apply_filters('woocommerce_cart_item_remove_link', | |
sprintf( | |
'<a href="#" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s" data-cart_item_key="%s"><svg style="color: red; margin-left: 10px;" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16"> <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" fill="red"></path> <path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" fill="red"></path> </svg> | |
</a>', | |
__( 'Remove this |
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( 'gettext', 'bt_rename_coupon_field_on_cart', 10, 3 ); | |
add_filter( 'woocommerce_coupon_error', 'bt_rename_coupon_label', 10, 3 ); | |
add_filter( 'woocommerce_coupon_message', 'bt_rename_coupon_label', 10, 3 ); | |
add_filter( 'woocommerce_cart_totals_coupon_label', 'bt_rename_coupon_label',10, 1 ); | |
add_filter( 'woocommerce_checkout_coupon_message', 'bt_rename_coupon_message_on_checkout' ); | |
/** | |
* WooCommerce | |
* Change Coupon Text |
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 opacity certain element on sroll width ID class css script | |
*/ | |
add_action('wp_footer', 'add_this_script_footer'); | |
function add_this_script_footer(){?> | |
<script> |
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 | |
// Display Product settings Fields | |
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' ); | |
function woo_add_custom_general_fields() { | |
woocommerce_wp_text_input( array( | |
'id' => '_spedizione_gg', | |
'label' => __( 'Note Spedizione', 'woocommerce' ), | |
'placeholder' => 'Spedito tra...', | |
'desc_tip' => 'true', |