fixed materio_commerce/materio_commerce.module

This commit is contained in:
Bachir Soussi Chiadmi 2022-11-29 21:42:52 +01:00
parent b1876efa70
commit 8d8aa5e14b
1 changed files with 4 additions and 2 deletions

View File

@ -229,8 +229,10 @@ function materio_commerce_form_user_form_alter(&$form, &$form_state, $form_id) {
$subscription_url = $first_subscription->toUrl();
$subscription_title = $first_subscription->getTitle();
$subscription_state = $first_subscription->get('state')->first()->getValue()['value'];
$subscription_payment_method = $first_subscription->getPaymentMethod();
$subscription_payment_method_label = "none";
if ( $subscription_payment_method = $first_subscription->getPaymentMethod() ){
$subscription_payment_method_label = $subscription_payment_method->label()->render();
}
$subscription_link = Link::fromTextAndUrl(t("subscription @title @state [@pm_label]", array(
'@title' => $subscription_title,
'@state' => $subscription_state,