/*
Theme Name: 	Betheme Child
Theme URI: 		http://themes.muffingroup.com/betheme
Author: 		Muffin group
Author URI: 	http://muffingroup.com
Description:	Child Theme for Betheme - Premium WordPress Theme
Template:		betheme
Version: 		1.6.1
*/

/* Theme customization starts here
-------------------------------------------------------------- */


.header-split #Header .top_bar_left .menu_right {
    float: right;
    text-align: center;
}
/* Añadir al carrito rapido eligiendo cantidades */
add_filter( 'woocommerce_loop_add_to_cart_link', 'ayudawp_add_cart_cantidades_loop', 9999, 3 );
function ayudawp_add_cart_cantidades_loop( $html, $product, $args ) {
if ( $product->is_purchasable() && $product->is_in_stock() && $product->supports( 'ajax_add_to_cart' ) ) {
$html = '<div style="display: inline-block; margin-right: 0.2em">' . woocommerce_quantity_input( array(), $product, false ) . '</div>' . $html;
}
return $html;
}
add_action( 'woocommerce_after_shop_loop', 'ayudawp_add_cart_cantidades' );
function ayudawp_add_cart_cantidades() {
wc_enqueue_js( "
$(document).on('change','.quantity .qty',function(){
$(this).closest('li.product').find('a.ajax_add_to_cart').attr('data-quantity',$(this).val());
});
" );
}