Access payment method in checkout end view

  • Posts: 137
  • Thank you received: 2
12 years 11 months ago #37747

Hi!

Is it possible to access the payment method in the checkout view "end"?

Best regards

Last edit: 12 years 11 months ago by emergentec.

Please Log in or Create an account to join the conversation.

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #37899

What do you mean by "access the payment method" ?

You want to know the payment method selected ?
For that you would have to load the order:
$app =& Jfactory::getApplication();
$class = hikashop_get('class.order');
$order = $class->get($app->getUserState( HIKASHOP_COMPONENT.'.order_id'));
echo $order->order_payment_method;

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
12 years 11 months ago #38089

Can't I get the label instead of the code?

"Bank transfer" instead of banktransfer?

Best regards

Please Log in or Create an account to join the conversation.

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #38183

It's possible.

In that case you need to do like that:

$app =& Jfactory::getApplication();
$class = hikashop_get('class.order');
$order = $class->get($app->getUserState( HIKASHOP_COMPONENT.'.order_id'));
$paymentClass = hikashop_get('class.payment');
$payment = $paymentClass->get($order->order_payment_id);
echo $payment->payment_name;

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum