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>

Use this

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

Your Answer

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

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