One more way to get current order is to use routeMatch like
$route_name = \Drupal::routeMatch()->getParameter('commerce_order');
One more way to get current order is to use routeMatch like
$route_name = \Drupal::routeMatch()->getParameter('commerce_order');
To get full country name you need to use CountryManager class and you can then get all the info you need. So lets say you have some country code store in $shipping_code variable, to get full country name
So you have and order, but don't know how to get to payments that are referencing this order, there are few ways you can achieve that. First is to load it by properties
$payments = \Drupal::entityTypeManager()->getStorage('commerce_payment')->loadByProperties(['order_id' => $order->id()]);
second is to load them by order
If you wan to get some info from ORDER entity there is a method to do that. We can do that by loading by some property or by loading order per ID
Payment is specific entity in drupal commerce, usually it will be added by payment gateway module through checkout flow, but if you need to make some custom payments programmatically then you can do it in a following way, first you would need to get payment gateway object, so you can fetch proper info, after that you need to fill in paraparameters for new payment creation, depending on how you
Unlike shipments, each order has one billing profile, to change it programmatically we can first check it existence and then we can do the changes, it goes like this:
Drupal commerce shipping module is complex, there are few moving parts that you need to consider when making custom changes to it. First there are shipment types which are associated with order type, this is usually done through UI, unless you also add order type programmatically.
In drupal 8 plugins are everywhere, so to get most out of them you will sometimes want to alter them. If you look at definitions of each plugin manager, you will see that all of them have something specific in their constructors, it is the line below
To alter main content view of commerce summary you need to change results part of view, you can do this in different ways, one of it could be hook_preprocess_views_view or with some of the
For multi-currency in drupal 7 commerce we had it all running out of the box with drupal multicurrency modul. You had price fields per currency and rules that would solve that. There is no out of the box solution like that yet, but this module is pretty close to it.