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

    (@itailulu)

    I think I got it.
    had to add:

    $session = WP_Session::get_instance();
    echo '<pre>';
    $data = $session->toArray();
    print_r($data);
    echo '</pre>';

    on page 2.

    Cool.
    Thanks for the plugin, very useful!

    Got a solution.Updating here,may be it will help someone oneday. :

    if(isset($_POST['id']))
    		{
    		echo "<h2 id='bookingResult' > You are successfully added to your Cart </h2>"."ID=".$_POST['id'];
    		$wp_session = WP_Session::get_instance();
    
    			if(isset($wp_session['ym_cart']) && !empty($wp_session['ym_cart']))
    						{
    						$temp_array = $wp_session['ym_cart']->toArray();
    						array_push($temp_array,$_POST['id']);
    						$wp_session['ym_cart']=$temp_array;
    						}
    					else
    						{
    						$wp_session['ym_cart']= array();
    						$wp_session['ym_cart'][]=$_POST['id'];
    						}
    
    	//	print_r($wp_session['ym_cart']);
    		echo '<pre>';
    $data = $wp_session['ym_cart']->toArray();
    print_r($data);
    echo '</pre>';
    
    	    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can't pass an array’ is closed to new replies.