Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
Page 1 of 2
Get Order Attributes in success.phtml
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

Friends,

I´m trying to get some values from the order object in success.phtml.

I´m configuring a form to post the order information on our payment gateway.

By Know I need the Customer Full Name, Billing Address, Order ID, Payment Type, Order Total and Customer TaxVat.

The bellow code is incomplete.

Can you help me with this?

<form name="formbraspag" method="post" target="_blank" action="https://pagador.">
      <
input type="hidden" name="id_loja" value="6755D9BB-EE8D-48F1-B282-A08A98E8D442">
      <
input type="hidden" name="venda_id" value="<?php echo $this->getOrderId() ?>">
      <
input type="hidden" name="codpagamento" value="06">
      <
input type="hidden" name="parcelas" value="1">
      <
input type="hidden" name="TIPOPARCELADO" value="0">
      <
input type="hidden" name="nome" value="<?php echo $this->getCustomerName() ?>">
      <
input type="hidden" name="valor" value="<?php echo $this->getTotalDue() ?>">
      <
input type="hidden" name="CPF" value="<?php $this->getCustomer()->getTaxvat() ?>">
      <
input type="submit" name="btn_confirmar" value "Clique aqui para efetuar o pagamento">
</
form>

regards,

André Cruz
http://novafarmadelivery.com -> The First Brazilian Magento´s Store

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
Agent Mo
Member
 
Avatar
Total Posts:  51
Joined:  2008-07-14
 

You could do a:

<?php print_r($this); print_r(get_class_methods($this));?>

to figure out, what the object provides. I’m new to magneto, so that’s the way I would try it. Hope that helps you a little bit.

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

My problem is to know each object that is enabled to use in the success.phtml and how to use then to catch the information that I Need!

thanks for your help, but it´s not what I need by now!

Anybody else?

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

Now I got what you said!!!

I put the code there and received a Blank page :(

I´m still trying !!

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
Agent Mo
Member
 
Avatar
Total Posts:  51
Joined:  2008-07-14
 

Did you do that in the template?

What info does the server error log provide?

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

the log is not on.

I´ll have to do the teste again to catch it.

Any other option?

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
Agent Mo
Member
 
Avatar
Total Posts:  51
Joined:  2008-07-14
 

At the moment, sadly no…

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

anybody else?

remembering…

I need to catch the following fields in success.phtml:

* Customer Full Name
* Customer TaxVat
* Customer Billing Address
* Order Grand Total
* Order Currency
* Order Payment Type

Thanks for te replies!

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

I just found that sucess.phtml only has te following Methods:

bool canPrint ()
string getOrderId ()
string getPrintUrl ()

source: http://docs.magentocommerce.com/Mage_Checkout/Mage_Checkout_Block_Onepage_Success.html

What I Need know is load the order by the order id and, with the order loaded, load the customer object.

After this I will need to fill the fields above.

Keep Walking…

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

at http://www.magentocommerce.com/boards/viewthread/4150/

I Got this code:

<?php
$_customerId 
Mage::getSingleton('customer/session')->getCustomerId();
$lastOrderId Mage::getSingleton('checkout/session')->getLastOrderId();
$order Mage::getSingleton('sales/order');
$order->load($lastOrderId);
$_totalData =$order->getData();
$_grand $_totalData['grand_total'];
?>

than I got the grand total for the order.

Based on it, how do Get the others values?

* Customer Full Name
* Customer TaxVat
* Customer Billing Address
* Order Currency
* Order Payment Type

Still Keeping Walking

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

Friends,

A New step concluded…

by now I have the following code:

<?php
$_customerId 
Mage::getSingleton('customer/session')->getCustomerId();
$customer Mage::getSingleton('customer/session')->getCustomer();
$lastOrderId Mage::getSingleton('checkout/session')->getLastOrderId();
$order Mage::getSingleton('sales/order');
$order->load($lastOrderId);
$_totalData $order->getData();
$_attributes $customer->getAttributes();
$_grand $_totalData['grand_total'];
$_name $customer->getName();
$_taxvat $customer->getTaxvat();
?>

I got some Customer attributes.

I’m almost there!

Keep Walking!

Regards,

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

Got the Email Address!

<?php
$_customerId 
Mage::getSingleton('customer/session')->getCustomerId();
$customer Mage::getSingleton('customer/session')->getCustomer();
$lastOrderId Mage::getSingleton('checkout/session')->getLastOrderId();
$order Mage::getSingleton('sales/order');
$order->load($lastOrderId);
$_totalData $order->getData();
$_grand $_totalData['grand_total'];
$_name $customer->getName();
$_taxvat $customer->getTaxvat();
$_email $customer->getEmail();
?>

Getting Better Each Time!

Let’s Keep Walking

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

I would ask some one from the team to update de phpdocs information.

The last version were generated on May!

You don’t mean the hard work I’m doing here withou a up to date documentation!

Please! Help the community!

Regards,

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

just to remember the team to update the phpdoc information.

Last update was May 09th.

Regards

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael
Magento Team
 
Total Posts:  826
Joined:  2007-08-31
 

Hi André ,

Actually the last major version was released on May 8.
The updates (.1, .2, .4) released later didn’t modify anything in the API.

For sure we will have a new phpdoc for 1.1 release.

Thank you,
Michael.

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

Michael,

Thanks for your reply.

As I compared, there is some missing information…

No problem at all by now if you will release a new version for 1.1 release.

Regards,

 Signature 

André Cruz
BioStore Ecommerce Group
Especialista em E-commerceLoja Virtual 100% Magento

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 2
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
701238 users|1005 users currently online|497318 forum posts