Display invoice at checkout end

  • Posts: 11
  • Thank you received: 1
10 years 10 months ago #140276

Hello.

I am almost ready to launch an e-shop, built with Joomla 3.2 and Hikashop Essential 2.2.3.
At the end of the checkout process, I want to display on screen the invoice/receipt to the customer.
Although I've searched around the product and read the documentation, I still cannot find out how to do it.

Could somebody help me, please ?

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

  • Posts: 12953
  • Thank you received: 1778
10 years 10 months ago #140310

Hi,
I don't think that you'll be able to do that without some code customization, can you show me through some screenshots where do you exactly want your invoice to be displayed ?

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

  • Posts: 11
  • Thank you received: 1
10 years 10 months ago #140336

I thought I could do it through Hikashop, without any coding.

What's the meaning of "Allow users to print invoices on the front end", then ? I have enabled it and the user cannot see its invoice ant the checkout end.

Unfortunatelly the site is in Greek and although I can send you some screenshots, I don't think you can read them.
What I only get at the end of the checkound process (after the bank payment) is the message "Your order has been confirmed" (translated from Greek). I expected to see some invoice details there, not only the message.

I attach the back-end screenshots, about the checkout workflow and the display options. Also attached the final message the user gets after the bank payment (unfortunately in Greek).

If you need anything else as info, or further clarifications, pls let me know.

Regards
Charis

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

  • Posts: 11
  • Thank you received: 1
10 years 10 months ago #140337

Sorry, last attachment was the same as the first one.
Attach the correct one.

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 10 months ago #141030

Hi,

Like Mohamed said, there is no option for that in HikaShop but you can, using a view override, add some PHP code (very few lines) in order to redirect the user to the invoice details.
You can use the view "checkout | after_end", get the "order_id" of the created order and redirect the user to the order show page.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 11
  • Thank you received: 1
10 years 10 months ago #141051

Hello Jerome.

Thanks for your reply. I've done it by adding some code in after_end view. In order to help everybody there, the extra code is the following one (adjust the URL accordingly) :

$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$this->order = $orderClass->loadFullOrder($order_id);

$app->redirect(' www.mysite.com/index.php/hikashop-menu-f...ow/cid-'.($order_id) );

Regards
Charis

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 10 months ago #141175

Hi,

To have a generic/dynamic link, you can use

$app->redirect( hikashop_completeLink('order&task=show&cid='.$order_id) );
You can add the parameter "&itemId=..." with a specific item menu id, if you want to select a menu and have your nice SEF url.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 35
  • Thank you received: 1
10 years 5 months ago #161678

Hello,

I thought I found an answer with this topic, but nothing happens when I add this code to the after_end view? (See Attached Screenshot)

Even odder is that I configured the checkout workflow to have my checkout display an end, but that just makes the checkout page never finish the checkout at all when I have this option selected? It just sits there and looks like it wants to load but never does anything?

When I convert back to display the checkout "without an end" the checkout process goes through, but I still only get the simple thank you message, no redirect to the order page?

Finally I thought maybe removing the code from the after_end view as shown below would possibly help:

$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );

But even after I remove it I still only get the thank you message. Which completely confuses me because if I removed that code the thank you message should not appear after a payment is processed right?

I could use some assistance in getting this to work, perhaps I am missing something here?






Thank you for your time!

Sincerely,
Brandon Cardone, Card One Concepts
Attachments:

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

  • Posts: 11
  • Thank you received: 1
10 years 5 months ago #161717

Hi,

have you changed the correct after_end view ? As you might have seen, Hikashop has the same set of views for each template you have in your site. So, you have to change the after_end view that is used by your default/active template.

This is the code the after_end view contains, in my case :

<?php
/**
* @package HikaShop for Joomla!
* @version 2.2.3
* @author hikashop.com
* @copyright (C) 2010-2013 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );

/* CT - Find current order id and show receipt */
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$this->order = $orderClass->loadFullOrder($order_id);

$app->redirect(' www.mysite.com/index.php/hikashop-menu-f...ow/cid-'.($order_id) );

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

  • Posts: 35
  • Thank you received: 1
10 years 5 months ago #161760

Hi CGT,

Thanks for your reply, I did double check that I am using the proper template after_end view. However, I was trying to use the generic/dynamic link that Jerome posted, maybe that is the cause?

I would try your code but it looks like you just pasted it in and did not wrap your code in in code tags, which results in your url in your code to get truncated. If you look at it ( hikashop-menu-f...ow/cid-'.($order_id)); ) unless you they are supposed to be there I think part of the url is missing?

Could you re-post your code and wrap in in code tags? you can just highlight the code you paste in ans then click the little icon above in the text editor that looks like a sheet of paper with blue brackets. This will wrap the code you paste in and keep it from getting truncated when you post.

Thank you for your time!


Thank you for your time!

Sincerely,
Brandon Cardone, Card One Concepts
Last edit: 10 years 5 months ago by CardOneConcepts. Reason: typos

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

  • Posts: 11
  • Thank you received: 1
10 years 5 months ago #161770

Hello.

You may find attached the screenshot from my admin panel. (I've just only replaced the site name with mysite.com)

Regards

Attachments:
The following user(s) said Thank You: CardOneConcepts

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

  • Posts: 35
  • Thank you received: 1
10 years 5 months ago #161773

Thanks CGT,

Got it working now!!! Thank you for your help!

Not sure why they don't have this built right in? It just seems like common sense to have the checkout process go straight to information like this after a purchase is made?

So there you go Hikashop admins! There is a future feature request for you. How about adding this kind of redirect to the final checkout process? It would have saved me a couple hours of digging around and several unnecessary test transactions if it were in place.


Thank you for your time!

Sincerely,
Brandon Cardone, Card One Concepts
Last edit: 10 years 5 months ago by CardOneConcepts. Reason: typos

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

  • Posts: 12953
  • Thank you received: 1778
10 years 5 months ago #161779

Hello,
I just added it on our TODO list :).

The following user(s) said Thank You: fak, CardOneConcepts

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

  • Posts: 35
  • Thank you received: 1
10 years 5 months ago #161857

Thanks for considering my suggestion!


Thank you for your time!

Sincerely,
Brandon Cardone, Card One Concepts

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

  • Posts: 30
  • Thank you received: 0
10 years 2 months ago #172052

I am trying this too.

My final thank you page doesn't redirect to the receipt page though, it just reveals the thank you for purchase string, i.e. the default.

My after_end view is:

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.3.2
 * @author	hikashop.com
 * @copyright	(C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') ); 

/* Find current order id and show receipt */

$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$this->order = $orderClass->loadFullOrder($order_id);

$app->redirect('https://shop.fava.org.au/index.php?option=com_hikashop&ctrl=order&task=show&cid='.$order_id);
/*$app->redirect( hikashop_completeLink('order&task=show&itemId=330&cid='.$order_id) );*/

Last edit: 10 years 2 months ago by nathankeenmelb. Reason: Clarity

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #172060

Hi,

You should try that:

<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.3.2
 * @author	hikashop.com
 * @copyright	(C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php
$app = JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') ); 

/* Find current order id and show receipt */
// The order is already loaded and present in $this->order ;-)

$app->redirect(hikashop_completeLink('order&task=show&itemId=330&cid='.$this->order->order_id));

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

  • Posts: 30
  • Thank you received: 0
10 years 2 months ago #172452

Thanks Xavier, but this simply doesn't work.

Even if I change the file to include a debug message, it doesn't show it. If I remove the message, it doesn't remove it. I've tried changing all four after_end.php views (not that the other templates are active), and nothing happens. I've tried changing all four end.php views, and nothing happens. It stubbornly refuses to change from the default! Other views seem to work if I change them, so not sure what is happening here.

You have a super admin access now if you want to take a look.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #172481

Hi,

Which payment method are you using ?
For some of them the checkout end content is in the plugin xxx_end.php file.
So this is this file which need to be edited. And we can't edit it via the backend, you have to to that via FTP.

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

  • Posts: 30
  • Thank you received: 0
10 years 2 months ago #172600

Ah - well I'm using eway. Where is that "xxx_end.php" file?

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #172642

Hi,

The file is: plugins\hikashoppayment\eway\eway_thanks.php

The following user(s) said Thank You: nathankeenmelb

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

Time to create page: 0.141 seconds
Powered by Kunena Forum