- Posts: 10
- Thank you received: 0
Adding order information to after_end.php
I am trying to update the after_end.php and can successfully add text, but I would like to add the order details to the page also.
To see which variables exist, I put the following, but nothing is showing.
I even tried
I am currently on Hikashop Business 2.2.1
Thanks.
Please Log in or Create an account to join the conversation.
Are you editing the view for the right front-end tempplate ?
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Thanks again!!!
Please Log in or Create an account to join the conversation.
Thanks again!
Please Log in or Create an account to join the conversation.
Did you read the error message displayed ?
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
The after_end.php page still is not showing any of the order information?!!?!?
Please Log in or Create an account to join the conversation.
Which means that the after_end file is probably not called at all as you must be using authorize.net in AIM. In that case, it's the "end" file that you want to edit. By default there are no variables in the "end" view file, but you can call it after_end to load the order like that:
<?php $this->after_end(); ?>
Please Log in or Create an account to join the conversation.
Should I still add <?php $this->after_end(); ?> to the end.php file?
Thanks!
Please Log in or Create an account to join the conversation.
No you shouldn't have to add the code to the end.php file if your title is displayed.
Thanks to set the error reporting of Joomla to "Maximum" and enable the debug mode in order to see if any errors are returned.
Please Log in or Create an account to join the conversation.
I receive:
Notice: Trying to get property of non-object in /mysitestructure/html/com_hikashop/checkout/after_end.php on line 32
Line 32:
Please Log in or Create an account to join the conversation.
So you should definitely have access to it.
If you do:
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
var_dump($order_id);
Do you get the id of the order displayed ? If yes, then you should definitely get the order data in $this->order since the after_end() function simply load the order in that attribute of $this for the order id stored in the session. If no, then maybe there is an issue with the session somehow.
By the way, how did you configure your payment method ? Could you do a screenshot (and remove the confidential data in it) ?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($order_id);
Please Log in or Create an account to join the conversation.
and it comes back NULL
Please Log in or Create an account to join the conversation.
To force the access of the data, you need to change the line:
$order = $orderClass->loadFullOrder($order_id);
to:
$order = $orderClass->loadFullOrder($order_id,false,false);
Please Log in or Create an account to join the conversation.
Worked like a charm. Thanks!
Please Log in or Create an account to join the conversation.
munk38 wrote: Thanks!! I use:
Code:$app = JFactory::getApplication(); $order_id = $app->getUserState('com_hikashop.order_id'); $orderClass = hikashop_get('class.order'); $order = $orderClass->loadFullOrder($order_id); var_dump($order);
and it comes back NULLI must be forgetting something. Thanks again for you help on this!!!
I'm testing the cart so i'm using a free coupon vs. processing a payment i've modified end.php and it returns the following
Thank you for your purchase.object(stdClass)#619 (40) { ["order_id"]=> string(2) "11" ["order_billing_address_id"]=> string(1) "3" ["order_shipping_address_id"]=> string(1) "3" ["order_user_id"]=> string(1) "3" ["order_status"]=> string(9) "confirmed" ["order_type"]=> string(4) "sale" ["order_number"]=> string(3) "M11" ["order_created"]=> string(10) "1398173803" ["order_modified"]=> string(10) "1398173803" ["order_invoice_id"]=> string(2) "11" ["order_invoice_number"]=> string(3) "M11" ["order_invoice_created"]=> string(10) "1398173803" ["order_currency_id"]=> string(1) "2" ["order_full_price"]=> string(7) "0.00000" ["order_tax_info"]=> string(0) "" ["order_discount_code"]=> string(9) "freeforme" ["order_discount_price"]=> string(7) "8.95000" ["order_discount_tax"]=> string(7) "0.00000" ["order_payment_id"]=> string(1) "0" ["order_payment_method"]=> string(0) "" ["order_payment_price"]=> string(7) "0.00000" ["order_payment_params"]=> string(0) "" ["order_shipping_id"]=> string(0) "" ["order_shipping_method"]=> string(0) "" ["order_shipping_price"]=> string(7) "0.00000" ["order_shipping_tax"]=> string(7) "0.00000" ["order_shipping_params"]=> string(0) "" ["order_partner_id"]=> string(1) "0" ["order_partner_price"]=> string(7) "0.00000" ["order_partner_paid"]=> string(1) "0" ["order_partner_currency_id"]=> string(1) "0" ["order_ip"]=> string(13) "98.217.140.46" ["customer"]=> object(stdClass)#777 (29) { ["user_id"]=> string(1) "3" ["user_cms_id"]=> string(3) "355" ["user_email"]=> string(16) "edocif@gmail.com" ["user_partner_email"]=> string(0) "" ["user_params"]=> string(0) "" ["user_partner_id"]=> string(1) "0" ["user_partner_price"]=> string(7) "0.00000" ["user_partner_paid"]=> string(1) "0" ["user_created_ip"]=> string(13) "98.217.140.46" ["user_unpaid_amount"]=> string(7) "0.00000" ["user_partner_currency_id"]=> string(1) "0" ["user_created"]=> string(10) "1398098645" ["user_currency_id"]=> string(1) "0" ["user_partner_activated"]=> string(1) "0" ["id"]=> string(3) "355" ["name"]=> string(11) "Jason Brown" ["username"]=> string(6) "edocif" ["email"]=> string(16) "edocif@gmail.com" ["password"]=> string(34) "$P$DFEWGxOfq7jJMQJOcsyK6ZYyBcFbJ41" ["block"]=> string(1) "0" ["sendEmail"]=> string(1) "0" ["registerDate"]=> string(19) "2014-04-21 16:44:05" ["lastvisitDate"]=> string(19) "2014-04-22 13:12:38" ["activation"]=> string(0) "" ["params"]=> string(124) "{"site_language":"en-GB","language":"en-GB","admin_style":"","admin_language":"","editor":"jce","helpsite":"","timezone":""}" ["lastResetTime"]=> string(19) "0000-00-00 00:00:00" ["resetCount"]=> string(1) "0" ["otpKey"]=> string(0) "" ["otep"]=> string(0) "" } ["order_subtotal"]=> float(8.95) ["shipping_address"]=> object(stdClass)#627 (19) { ["address_id"]=> string(1) "3" ["address_user_id"]=> string(1) "3" ["address_title"]=> string(2) "Mr" ["address_firstname"]=> string(5) "Jason" ["address_middle_name"]=> NULL ["address_lastname"]=> string(5) "Brown" ["address_company"]=> NULL ["address_street"]=> string(15) "46 Ridgewood St" ["address_street2"]=> string(0) "" ["address_post_code"]=> string(5) "03103" ["address_city"]=> string(10) "manchester" ["address_telephone"]=> string(10) "6033611142" ["address_telephone2"]=> NULL ["address_fax"]=> NULL ["address_state"]=> NULL ["address_country"]=> NULL ["address_published"]=> string(1) "1" ["address_vat"]=> NULL ["address_default"]=> string(1) "1" } ["fields"]=> array(7) { ["address_title"]=> object(stdClass)#637 (19) { ["field_id"]=> string(1) "1" ["field_table"]=> string(7) "address" ["field_realname"]=> string(5) "Title" ["field_namekey"]=> string(13) "address_title" ["field_type"]=> string(14) "singledropdown" ["field_value"]=> array(5) { ["Mr"]=> object(stdClass)#758 (2) { ["value"]=> string(13) "HIKA_TITLE_MR" ["disabled"]=> string(1) "0" } ["Mrs"]=> object(stdClass)#757 (2) { ["value"]=> string(14) "HIKA_TITLE_MRS" ["disabled"]=> string(1) "0" } ["Miss"]=> object(stdClass)#756 (2) { ["value"]=> string(15) "HIKA_TITLE_MISS" ["disabled"]=> string(1) "0" } ["Ms"]=> object(stdClass)#755 (2) { ["value"]=> string(13) "HIKA_TITLE_MS" ["disabled"]=> string(1) "0" } ["Dr"]=> object(stdClass)#754 (2) { ["value"]=> string(13) "HIKA_TITLE_DR" ["disabled"]=> string(1) "0" } } ["field_published"]=> string(1) "1" ["field_ordering"]=> string(1) "1" ["field_options"]=> string(107) "a:5:{s:12:"errormessage";s:0:"";s:4:"cols";s:0:"";s:4:"rows";s:0:"";s:4:"size";s:0:"";s:6:"format";s:0:"";}" ["field_core"]=> string(1) "1" ["field_required"]=> string(1) "1" ["field_default"]=> string(0) "" ["field_access"]=> string(3) "all" ["field_categories"]=> string(3) "all" ["field_with_sub_categories"]=> string(1) "0" ["field_frontcomp"]=> string(1) "1" ["field_backend"]=> string(1) "1" ["field_backend_listing"]=> string(1) "0" ["field_display"]=> string(0) "" } ["address_firstname"]=> object(stdClass)#634 (19) { ["field_id"]=> string(1) "2" ["field_table"]=> string(7) "address" ["field_realname"]=> string(9) "Firstname" ["field_namekey"]=> string(17) "address_firstname" ["field_type"]=> string(4) "text" ["field_value"]=> string(0) "" ["field_published"]=> string(1) "1" ["field_ordering"]=> string(1) "2" ["field_options"]=> string(107) "a:5:{s:12:"errormessage";s:0:"";s:4:"cols";s:0:"";s:4:"rows";s:0:"";s:4:"size";s:0:"";s:6:"format";s:0:"";}" ["field_core"]=> string(1) "1" ["field_required"]=> string(1) "1" ["field_default"]=> string(0) "" ["field_access"]=> string(3) "all" ["field_categories"]=> string(3) "all" ["field_with_sub_categories"]=> string(1) "0" ["field_frontcomp"]=> string(1) "1" ["field_backend"]=> string(1) "1" ["field_backend_listing"]=> string(1) "0" ["field_display"]=> string(0) "" } ["address_lastname"]=> object(stdClass)#633 (19) { ["field_id"]=> string(1) "4" ["field_table"]=> string(7) "address" ["field_realname"]=> string(
How do i get this to show the order in a graphical format? my code for end.php is as follows :
<?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
if(empty($this->html)){
echo JText::_('THANK_YOU_FOR_PURCHASE');
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass->loadFullOrder($order_id);
var_dump($order);
}else{
echo $this->html;
}
$this->nextButton = false;
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.