0

How do I change "Notify me when this product is in stock" text into a button?

I have duplicated /vendor/magento/module-product-alert/view/frontend/templates/product/view.phtml to local theme.

Thank you!

1 Answer 1

0

Use below updated code inside the file in your local theme.

<div class="product alert <?= $block->getHtmlClass() ?>">
<button type="button"
        onclick="location.href='<?= $block->escapeUrl($block->getSignupUrl()) ?>'"
        title="<?= $block->escapeHtml(__($block->getSignupLabel())) ?>"
        class="action alert">
    <?= $block->escapeHtml(__($block->getSignupLabel())) ?>
</button>
</div>
1
  • Works perfecty. Thank you so much!
    – Charlie B
    Feb 15 at 9:53

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.