Redirect after cart

HomeSupportImage StoreRedirect after cart

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #56753
    andrew
    Participant

    I would make sure that after the user enter the picture into Cart, after cart successfully updated, is redirected to the payment.
    I’m interested, where I see page size, select, quantity.
    Otherwise, so the user loses in the system for too many steps. If you do a redirect when use click buy now. It will be more simple.

    #56787
    andrew
    Participant

    It’s possibile redirect user for payment ? Because more step now for clients.

    #56789
    Xpark Media
    Keymaster

    @andrew,

    Your question is not very clear, do you want to redirect the user just after they add a product to the cart?

    To redirect users you can use javascript

    <script type="text/javascript">
    <!--
    window.location = "http://www.google.com/"
    //-->
    </script>

    or wordpress using wp_redirect()

    #56792
    andrew
    Participant

    Yes, but the problem is make when $messages == 1

    if ( isset( $_COOKIE[ 'ims_message_' . COOKIEHASH ] ) ) {
    			$messages = array(
    				'1' => __( 'Carrello aggiornato con successo', 'ims' ),
    				
    				'2' => __( 'Aggiornamento con successo', 'ims' ),
    			);
    			$this->message = $messages[ $_COOKIE[ 'ims_message_' . COOKIEHASH ] ];
    		}
    

    Thanks support

    #56798
    Xpark Media
    Keymaster

    @andrew,

    if you use the wordpress php option wp_redirect(); and set the cookie, also you can use javascript to set the cookie or display your own message.

    #56804
    andrew
    Participant

    I’m try in this mode, but not working. Where is the error?

    if ( isset( $_COOKIE[ 'ims_message_' . COOKIEHASH ] ) ) {
    			$messages = array(
    				'1' => __( 'Carrello aggiornato con successo', 'ims' ),
    				'2' => __( 'Aggiornamento con successo', 'ims' ),
    			);
    			$this->message = $messages[ $_COOKIE[ 'ims_message_' . COOKIEHASH ] ];
    			
    		  if ($messages[ $_COOKIE[ 'ims_message_' . COOKIEHASH ]] == 'true' && $messages == '1' ) {
    			wp_redirect( 'http://www.example.com', 301 ); exit;  
    			  
    		  }
    #56809
    Xpark Media
    Keymaster

    The form is submitted using ajax, the code above does redirect on the ajax call but not the user page.

    What you wan to do is bind a javascript function to the submit botton

    $( 'body' ).delegate( 'input[name="ims-add-to-cart"]', 'click', function( e ){
    
     $(document).bind( "ajaxComplete", function(){
       window.location = "http://www.google.com/"
     })
    
    }
    #56813
    andrew
    Participant

    Oh great, work perfectly. Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.