Jump to content

Get order payment method


Myles_UA

Recommended Posts

Hi everyone.

I'm modifying a cdc_googletagmanager module in prestashop and trying to add conditional function that will depend on choosed payment method in order. I've tried something like this

foreach ($orders as $id_order) { 
 $id_order = $id_order['id_order'];
            $order = new Order($id_order);
$order_payment = OrderPayment::getByOrderId($id_order); }

But order_payment returns nothing (just an Array). Is there any other method getting payment module name or ID?

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

TLFTP; I'm currently facing a similar issue with a payment module I'm developing, AFAIK the "payment module" used for a given order its stored in "module" column on the order. I've tested this with version 1.7.6 with default installation (no addons other than my module). On a more complex scenario with mutiple payouts from different sources for the same order (not sure if even is possible from a cart/checkout perspective) probably your only hope its the message used to register the payment is the payment module machine-name.

Hope it can help others, I'm newbie on the PS world, so far my impression is that the beauty on the simpliciity of PS architectural principles is outmatched by the lack of documentation (whereas offiicial or not) and a self-closed community.

Peace 🖖

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...