Hello,
Joomla 3, VM 3, "Sensitive" template: https://demo.virtuemarttemplates.net/sensitive-detail.html
I would like to display some more info on thank you page, besides the "Thank you" phrase, like order number, amount to pay, a hyperlink to view the order online, etc.
What i am looking for sample demo:
(https://nimbusweb.me/box/attachment/5188836/i712szch34ksl0qmiedq/cVlSGDlib0EFMk7V/screenshot-peptid-online.ru-2021.02.09-20_05_23.png)
I found a guide for VM 1, where you insert code
<?php //lets show some more good stuff to the customer
global $CURRENCY_DISPLAY;
echo '<br />';
echo 'Order number: <strong>'.$db->f('order_id').'</strong><br />
Order total: <strong>'.$CURRENCY_DISPLAY->getFullValue( $db->f('order_total')).'</strong>';
?>
into \components\com_virtuemart\themes\default\templates\pages\checkout.thankyou.tpl.php (source: https://tompai.pro/virtuemart/order-total-order-number-to-thankyou-page-virtuemart-1-1-x/)
And would like to do the same for VM 3 if appropriate.
Any advice appreciated.
Thank you!
you would add it on an over ride of components\com_virtuemart\views\cart\tmpl\orderdone.php
the info needs to be sent from the payment plugin as $this->html so u start by echoing out what is available in this object or even in $this..
that's your starting point..
Gone through all files but could not find a orderdone.php file, neither order_done.php, nor order-done.php
Should i create it, or copy it from another site?
You should have this file in Your site. What VM, Joomla, Custom Template version etc do You use ?
It is located in Your cart view. You have not looked hard enough.
Jörgen
Joomla 3, VM 3, "Sensitive" template: https://demo.virtuemarttemplates.net/sensitive-detail.html
I have searched entire site, but i will surely look again.
orderdone.php is by default in /components/com_virtuemart/views/cart/tmpl/ but as your template uses overrides check in templates/your-template/html/com_virtuemart/cart/
or your template hasn't over ridden it so u need to create it in the path Jenks gave u
Yes, thank you, indeed i have found the orderdone.php in VM directory ../public_html/components/com_virtuemart/views/cart/tmpl and changes to that file appear on website.
Quote from: GJC Web Design on February 10, 2021, 12:21:15 PM
the info needs to be sent from the payment plugin as $this->html
i assume it means that i would need to copy paste the appropriate code from payment plugin file to orderdone.php?
Quote from: GJC Web Design on February 10, 2021, 17:01:08 PM
or your template hasn't over ridden it so u need to create it in the path Jenks gave u
is it ok if i first complete the task successfully in ../public_html/components/com_virtuemart/views/cart/tmpl and after all is good i will move it to ../public_html/templates/sensitive/html/com_virtuemart/cart as an override
Quote from: AzMandius on February 11, 2021, 11:30:32 AM
is it ok if i first complete the task successfully in ../public_html/components/com_virtuemart/views/cart/tmpl and after all is good i will move it to ../public_html/templates/sensitive/html/com_virtuemart/cart as an override
Yes. Then the code alteration will not get overwritten when you next update VirtueMart.
Quotethe info needs to be sent from the payment plugin as $this->html
i assume it means that i would need to copy paste the appropriate code from payment plugin file to orderdone.php?
no .. u must see first what is already available in orderdone .. if the info and values are not there then u must push them into the $html object
This is what's available so far in orderdone.php
echo '<div class="vm-wrap vm-order-done">';
if (vRequest::getBool('display_title',true)) {
echo '<h2><p style="color:#0088cc;">БлагоSPAMарим за покупку!</p></h2>
<h4>Ваш заказ поSPAMтвержSPAMен.</h4>
<h6>Наш менеSPAMжер свяжется с вами в ближайшее время чтобы уточнить SPAMетали SPAMоставки и оплаты по необхоSPAMимости, а также, возможную скиSPAMку при наличии накопленных баллов кэшбэк.</h6>';
}
echo $this->html;
if (vRequest::getBool('display_loginform',true)) {
$cuser = JFactory::getUser();
if (!$cuser->guest) echo shopFunctionsF::getLoginForm();
}
echo '</div>';
I assume order info i am looking for must be displayed from payment method file - post_payment.php
This is what i have in post_payment.php for standart payment method, it is what i am looking for, but for some reason this info is not printed in order done page.
<div class="post_payment_payment_name" style="width: 100%">
<span class="post_payment_payment_name_title"><?php echo vmText::_ ('VMPAYMENT_STANDARD_PAYMENT_INFO'); ?> </span>
<?php echo $viewData["payment_name"]; ?>
</div>
<div class="post_payment_order_number" style="width: 100%">
<span class="post_payment_order_number_title"><?php echo vmText::_ ('COM_VIRTUEMART_ORDER_NUMBER'); ?> </span>
<?php echo $viewData["order_number"]; ?>
</div>
<div class="post_payment_order_total" style="width: 100%">
<span class="post_payment_order_total_title"><?php echo vmText::_ ('COM_VIRTUEMART_ORDER_PRINT_TOTAL'); ?> </span>
<?php echo $viewData['displayTotalInPaymentCurrency']; ?>
</div>
<?php
$tracking = VmConfig::get('ordertracking','guests');
if($tracking !='none' and !($tracking =='registered' and empty($viewData["virtuemart_user_id"]) )){
$orderlink = 'index.php?option=com_virtuemart&view=orders&layout=details&order_number='.$viewData["order_number"];
if( $tracking == 'guestlink' or ( $tracking == 'guests' and empty($viewData["virtuemart_user_id"]))){
$orderlink .= '&order_pass='.$viewData["order_pass"];
}
?>
<a class="vm-button-correct" href="<?php echo JRoute::_($orderlink, false)?>"><?php echo vmText::_('COM_VIRTUEMART_ORDER_VIEW_ORDER'); ?></a>
<?php
}
?>
Sounds like post_payment is created in your override. Is that the case ? If it is you have to track the overrides to ser how data is transferred. Maybe compare stock VM files with your custom overrides.
Jörgen
post_payment.php is in ../public_html/plugins/vmpayment/standard/standard/tmpl
So i assume i have to push content from post_payment.php to be displayed on website front order done step, by adding some referring code in orderdone.php?