Hello i need help in this code Undefined constant “page_link” (View: resourcesviewshomeindex.blade.php) In the: “resourcesviews/home/index.blade.php” file at line: 19
JavaScript
x
<script>
var url = 'https://wati-integration-service.clare.ai/ShopifyWidget/shopifyWidget.js?84151';
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = url;
var options = {"enabled":true,"chatButtonSetting":{
"backgroundColor":"#4dc247",
"ctaText":"",
"borderRadius":"25",
"marginLeft":"0",
"marginBottom":"50",
"marginRight":"50",
"position":"left"},"brandSetting":{
"brandName":"123Albania",
"brandSubTitle":"Zakonisht përgjigjet brenda një dite",
"brandImg":"https://cdn.clare.ai/wati/images/WATI_logo_square_2.png",
"welcomeText":"Pershendetje!nSi mund te ju ndihmoj?",
"messageText":"Pershendetje, kam nje pytje rreth {{page_link}}",
"backgroundColor":"#0a5f54",
"ctaText":"Fillo biseden",
"borderRadius":"25",
"autoShow":false,
"phoneNumber":""}};s.onload = function() {
CreateWhatsappChatWidget(options);
};
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
Advertisement
Answer
Because you call a constant page_link
. Replace it with $page_link
:
JavaScript
<script>
var url = 'https://wati-integration-service.clare.ai/ShopifyWidget/shopifyWidget.js?84151';
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = url;
var options = {"enabled":true,"chatButtonSetting":{
"backgroundColor":"#4dc247",
"ctaText":"",
"borderRadius":"25",
"marginLeft":"0",
"marginBottom":"50",
"marginRight":"50",
"position":"left"},"brandSetting":{
"brandName":"123Albania",
"brandSubTitle":"Zakonisht përgjigjet brenda një dite",
"brandImg":"https://cdn.clare.ai/wati/images/WATI_logo_square_2.png",
"welcomeText":"Pershendetje!nSi mund te ju ndihmoj?",
"messageText":"Pershendetje, kam nje pytje rreth {{ $page_link }}",
"backgroundColor":"#0a5f54",
"ctaText":"Fillo biseden",
"borderRadius":"25",
"autoShow":false,
"phoneNumber":""}};s.onload = function() {
CreateWhatsappChatWidget(options);
};
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);