Woocommerce

Quitar regiones al state field del checkout woocommerce

add_filter( 'woocommerce_states', 'custom_us_states', 10, 1 ); function custom_us_states( $states ) { $non_allowed_us_states = array( 'CL-AI', 'CL-AN', 'CL-AP', 'CL-AR', 'CL-AT', 'CL-BI', 'CL-CO', 'CL-LI', 'CL-LL', 'CL-LR', 'CL-MA', 'CL-ML', 'CL-NB', 'CL-TA', 'CL-VS'); //…

Leer más

Actualizar el contador del carrito, cuando se usa ajax

function update_cart_count($fragments) { $link = '<li id="shopping-cart-header" class="float-left"><a href="' . get_permalink(9) . '"><i class="fas fa-shopping-cart"></i>&nbsp;' . WC()->cart->get_cart_contents_count() . ' Mi carro</a></li>'; $fragments['li#shopping-cart-header'] = $link; return $fragments; } add_filter('woocommerce_add_to_cart_fragments', 'update_cart_count');

Leer más

Métodos del objeto $orden

Array ( [0] get_data_without_line_items [1] get_line_item_data [2] add_filters [3] order_class_name [4] get_report_customer_id [5] is_returning_customer [6] get_customer_first_name [7] get_customer_last_name [8] payment_complete [9] get_formatted_order_total [10] save [11] set_status [12] maybe_set_date_paid [13] update_status…

Leer más