js ile yapılabilir,
eklediğiniz butona bu kodları girip dener misiniz:
<script> document.getElementById('whatsappButton').addEventListener('click', function () { const phone = "{{$order->phone}}"; const message = encodeURIComponent("{{$item->get('sms-icerigi')}}"); const whatsappUrl = `https://api.whatsapp.com/send/?phone=${phone}&text=${message}`; window.open(whatsappUrl, '_blank'); }); </script>
Hocam
<script>
document.getElementById('whatsappButton').addEvent Listener('click', function () {
const phone = "{{$order->phone}}"; const message = encodeURIComponent("{{$item->get('sms-icerigi')}}");
const whatsappUrl = `https://api.whatsapp.com/send/?phone=${phone}&text=${message}`;
window.open(whatsappUrl, '_blank'); });
</script>
Bu şekilde sayfa editörünün en altına ekledim, js olduğu için. Fakat bu sefer sipariş detay sayfam 404'e düşüyor.