From 63bef43bb6d6c09a61c8328e077a6342bd9d472f Mon Sep 17 00:00:00 2001 From: Shohrat Date: Mon, 19 Jun 2023 22:22:06 +0000 Subject: [PATCH 1/2] mainL --- themes/nurgul/layouts/main.htm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/themes/nurgul/layouts/main.htm b/themes/nurgul/layouts/main.htm index c83de69..0c6178c 100755 --- a/themes/nurgul/layouts/main.htm +++ b/themes/nurgul/layouts/main.htm @@ -1,6 +1,3 @@ -[localePicker] -forceUrl = 1 - [staticMenu] code = "top-menu" == @@ -73,4 +70,4 @@ code = "top-menu" - + \ No newline at end of file From bb1deb8be8e81c0183888653d87cdcb79e6f3984 Mon Sep 17 00:00:00 2001 From: Shohrat Date: Tue, 20 Jun 2023 20:48:17 +0000 Subject: [PATCH 2/2] from server --- themes/nurgul/layouts/main.htm | 4 ++-- themes/nurgul/partials/scripts/addToCart.htm | 17 +++++------------ 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/themes/nurgul/layouts/main.htm b/themes/nurgul/layouts/main.htm index 05303dc..ff0c6b5 100755 --- a/themes/nurgul/layouts/main.htm +++ b/themes/nurgul/layouts/main.htm @@ -81,10 +81,10 @@ function onStart(){ - + {% partial 'scripts/addToCart' token=nurgulToken %} {% framework extras %} - {% partial 'scripts/addToCart' token=nurgulToken %} + {% scripts %} diff --git a/themes/nurgul/partials/scripts/addToCart.htm b/themes/nurgul/partials/scripts/addToCart.htm index 95227ce..eecef3b 100755 --- a/themes/nurgul/partials/scripts/addToCart.htm +++ b/themes/nurgul/partials/scripts/addToCart.htm @@ -11,27 +11,20 @@ product.product_id = prodId; product.quantity = qty; - console.log('Bearer {{token}}'); + console.log(String('Bearer {{token}}')); console.log(prodId); console.log(qty); console.log(JSON.stringify(product)); $.ajax({ async: true, - crossDomain: true, url: 'https://nurgul.com.tm/app/api/customer/cart/add/' + String(prodId), type: 'POST', - headers: { - "authorization": "Bearer {{token}}", - "content-type": "application/json", - "cache-control": "no-cache", - // "postman-token": "c4c3ed17-bdc6-1e98-4575-f1172f789d93" - }, + headers: { Authorization: 'Bearer {{token}}' }, processData: false, + contentType: false, data: JSON.stringify(product), - beforeSend: function () { - $('#loader_add').show(); - }, + dataType: 'json', success: function (data) { console.log(data); @@ -49,4 +42,4 @@ -{% endput %} +{% endput %} \ No newline at end of file