-3

I'm trying to create script which can share product link and name. I searched about it and found an good answer.

<a href="whatsapp://send?text=http://www.example.com/index.php?route=product/product&product_id=50" data-action="share/whatsapp/share">Share via Whatsapp</a>

Above link is just sending product URL to whatapps, but i want to send title as well. Is there possible that i can send product title as well.

Community
  • 1
  • 1
Ayaz Ali Shah
  • 3,453
  • 9
  • 36
  • 68

1 Answers1

1

I try to more searched about it and finally i got solution for this. I just add php syntax urlencode().

<a href="whatsapp://send?text=<?php echo urlencode ('http://www.example.com/index.php?route=product/product&product_id=110'); ?>" data-action="share/whatsapp/share">Share via Whatsapp</a>
Ayaz Ali Shah
  • 3,453
  • 9
  • 36
  • 68