- Issue created by @berdir
As mentioned in the other issue, I am flexible here as long as we keep the current functionality. I would prefer to handle this all in one issue, and since this has the detailed write up, I might prefer this issue.
Please propose a MR that takes care of it all.
The MR will need to address the logic for all configurable messages:if ($include_cart_button) { $view_cart_button = t('<a class="button button--primary" href=":url">@cart_button_text</a>', [ ':url' => Url::fromRoute('commerce_cart.page')->toString(), '@cart_button_text' => $config->get('cart_button_text') ?: t('View cart'), ]); } $checkout_button = NULL; if ($include_checkout_button) { $checkout_button = t('<a class="button button--secondary" href=":url">@checkout_button_text</a>', [ // @todo figure out if i need the step for the route. ':url' => Url::fromRoute('commerce_checkout.checkout')->toString(), '@checkout_button_text' => $config->get('checkout_button_text') ?: t('Checkout'), ]); } $close_button = NULL; if ($include_close_button) { $close_button = t('<a class="use-ajax button button--secondary" href=":url">@close_button_text</a>', [ ':url' => Url::fromRoute('commerce_ajax_atc.closeModal')->toString(), '@close_button_text' => $config->get('close_button_text') ?: t('Continue shopping'), ]); } // The success message. $message_text = str_replace('[variation_title]', $purchased_entity->label(), $config->get('success_message')); $url_text = str_replace('[none]', '', $config->get('cart_link_text')); $success_message = t('@message <a href=":url">@text</a>', [ '@message' => $message_text ?: t('@entity added to', [ '@entity' => $purchased_entity->label(), ]), ':url' => Url::fromRoute('commerce_cart.page')->toString(), '@text' => $config->get('cart_link_text') ? $url_text : t('your cart'), ]);