0

I have an extension installed that add's a "quote" cart to my Magento 2.3.4 site.

It looks similar to how the default cart works, but it allows customers to add products to a quote-cart and submit it to us so we can send them current pricing.

When a customer adds a product to their quote-cart, the extension creates a mage notification (inside of the green bar) that says:

"You have added "x" product to your quote"

I'd like to change that notification to include a static link that will take them to their quote-cart ("static" as in, one, common URL work's the same for all customers/sessions).

However, this notification comes from a PHP file within the extension's controller folder. (not the standard magento template .phtml file that the default cart notification message does).

Here's the bit of code that creates the notification:

protected function getSuccessMess($hasError, $product)
    {
        if (!$hasError) {
            $message = __(
              'You added %1 to your quote.',
              $product->getName()
          );
            $this->messageManager->addSuccessMessage($message);
        }
    }

When ever I try to add the HTML link to the message, it will actually print out the escaped HTML code as plain text inside of the notification!

How can I get it to include HTML code that will be rendered and shown in the customers notification bar as an actual link (like the default magento cart notification does).

I'm a PHP n00B so please go easy on me! :)

Thank you SO much for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.