• Hi
    for creating a cart plugin I need to use widget.
    widget code area is in other file that has been connected with required_once to main page.
    but when I click to add cart for increasing amount of goods, the counter in widget area count number of goods after two click although SESSION is two.
    here is sample of widget page.

    class product_widget extends WP_Widget
    {
    	public function __construct()
    	{
    		$option=array('description'=>'نمایش سبد خرید ,دکمه ثبت خرید و خالی کردن سبد خرید');
            parent::__construct('wp_product','shop : سبد خرید',$option);
    	}
    	public function widget($args,$instance)
    	{
    		var_dump($_SESSION['cart']);
    		//unset($_SESSION['cart']);
    	}
    	public function form($instance)
    	{
    
    	}
    	public function update($new_instance,$old_instance)
    	{
    
    	}
    }

    it’s sounds good that when I use var_dump for session in main plugin page it’s correct

The topic ‘set session with delay’ is closed to new replies.