Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter objectiu40

    (@objectiu40)

    Ah,

    I asume that “auto redirect” in Woocommerce settings is enabled.

    ??

    Thread Starter objectiu40

    (@objectiu40)

    Yes, I solved it.

    Is necessary to add some code in brs plugin folder –
    assets/js/uou-booking-calculate-cost.js

    From line 132…

    This is the original code:

    ).then(function( data, textStatus, jqXHR ) {
            //console.log(data);
    	var this_page = window.location.toString();
    	this_page = this_page.replace( 'add-to-cart', 'added-to-cart' );
    	location.reload();
    
    });
    
    e.preventDefault();

    and this is the modification:

    ).then(function( data, textStatus, jqXHR ) {
            //console.log(data);
    	var this_page = window.location.toString();
    	this_page = this_page.replace( 'add-to-cart', 'added-to-cart' );
    	location.reload();
    
    // my added code here:
    	if ( wc_add_to_cart_params.cart_redirect_after_add === 'yes' ) {
    
    	window.location = wc_add_to_cart_params.cart_url;
    	return;
    
    	}
    
    });
    
    e.preventDefault();

    Also, is necessary to comment the line:

    // wc_add_to_cart_message( $single_product_id );

    in the file uou-booking-calculate-cost.php located in includes in order to prevent the duplicated messages when redirect auto to the Cart.

Viewing 2 replies - 1 through 2 (of 2 total)