Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
get payment method in review.phtml
 
theuros
Jr. Member
 
Total Posts:  19
Joined:  2009-11-27
 

hi to all…

how can i get payment method info in review.phtml ??

i need to know what method was selected one step back ...

thanx to all

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Total Posts:  1300
Joined:  2009-11-18
Bucharest, Romania
 

$this->getQuote()->getPayment()->getName();
or
$this->getQuote()->getPayment()->getTitle();

 Signature 

It’s not a bug. It’s a feature.
http://marius-strajeru.blogspot.com/
E-commerce solutions and much more: Anais-IT

 
Magento Community Magento Community
Magento Community
Magento Community
 
theuros
Jr. Member
 
Total Posts:  19
Joined:  2009-11-27
 

hm… i get nothing with this call

<?php echo $this->getQuote()->getPayment()->getName();?><br />
<?php echo $this->getQuote()->getPayment()->getTitle();?>

... i need this info in the las checkout step .. before i submit the order

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Total Posts:  1300
Joined:  2009-11-18
Bucharest, Romania
 

Try this

echo Mage::getSingleton('checkout/session')->getQuote()->getPayment()->getMethodInstance()->getTitle();
but put it in \app\design\frontend\{interface}\{theme}\template\checkout\onepage\review\info.phtml not in
\app\design\frontend\{interface}\{theme}\template\checkout\onepage\review.phtml

 Signature 

It’s not a bug. It’s a feature.
http://marius-strajeru.blogspot.com/
E-commerce solutions and much more: Anais-IT

 
Magento Community Magento Community
Magento Community
Magento Community
 
theuros
Jr. Member
 
Total Posts:  19
Joined:  2009-11-27
 

ok i get some info in this way ... what else can i get instead of ->getTitle() ?  i need payment method and total price

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Total Posts:  1300
Joined:  2009-11-18
Bucharest, Romania
 

the amount already appears it’s grand total. but if you still want it do this:

echo Mage::getSingleton('checkout/session')->getQuote()->getGrandTotal();

 Signature 

It’s not a bug. It’s a feature.
http://marius-strajeru.blogspot.com/
E-commerce solutions and much more: Anais-IT

 
Magento Community Magento Community
Magento Community
Magento Community
 
theuros
Jr. Member
 
Total Posts:  19
Joined:  2009-11-27
 

hey ...  thanx ..  you solved one third of my problems ..  where i can get all this functions ? .. i still need to know what payment method customer choosed…

 
Magento Community Magento Community
Magento Community
Magento Community
 
tzyganu
Mentor
 
Total Posts:  1300
Joined:  2009-11-18
Bucharest, Romania
 

You can get the payment method code like this:

echo Mage::getSingleton('checkout/session')->getQuote()->getPayment();
There are no other functions. just try to print out
Mage::getSingleton('checkout/session')->getQuote()->getPayment()->getData();
be patient, is a long array because of the recursion.
For each key in that array you can use getData(’{KEY_NAME}’) to retrieve the data.
For example if an array key is caller ‘array_key’ you can get it’s value like this:
Mage::getSingleton('checkout/session')->getQuote()->getPayment()->getData('array_key');
or
Mage::getSingleton('checkout/session')->getQuote()->getPayment()->getArrayKey();
The method getArrayKey() does not exist but it’s magically called by Magento.

 Signature 

It’s not a bug. It’s a feature.
http://marius-strajeru.blogspot.com/
E-commerce solutions and much more: Anais-IT

 
Magento Community Magento Community
Magento Community
Magento Community
 
theuros
Jr. Member
 
Total Posts:  19
Joined:  2009-11-27
 

thanx for the answer ... but i don’t get it this array i got ..

i have two payments method: “payment on delivery” and “credit card payment”. Whatever i choose i get the same array ... i don’t know wich array key to compare beacause are all the same ... ==> code

Why i get allways the data like cc_type and cc_owner ?

I don’t use credit card form to get cc date because i have to redirect customer to the bank weebsite, so to hide cc fields and avoid validation i done this ==> code is this the reason i get all cc data in getData array ?

Maybe i’m doing this in a wrong way .. but as i said i don’t know magento .. so if there is a simpler solution id like to hear it.

..and another thing .. why i get an error if i put in review.phtml a simple code like if($_GET[’x’]) echo ‘OK’; ??

When payement on bank website is done i have to redirect customer back to the last step in .../checkout/onepage/ .. if i refresh i get every time on the first step .. is there any way to get into review step directly ? when i get redirected from bank website i want to put something in url like .../checkout/onepage?payment=ok and if $_GET[payment] == ok then i run JS function review.save(); to finish the order ...

and another thing smile ... i need order id ... i tryed different calls like $this->getOrderId(); ..but i didn’t get nothing ..

thanx

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pranay_Gondane
Jr. Member
 
Total Posts:  6
Joined:  2010-04-11
 

Hi All,

We can also get Payment method using this code directly in the review.phtml file ....

<?php echo $paymentMethodUsed Mage::getSingleton('checkout/session')->getQuote()->getPayment()->getMethodInstance()->getCode(); ?>

Gud Luck ..  wink

 Signature 

Pranay Gondane

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
704029 users|1886 users currently online|497356 forum posts