0

I'm using magento 2.3, may i ask how can i made a back button on product view page. Beacuse i tried this code but not working in the product view page. Anyone can help? thank you!!

<a class="action back" href="<?php echo $block->escapeUrl($block->getBackUrl()) ?>"><?= __('Back') ?></a>
1
  • <a class="action back" href="<?= $block->escapeHtmlAttr('javascript:history.back()') ?>"><?= $block->escapeHtml(__('Back')) ?></a> Commented Apr 1, 2022 at 12:08

1 Answer 1

2

Use this

<a class="action back" href="javascript:history.back()"><?= __('Back') ?></a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.