Support » Plugin: Image Store » Store users are not included with regular site users

Viewing 6 replies - 1 through 6 (of 6 total)
  • Prasath Mani

    (@prasathpree)

    Hey Shiyam,
    Please change bellow code in plugins/image-store/_store/cart.php

    Find & delete bellow code:

    //render buttons
    	foreach ((array)$this->opts['gateway'] as $key => $bol){
    		if( $this->in_array($key, array('wepaystage','wepayprod')) && $bol){
    
    			$data = array(
    				'type' => 'GOODS',
    				'account_id' => $this->opts['wepayaccountid'],
    				'amount' => $this->cart['total'],
    				'short_description' => __("Image Purchase"),
    				'reference_id' => $this->orderid,
    				'redirect_uri' => $this->get_permalink('receipt'),
    				'callback_uri' =>$this->get_permalink($this->imspage),
    			);
    
    			if ($this->cart['shippingcost'])
    				$data['require_shipping' ] = true;
    
    			try{ $checkout = $wepay->request('checkout/create', $data );
    			}catch(WePayException $e){ }
    
    			if(!empty( $checkout->checkout_uri ))
    				$this->gateways[$key]['url'] = $checkout->checkout_uri;
    		}
    		if ($bol){
    			$output .='<input name="' . $key . '" type="submit" value="' . esc_attr($this->gateways[$key]['name']) .
    			'" class="primary ims-google-checkout shop_btn" data-submit-url="' . esc_attr(urlencode($this->gateways[$key]['url'])) . '" /> ';
    		}
    	}

    Paste bellow code into cart.php

    global $user_ID;
    			$user_info = get_userdata($user_ID);
    			if( !is_user_logged_in() )
    			{
    				$output .='Please <a href="" class="shop_btn">Login</a> or <a href="" class="shop_btn">Register</a> to complete your shopping';
    			} else {
    	//render buttons
    	foreach ((array)$this->opts['gateway'] as $key => $bol){
    		if( $this->in_array($key, array('wepaystage','wepayprod')) && $bol){
    
    			$data = array(
    				'type' => 'GOODS',
    				'account_id' => $this->opts['wepayaccountid'],
    				'amount' => $this->cart['total'],
    				'short_description' => __("Image Purchase"),
    				'reference_id' => $this->orderid,
    				'redirect_uri' => $this->get_permalink('receipt'),
    				'callback_uri' =>$this->get_permalink($this->imspage),
    			);
    
    			if ($this->cart['shippingcost'])
    				$data['require_shipping' ] = true;
    
    			try{ $checkout = $wepay->request('checkout/create', $data );
    			}catch(WePayException $e){ }
    
    			if(!empty( $checkout->checkout_uri ))
    				$this->gateways[$key]['url'] = $checkout->checkout_uri;
    		}
    		if ($bol){
    			$output .='<input name="' . $key . '" type="submit" value="' . esc_attr($this->gateways[$key]['name']) .
    			'" class="primary ims-google-checkout shop_btn" data-submit-url="' . esc_attr(urlencode($this->gateways[$key]['url'])) . '" /> ';
    		}
    	}
       }

    Mike

    (@shiyam06)

    Hi prasathpree,

    Thanks for this,

    The code is working except one thing. When clicked login link in check out it does not takes me to the login page and just says cart update successfully. Can you help me on this.

    Thanks
    Shiyam

    Prasath Mani

    (@prasathpree)

    Hi Shiyam,

    Updated Code

    global $user_ID;
    			$user_info = get_userdata($user_ID);
    			if( !is_user_logged_in() )
    			{
    		$output .='Please <a href="'.wp_login_url(get_permalink()).'" title="Login">Login</a> or <a href="'.site_url('/wp-login.php?action=register').'" title="Register">Register</a> to complete your shopping';
    			} else {
    	//render buttons
    	foreach ((array)$this->opts['gateway'] as $key => $bol){
    		if( $this->in_array($key, array('wepaystage','wepayprod')) && $bol){
    
    			$data = array(
    				'type' => 'GOODS',
    				'account_id' => $this->opts['wepayaccountid'],
    				'amount' => $this->cart['total'],
    				'short_description' => __("Image Purchase"),
    				'reference_id' => $this->orderid,
    				'redirect_uri' => $this->get_permalink('receipt'),
    				'callback_uri' =>$this->get_permalink($this->imspage),
    			);
    
    			if ($this->cart['shippingcost'])
    				$data['require_shipping' ] = true;
    
    			try{ $checkout = $wepay->request('checkout/create', $data );
    			}catch(WePayException $e){ }
    
    			if(!empty( $checkout->checkout_uri ))
    				$this->gateways[$key]['url'] = $checkout->checkout_uri;
    		}
    		if ($bol){
    			$output .='<input name="' . $key . '" type="submit" value="' . esc_attr($this->gateways[$key]['name']) .
    			'" class="primary ims-google-checkout shop_btn" data-submit-url="' . esc_attr(urlencode($this->gateways[$key]['url'])) . '" /> ';
    		}
    	}
       }

    [ Signature moderated. ]

    Mike

    (@shiyam06)

    Hi Prasath Pree

    Thanks a lot it works great

    Prasath Mani

    (@prasathpree)

    Okay. Change the post status to resolved.

    Mike

    (@shiyam06)

    Ok sure. Thanks a lot

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Store users are not included with regular site users’ is closed to new replies.