Product view back button
-
12-04-2021 - |
Question
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>
Solution
Use this
<a class="action back" href="javascript:history.back()"><?= __('Back') ?></a>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange