- Posts: 366
- Thank you received: 26
Get db data under payment method
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.4
-- Browser(s) name and version -- : FireFox
Hi
Let me see if I can can explain what I would like to do
When a user orders an item and chooses a certain offline payment method, I would like that the emails sent to him has extra text added below the payment info - and also on the Thank you page.
This extra text has to be a link containing the order number and the total price.
Can I make it like this some way?
Regards
Thomas
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
If you wan to edit the "Thank you" page, the solution will be to directly edit the code of the "After_end" file of the "Checkout" view of your front-end template via "Hikashop->Display->Views".
For more information :
www.hikashop.com/support/documentation/1...-display.html#layout
Kind regards,
Mohamed.
Please Log in or Create an account to join the conversation.
But I need to show something depending of the payment method that has been chosen - and that should be order number and total amount.
This I also need ind the emails sent to the customer.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Good, note that you'll find both of these informations through the following variable : "$this->order"
Kind regards,
Mohamed.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
You need to use a PHP condition.
For example:
Now of course, you'll have to adapt the code to the situation.
Please Log in or Create an account to join the conversation.
Are you sure about that file?
I tried that, but nothing appears after and order - I even tried a simple echo, with same result.
<?php
/**
* @package HikaShop for Joomla!
* @version 4.4.0
* @author hikashop.com
* @copyright (C) 2010-2020 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') );
if($this->order->order_payment_method=='mobilepay') {
echo $this->order->order_number;
}
if(!empty($this->url))
$app->enqueueMessage(JText::sprintf('YOU_CAN_NOW_ACCESS_YOUR_ORDER_HERE',$this->url));
$app = JFactory::getApplication();
$app->triggerEvent('onHikashopOrderTrackingDisplay', array($this->order));
Please Log in or Create an account to join the conversation.
However, if you entered a URL in the "return URL" setting of your payment method, it will use that URL and not the default thank you page of HikaShop. In that case, I don't know exactly what you should do as I don't know how is made the URL you chose on your website.
Also, with some payment methods, where there is no redirection to the payment gateway for the payment at the end of the checkout, it's possible it is another view file.
The modification in the after_end view file is the most generic one, and thus what we first recommend to not confuse the merchants with too much information.
If you want a precise answer, I would need you to tell me which payment methods you're using and how you configured them.
Please Log in or Create an account to join the conversation.
I don't use any return URL, just the default thank you page.
I have set up the bank transfer plugin with these settings.
But I still can't get the page to show anything entered into the after_end file
Regards
Thomas
Please Log in or Create an account to join the conversation.
The bank transfer payment method doesn't redirect to a payment gateway at the end of the checkout and thus it doesn't use the "after_end" view file which is used when the customer comes back from the payment gateway.
For the bank transfer payment plugin, it's the file plugins/hikashoppayment/banktransfer/banktransfer_end.php which is used.
The order number is available with $this->order_number and the order total with $this->amount in that file.
To override it, you should copy that file to templates/YOUR_TEMPLATE/hikashoppayment/banktransfer_end.php via FTP and modify that copy. That way, you won't loose your changes when you update HikaShop.
Please Log in or Create an account to join the conversation.
Makes sense!
And thanks, I'll make the override
Regards
Thomas
Please Log in or Create an account to join the conversation.
I can insert TEST! on the page, but when I copy the content to test, I don't see that?
The second
Please Log in or Create an account to join the conversation.
It could be because the HTML elements have the same ID which is not valid in HTML ?
www.w3schools.com/html/html_id.asp
Please Log in or Create an account to join the conversation.
Seems to have been a cache issue, so I get what I want now
Thanks!
Would it be possible on that page to make a check on which bank transfer option the customer has made?
I have set up 2 types of bank transfer and would like to show different messages to them?
Kind regards
Thomas
Please Log in or Create an account to join the conversation.
You should be able to based on their id:
Please Log in or Create an account to join the conversation.
Thank you so much
Please Log in or Create an account to join the conversation.