[insert_php]
$idprod = 923;

$test = ( isset($_GET[‘test’]) ? 1 : 0);

if (test==1) echo “idprod:”.$idprod;

if( is_cart() ) {
// Set the product ID to remove
// Cycle through each product in the cart
foreach( WC()->cart->cart_contents as $prod_in_cart ) {
// Get the Variation or Product ID
$prod_id = ( isset( $prod_in_cart[‘variation_id’] ) && $prod_in_cart[‘variation_id’] != 0 ) ? $prod_in_cart[‘variation_id’] : $prod_in_cart[‘product_id’];
// Check to see if IDs match
if( $idprod == $prod_id ) {
// Get it’s unique ID within the Cart
$prod_unique_id = WC()->cart->generate_cart_id( $prod_id );
// Remove it from the cart by un-setting it
unset( WC()->cart->cart_contents[$prod_unique_id] );
}
}
}

if (isset($_GET[‘precio’])) $precio=intval($_GET[‘precio’]); else $precio=1;
if (test==1) echo “Precio:”.$precio;

if ($precio >= 0) {WC()->cart->add_to_cart($idprod, $precio); $precio=-1;}

if (isset($_GET[‘ReservaID’])) $ReservaID=intval($_GET[‘ReservaID’]); else $ReservaID=0;
if (test==1) echo “,ReservaID:”.$ReservaID;

$user_id = wp_get_current_user()->ID;

if (test==1) echo “,User_Id:”.$user_id;

UserUpdMetaKey($user_id,”ReservaID”,”ReservaID”, $ReservaID);
UserUpdMetaKey($user_id,”last_name”,”billing_last_name”);
UserUpdMetaKey($user_id,”first_name”,”billing_first_name”);
UserUpdMetaKey($user_id,”phone_number”,”billing_phone”);
UserUpdMetaKey($user_id,”billing_email”,”billing_email”,wp_get_current_user()->user_email);
UserUpdMetaKey($user_id,”ReservaID”,”order_referencia”,$ReservaID);

if (isset($_GET[‘viajepax’])) $viajepax=intval($_GET[‘viajepax’]); else $viajepax=4;
if (isset($_GET[‘viajefecha’])) $viajefecha=$_GET[‘viajefecha’]; else $viajefecha=”04-12-2017″;

UserUpdMetaKey($user_id,”viajepax”,”viajepax”, $viajepax);
UserUpdMetaKey($user_id,”viajefecha”,”viajefecha”, $viajefecha);

if (test==1) echo “,viajepax:”.$viajepax;
if (test==1) echo “,viajefecha:”.$viajefecha;

[/insert_php]

[woocommerce_cart]

WhatsApp Atención Lunes a Viernes de 8 a 20 hs y Sábados de 9 a 15 hs.