diff --git a/plugins/romanah/bagisto/components/Session.php b/plugins/romanah/bagisto/components/Session.php index ef6e8eb..7838bee 100644 --- a/plugins/romanah/bagisto/components/Session.php +++ b/plugins/romanah/bagisto/components/Session.php @@ -82,4 +82,33 @@ class Session extends ComponentBase } } + + function onGetCart() + { + $getToken = SessionP::get('nurgulToken'); + + $response = Http::get('http://nurgul.com.tm/app/api/customer/cart', function ($http) use($getToken) { + $http->header('Authorization', 'Bearer '.$getToken); + }); + + $dataqq = json_decode($response); + + return $dataqq; + } + + + function onDeleteCartItem() + { + $getToken = SessionP::get('nurgulToken'); + $dataInput = post(); + + $response = Http::delete('http://nurgul.com.tm/app/api/customer/cart/remove/'.$dataInput["item_id"], function ($http) use($getToken) { + $http->header('Authorization', 'Bearer '.$getToken); + }); + + $dataqq = json_decode($response); + + return $dataqq; + } + } diff --git a/themes/nurgul/layouts/mainN.htm b/themes/nurgul/layouts/mainN.htm index 539b506..04d067b 100755 --- a/themes/nurgul/layouts/mainN.htm +++ b/themes/nurgul/layouts/mainN.htm @@ -86,6 +86,7 @@ function onStart(){ {% scripts %} + diff --git a/themes/nurgul/partials/cart.htm b/themes/nurgul/partials/cart.htm index 1892720..3907bae 100755 --- a/themes/nurgul/partials/cart.htm +++ b/themes/nurgul/partials/cart.htm @@ -2,60 +2,23 @@
- Cart + {{'cart.title'|_}}
-
-
-
- Image - -
-
-
Premium Joyful
- 1 x $65.00 -
-
-
-
- Image - -
-
-
The White Rose
- 1 x $85.00 -
-
-
-
- Image - -
-
-
Red Rose Bouquet
- 1 x $92.00 -
-
-
-
- Image - -
-
-
Pink Flower Tree
- 1 x $68.00 -
-
+
+ +
{{'empty.cart'|_}}
+
diff --git a/themes/nurgul/partials/header.htm b/themes/nurgul/partials/header.htm index 8fd9ae4..3d8a9b5 100755 --- a/themes/nurgul/partials/header.htm +++ b/themes/nurgul/partials/header.htm @@ -45,10 +45,14 @@
@@ -147,5 +151,88 @@ +{% if nurgulToken != "" %} +{% put scripts %} + +{% endput %} +{% endif %} diff --git a/themes/nurgul/partials/modals.htm b/themes/nurgul/partials/modals.htm index 17757d0..bfdef67 100755 --- a/themes/nurgul/partials/modals.htm +++ b/themes/nurgul/partials/modals.htm @@ -32,12 +32,12 @@ - -
- -
- - - -
- -
- diff --git a/themes/nurgul/partials/product/tab-pane-item.htm b/themes/nurgul/partials/product/tab-pane-item.htm index 2a61ffe..8b1c029 100755 --- a/themes/nurgul/partials/product/tab-pane-item.htm +++ b/themes/nurgul/partials/product/tab-pane-item.htm @@ -18,15 +18,15 @@
@@ -38,13 +38,13 @@
diff --git a/themes/nurgul/partials/scripts/setModal.htm b/themes/nurgul/partials/scripts/setModal.htm index 31388c4..e5acfe9 100755 --- a/themes/nurgul/partials/scripts/setModal.htm +++ b/themes/nurgul/partials/scripts/setModal.htm @@ -2,11 +2,21 @@ {% endput %}