"Pay now" email link error

  • Posts: 68
  • Thank you received: 8
  • Hikashop Business
11 years 3 weeks ago #130298

When a user creates an order a creation email is sent to them. This email includes a "Pay now" link. The link works fine if they are logged in to my website but if they are not it comes up with an error message "The payment method could not be found" and instead of redirecting them to a login page it actually creates a blank order! (see attached)

The payment method I am using is paypal.

Attachments:
Last edit: 11 years 3 weeks ago by MumsHealth.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 3 weeks ago #130357

Hi,

Thanks to give us more informations about your environment.
(fill the lines you deleted when you have created this topic)

Please Log in or Create an account to join the conversation.

  • Posts: 68
  • Thank you received: 8
  • Hikashop Business
11 years 3 weeks ago #130513

-- url of the page with the problem -- : mumshealth.com
-- HikaShop version -- : 2.2.2
-- Joomla version -- : 3.1.5
-- PHP version -- : 5.3.3
-- Browser(s) name and version -- : Chrome 30.0.1599.101 m
-- Error-message(debug-mod must be tuned on) -- :

Notice: Trying to get property of non-object in /var/www/vhosts/mumshealth.com/components/com_hikashop/controllers/order.php on line 154 Notice: Undefined property: stdClass::$order_full_price in /var/www/mumshealth.com/administrator/components/com_awocoupon/helpers/estore/hikashop/giftcerthandler.php on line 94 Notice: Undefined property: stdClass::$cart in /var/www/vhosts/mumshealth.com/administrator/components/com_hikashop/classes/order.php on line 327 Notice: Trying to get property of non-object in /var/www/vhosts/mumshealth.com/administrator/components/com_hikashop/classes/order.php on line 327 Warning: Invalid argument supplied for foreach() in /var/www/vhosts/mumshealth.com/administrator/components/com_hikashop/classes/order.php on line 327 Notice: Undefined property: stdClass::$order_user_id in /var/www/vhosts/mumshealth.com/components/com_hikashop/controllers/order.php on line 203 Notice: Undefined property: stdClass::$order_payment_method in /var/www/vhosts/mumshealth.com/components/com_hikashop/controllers/order.php on line 205 Notice: Undefined property: stdClass::$order_payment_method in /var/www/vhosts/mumshealth.com/components/com_hikashop/controllers/order.php on line 212

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 3 weeks ago #130555

Hi,

Indeed, that's a case which is not handled properly.

Add the code:

if(!$this->_check()){
			return false;
		}
after:
function pay(){
in the file components/com_hikashop/controller/order.php and that will fix the problem.

The following user(s) said Thank You: MumsHealth

Please Log in or Create an account to join the conversation.

  • Posts: 68
  • Thank you received: 8
  • Hikashop Business
11 years 3 weeks ago #130587

Fixed most of the problems but there are 2 small glitches.

1. The user can still click the pay now link even after they have already paid. I dont want them to get confused and pay twice.

2. If the user clicks the link after their order has been deleted for some reason it still says "no payment method found" and creates a new blank order.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 3 weeks ago #130597

1. The "pay now" button is only available if the orders are created. Once the orders are confirmed (which normally happens automatically when your payment gateway sends the payment notification to HikaShop), the button should not display anymore.

2. We'll investigate that and fix it for next release but note that you're not supposed to delete orders. It's best practice to cancel them in order to leave a trace.

The following user(s) said Thank You: MumsHealth

Please Log in or Create an account to join the conversation.

  • Posts: 68
  • Thank you received: 8
  • Hikashop Business
11 years 3 weeks ago #130602

1. The problem is that order creation email includes its own "pay now" link. This bypasses the pay now button on the orders page completely and takes them directly to paypal.

2. I don't normally delete customers orders usually just test orders that I've created because I don't want them to clutter up too much. Unlike some European countries Canadian law doesn't care if your invoice numbers are out of order or in any particular order at all (that I know of).

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 2 weeks ago #130651

1. Ok I though that you were talking about the display of the pay now button on the orders listing page, not about that.
Indeed, we're missing a check here.
Add the code:

$config =& hikashop_config();
		$default_status = $config->get('order_created_status','created');
		if($order->order_status!=$default_status){
			$app =& JFactory::getApplication();
			$app->enqueueMessage('The order '.$order->order_number.' cannot be paid anymore.');
			parent::listing();
			return false;
		}
before
if(empty($order->order_currency_id)){
in the file components/com_hikashop/controller/order.php and that will fix the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 158
  • Thank you received: 5
7 years 1 month ago #279590

I can see this thread is a few years old but I am having the same issue on 3.2.0. I went to look for the code on the file above but that part does not exist.

Can you please advise how I can remove the pay now text from the order email.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 1 month ago #279596

Hi,

You can remove that code:

$vars['ORDER_SUMMARY'] .= $content;
from the preload version of the order creation notification email.

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum