payment after order is created with Guest mode

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
2 years 3 months ago #343975

-- HikaShop version -- : 4.6.1
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4

Hi,

Is there a way to offer a guest client an option to pay after the order is created, without forcing the client to make an account afterwards?

Most of our clients get a personal design per email first after placing his/her order. When the client is ok with the design they want to pay, but when they have chosen to order as Guest, they can't because they have to login.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 3 months ago #343976

Hi,

The payment link included in the "order creation notification" email allows the user to pay for his order even if the order was placed as a guest.
Similarly, the link to the order is also provided in that email and on the thank you page and both work even for guests. And on that page, the '"pay now" button will be displayed too, even for guests.

So I'm surprised you're asking this because it should already be the case without doing anything as long as you properly activated the "Payment of orders not paid immediately" setting of the HikaShop configuration and enabled the statuses for which you want to allow the payment under the "unpaid" column of the System>Order statuses menu.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
2 years 3 months ago #343992

Hi Nicolas,

We didn't use the guestmode at all untill some weeks ago, but get complaints about this.

I think I didn't explain right, sorry about that. The customers want's to pay in allmost every case at least 1 day (or sometime a week or two weeks) later. They can't know they have to search for the email with the order creation notification. The thank you page is in this case off course no option.

Maybe it is possible to add the pay now button in other statuses f.i. confirmed? Or can I put the pay now code to my own email?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 3 months ago #343993

Hi,

If you click on the "email" button when editing an order, you'll see the payment link at the bottom of the email preview in the popup (and same in the preview of the popup when you change the status of an order from the orders listing), provided the status of the order is enabled as an unpaid status in System>Order statuses.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
2 years 3 months ago #344020

Hi,

I see the pay now button when clicking on the email button, but when I look into the email history of the system, the auto sended email doen't show the pay now button, see screenshot. Many statuses have the unpaid status enabled, but it seems the sended email doesn't contain the pay now button when using the "notify customer" checkbox.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 3 months ago #344030

Hi,

I'm sorry but I don't read Dutch. So I don't know which email is in your screenshot, which statuses are what and which column is what.

So I can't conclude on whether it's normal or not based on the situation as I can't assess it.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
2 years 3 months ago #344067

Hi, I understand. Here are the translations:

De bestelling met Nr. 111404 is nu Aangemaakt op jouwnaambord.nl/ | The ordernumber 111404 was created at jouwnaambord.nl

Klik hier om snel een account aan te maken op onze website. Hiermee hoef je bij de volgende aankoop onze website de adres gegevens niet opnieuw in te voeren. | Click here to easily create your user account on our website. That way, next time you purchase on our online shop, you won't have to reenter your address.

Statuses:

aangemaakt = created
bevestigd = confirmed
betaald = paid
gewijzigd = changed

The email in the screenshot is the email sended from the system after checking the "Notify customer" checkbox in the order edit page. See the screenshot from the email history.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 3 months ago #344072

Hi,

The "order creation notification" email is the one sent to the user when the order is created, not when the "notify customer" checkbox is checked while changing the order status on the order edit page. The email sent at that time is the "order status notification".

So I think you're just not looking at the correct email.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
2 years 3 months ago #344083

Hi,

Ok, I see what you mean, I will check again. Thanks.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
11 months 3 weeks ago #357104

I use the paymentcode from the "order creation notification" email in emails for guest customers to pay.

F.e.:"index.php?option=com_hikashop&ctrl=order&task=pay&order_id=112449&order_token=qgmeVriE&Itemid=544"

In the code there's a menu_id used (544) from a random menu (as it seems). Is there a way to use a specific menu (f.e. a custom paymentpage)?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 3 weeks ago #357107

Hi,

It's not a random menu item. It's the current page menu item. It's only random if the place where the email is generated doesn't have a menu item or the menu item is not HikaShop. Normally, when the order is created on the frontend, you're already on the HikaShop checkout, and thus it will use the menu item id used on the checkout.
You can see the code which generates the URL in the preload of the order creation notification email :

global $Itemid;
$url_itemid = '';
if(!empty($Itemid)) {
	$url_itemid = '&Itemid=' . $Itemid;
}

....

$pay_url = 'index.php?option=com_hikashop&ctrl=order&task=pay&order_id='.$data->order_id.$url_itemid;
if(empty($customer->user_cms_id) && !empty($data->order_token)) {
	$pay_url .= '&order_token='.urlencode($data->order_token);
}
$pay_url = hikashop_frontendLink($pay_url);
In $Itemid, you have the id of the current menu item, if any.
If you want to force it to something else, you could change the first part of the code to:
$url_itemid = '&Itemid=XX';
where XX would be the id of the menu item you want to be used.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
11 months 2 weeks ago #357248

Thanks, I changed the first part of the code to $url_itemid = '&Itemid=101'; but it still adds the 544 menu item to the paymentcode?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 2 weeks ago #357252

Hi,

How is the menu item with the id 101 configured ? Could you do some screenshots ?
And are you using a SEF extension like 4SEF ?

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
11 months 2 weeks ago #357268

Hi,

I altered the first part as you mentioned, I do use the EFSEO plugin.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 2 weeks ago #357270

Hi,

I think I wasn't clear enough. My bad.
I wanted to say that you should change the whole code:

global $Itemid;
$url_itemid = '';
if(!empty($Itemid)) {
	$url_itemid = '&Itemid=' . $Itemid;
}
to just:
$url_itemid = '&Itemid=XX';
That's what I meant by "the first part of the code".

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 1 week ago #357462

Hi,

I think your issue has several layers to it:
- First, when I checked your customization of the email I saw you used the Itemid 1 and not 101. 1 is the root menu item and should never be used.
- Second, even the 101 menu item is not correct. You need to use a menu item of HikaShop because Joomla's routing system only allows menu items of an extension to display its pages. If you try to use an invalid Itemid like 101 (which is a gantry menu item), HikaShop will auto correct to a random HikaShop menu item (the 544). I've changed it to the 137 menu item but you can choose a better suited menu item.
- It seems that you're doing your tests on the backend and not a real test from the frontend. In order to check which menu items are valid, the system checks that the "access level" of the menu item matches with the user groups assigned to the current user. So if you test the order creation email from the backend, you're logged in as an admin and thus it might not accept the public menu items. Make sure you're testing this change from the frontend by creating an order from the frontend.

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
11 months 1 week ago #357491

Hi,

Thanks for your detailed explanation.

Indeed I do take the code from the backend because this code s what I use in an email send from outlook instead of the backendsystem. This is what you suggested earlier on my question if I could use the paymentcode in my own email (#343993). So yes, I allways copy the code from an existing order with a changed status (payable) as an adimistrator and never from the frontend. But if I understand you right, the access level check prevents the menu-id override?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 months 1 week ago #357499

Hi,

That's indeed the case.
What you can try is to change the code:

				$user = JFactory::getUser();
				$accesses = JAccess::getAuthorisedViewLevels(@$user->id);
				if(!empty($accesses)){
					$filters[]='a.access IN ('.implode(',',$accesses).')';
				}
to:
			if(hikashop_isClient('site')) {
				$user = JFactory::getUser();
				$accesses = JAccess::getAuthorisedViewLevels(@$user->id);
				if(!empty($accesses)){
					$filters[]='a.access IN ('.implode(',',$accesses).')';
				}
			}
in the file administrator/components/com_hikashop/classes/menus.php
That will skip the access check for links generated from the backend and it should hopefully allow for this override.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum