Payment of orders not paid immediately

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 8 months ago #11322

It would be useful if shop owner could enable it for a specific order, but leave it disabled for the whole site.

I have set the checkout to return to the customer My Orders page once the order has been placed.

One difficulty I have noticed is that the customer can get back there before the paypal payment confirmation has been received. The order shows a status of created (that's OK), but the Pay now button is displayed. If the customer clicks that Paypal objects because it has seen then order no. before and the status of the order gets changed to cancelled.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #11330

I'm a bit reluctant to add a column in the order table (which already has a lot of columns) just for that.

What you could do is edit the listing file of the view order of the front end via the menu Display->Views and just add such code:
if(time()-$this->row->order_created>900){
// pay now button code
}

900 means that the button won't be displayed if the order is less than 15 minutes old.

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 8 months ago #11334

Good idea, will do something along those lines.
Thanks.

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

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 8 months ago #11562

Took this one stage further:

(a) Created an order status called 'unpaid'.

(b) Added the following code to listing.php.

echo '<span class="hikashop_order_listing_status">';
	echo $this->order_statuses->trans(ucwords($row->order_status));
  if ($row->order_status == 'unpaid' && empty($row->show_payment_button)) {
    $row->show_payment_button = true;
		$pluginsPayment = hikashop::get('type.plugins');
		$pluginsPayment->type='payment';
		$this->assignRef('payment',$pluginsPayment);
		$config =& hikashop::config();
		$payment_change = $config->get('allow_payment_change',1);
		$this->assignRef('payment_change',$payment_change);
  }
echo '</span>';

(c) This gives the store owner the ability to change the payment method / order status and then customer is able to pay using the Pay Now button. E.G. If they chose pay on delivery, but then decided / were asked to pay in advance by Paypal - or there were other issues with the order which required negotiation.

(d) An interesting feature I spotted when adding the order status is that Hikashop supports a heirarchy of order statii. I.E. I created unpaid under created - are there plans to use this feature in the future - maybe possibilities of enhancing what I have just done even further.

Last edit: 13 years 8 months ago by brainforge.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #11581

Your post lead us to a nice idea: instead of adding an option in the orders, we could just add a new option in the config where you could set the order statuses for which the button can be displayed and not just use the option order_created_status.

We'll see if others need that in the future. For now, your work around is easy to add in the file listing of the view order of the front end via the menu Display->Views (I precise for other users who would like to do the same), so we'll wait for more feedbacks.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum