News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Display additional info on thank you page

Started by AzMandius, February 10, 2021, 09:23:26 AM

Previous topic - Next topic

AzMandius

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:


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!
AzBlog.me | Mentally healthy content & lnks.

GJC Web Design

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..
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AzMandius

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?
AzBlog.me | Mentally healthy content & lnks.

Jörgen

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.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AzMandius

Joomla 3, VM 3, "Sensitive" template: https://demo.virtuemarttemplates.net/sensitive-detail.html
I have searched entire site, but i will surely look again.
AzBlog.me | Mentally healthy content & lnks.

jenkinhill

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/
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

or your template hasn't over ridden it so u need to create it in the path Jenks gave u
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AzMandius

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
AzBlog.me | Mentally healthy content & lnks.

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AzMandius

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::_($orderlinkfalse)?>"><?php echo vmText::_('COM_VIRTUEMART_ORDER_VIEW_ORDER'); ?></a>
<?php
}
?>
AzBlog.me | Mentally healthy content & lnks.

Jörgen

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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

AzMandius

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?
AzBlog.me | Mentally healthy content & lnks.