magento 2 how add js in addcartsuccessmessage.phtml

Viewed 24

file path is app/design/frontend/testimonial/testimonial_theme/magento_checkout/templates/messages/addCartSuccessMessage.phtml

i have error when i im include js then show js plain text code. enter image description here

how can solve this.

my expected output is

<?= $block->escapeHtml(__(
    'You added %1 to your <a href="%2" target='_top'>shopping cart</a>',
    $block->getData('product_name'),
    $block->getData('cart_url')
), ['a']);
?>

i will try this but not reflecct in page. then i am using js then given js text as show as image

please help me how can i achieve this

0 Answers
Related