I have created Custom Button for "Order on WhatsApp" using the following Code at:


Please tell me how to change WhatsApp no for 2nd Magento store. I can show 2 different Whatsapp no for different stores

    <?php if ($_product->isSaleable()): ?>
         <button type="button"  title="Order on Whatsapp" class="action primary" 
         onclick=" window.open('https://wa.me/123456789 ?text=I want to order this product  <?php echo $_product->getProductUrl() ;?>/ ')"><span><span><i class="icon-us-dollar"></i>Order On Whatsapp</span></span></button> 
    <?php endif;?>

1 Answer 1


You can create custom settings for storeview like so


This will allow you change values based on different stores. In the template fetch this settings and you will get the correct numbers.

Or you can write some custom javascript that will update the link based on domain.

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.