make order, wishlist
This commit is contained in:
parent
ea5a172a36
commit
0c120b70c5
|
|
@ -57,7 +57,7 @@ class Session extends ComponentBase
|
||||||
$dataInput = post();
|
$dataInput = post();
|
||||||
|
|
||||||
|
|
||||||
$response = Http::post('http://nurgul.com.tm/app/api/customer/cart/add/'.$dataInput["product_id"], function ($http) use($getToken, $dataInput) {
|
$response = Http::post('https://nurgul.com.tm/app/api/customer/cart/add/'.$dataInput["product_id"], function ($http) use($getToken, $dataInput) {
|
||||||
// $http->header('Content-Type', 'application/json');
|
// $http->header('Content-Type', 'application/json');
|
||||||
$http->header('Authorization', 'Bearer '.$getToken);
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
$http->header('Accept', 'application/json');
|
$http->header('Accept', 'application/json');
|
||||||
|
|
@ -87,7 +87,7 @@ class Session extends ComponentBase
|
||||||
{
|
{
|
||||||
$getToken = SessionP::get('nurgulToken');
|
$getToken = SessionP::get('nurgulToken');
|
||||||
|
|
||||||
$response = Http::get('http://nurgul.com.tm/app/api/customer/cart', function ($http) use($getToken) {
|
$response = Http::get('https://nurgul.com.tm/app/api/customer/cart', function ($http) use($getToken) {
|
||||||
$http->header('Authorization', 'Bearer '.$getToken);
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ class Session extends ComponentBase
|
||||||
$getToken = SessionP::get('nurgulToken');
|
$getToken = SessionP::get('nurgulToken');
|
||||||
$dataInput = post();
|
$dataInput = post();
|
||||||
|
|
||||||
$response = Http::delete('http://nurgul.com.tm/app/api/customer/cart/remove/'.$dataInput["item_id"], function ($http) use($getToken) {
|
$response = Http::delete('https://nurgul.com.tm/app/api/customer/cart/remove/'.$dataInput["item_id"], function ($http) use($getToken) {
|
||||||
$http->header('Authorization', 'Bearer '.$getToken);
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -117,7 +117,7 @@ class Session extends ComponentBase
|
||||||
$getToken = SessionP::get('nurgulToken');
|
$getToken = SessionP::get('nurgulToken');
|
||||||
$dataInput = post();
|
$dataInput = post();
|
||||||
|
|
||||||
$response = Http::delete('http://nurgul.com.tm/app/api/customer/cart/remove/'.$dataInput["item_id"], function ($http) use($getToken) {
|
$response = Http::delete('https://nurgul.com.tm/app/api/customer/cart/remove/'.$dataInput["item_id"], function ($http) use($getToken) {
|
||||||
$http->header('Authorization', 'Bearer '.$getToken);
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -129,6 +129,167 @@ class Session extends ComponentBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onGetAddress()
|
||||||
|
{
|
||||||
|
$getToken = SessionP::get('nurgulToken');
|
||||||
|
|
||||||
|
$response = Http::get('https://nurgul.com.tm/app/api/customer/addresses', function ($http) use($getToken) {
|
||||||
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
|
});
|
||||||
|
|
||||||
|
$dataqq = json_decode($response);
|
||||||
|
|
||||||
|
return $dataqq;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAddAddress()
|
||||||
|
{
|
||||||
|
$getToken = SessionP::get('nurgulToken');
|
||||||
|
$dataInput = post();
|
||||||
|
|
||||||
|
|
||||||
|
$response = Http::post('https://nurgul.com.tm/app/api/customer/addresses', function ($http) use($getToken, $dataInput) {
|
||||||
|
// $http->header('Content-Type', 'application/json');
|
||||||
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
|
$http->header('Accept', 'application/json');
|
||||||
|
|
||||||
|
// $data = $dataProd;
|
||||||
|
$data = [
|
||||||
|
$http->data("locale", 'tm'),
|
||||||
|
$http->data("address1", [$dataInput["new_addr"]]),
|
||||||
|
$http->data("city", 'Ashgabat'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$http->setOption(CURLOPT_POSTFIELDS, json_encode($data));
|
||||||
|
});
|
||||||
|
|
||||||
|
$dataqq = json_decode($response);
|
||||||
|
|
||||||
|
if (!empty($dataqq)) {
|
||||||
|
Flash::success("Üstünlikli Salgy Goşuldy");
|
||||||
|
return redirect()->refresh();
|
||||||
|
} elseif (empty($dataqq)) {
|
||||||
|
Flash::error('Ýalňyşlyk Ýüze Çykdy!!!');
|
||||||
|
return redirect()->refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function onSaveShipping()
|
||||||
|
{
|
||||||
|
$getToken = SessionP::get('nurgulToken');
|
||||||
|
$dataInput = post();
|
||||||
|
|
||||||
|
|
||||||
|
$response = Http::post('https://nurgul.com.tm/app/api/customer/checkout/save-shipping', function ($http) use($getToken, $dataInput) {
|
||||||
|
// $http->header('Content-Type', 'application/json');
|
||||||
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
|
$http->header('Accept', 'application/json');
|
||||||
|
|
||||||
|
// $data = $dataProd;
|
||||||
|
$data = [
|
||||||
|
$http->data("billing", ["address1" => [$dataInput["selected_address"]]]),
|
||||||
|
$http->data("shipping", ["address1" => [$dataInput["selected_address"]]]),
|
||||||
|
$http->data("shipping_method", 'courier_courier'),
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$http->setOption(CURLOPT_POSTFIELDS, json_encode($data));
|
||||||
|
});
|
||||||
|
|
||||||
|
$dataqq = json_decode($response);
|
||||||
|
|
||||||
|
return $dataqq;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSavePayment()
|
||||||
|
{
|
||||||
|
$getToken = SessionP::get('nurgulToken');
|
||||||
|
$dataInput = post();
|
||||||
|
|
||||||
|
|
||||||
|
$response = Http::post('https://nurgul.com.tm/app/api/customer/checkout/save-payment', function ($http) use($getToken, $dataInput) {
|
||||||
|
// $http->header('Content-Type', 'application/json');
|
||||||
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
|
$http->header('Accept', 'application/json');
|
||||||
|
|
||||||
|
// $data = $dataProd;
|
||||||
|
$data = [
|
||||||
|
$http->data("payment", ["method" => $dataInput["payment"]]),
|
||||||
|
];
|
||||||
|
|
||||||
|
$http->setOption(CURLOPT_POSTFIELDS, json_encode($data));
|
||||||
|
});
|
||||||
|
|
||||||
|
$dataqq = json_decode($response);
|
||||||
|
|
||||||
|
return $dataqq;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function onSaveOrder()
|
||||||
|
{
|
||||||
|
$getToken = SessionP::get('nurgulToken');
|
||||||
|
|
||||||
|
|
||||||
|
$response = Http::post('https://nurgul.com.tm/app/api/customer/checkout/save-order', function ($http) use($getToken) {
|
||||||
|
// $http->header('Content-Type', 'application/json');
|
||||||
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
|
$http->header('Accept', 'application/json');
|
||||||
|
|
||||||
|
|
||||||
|
$http->setOption(CURLOPT_POSTFIELDS);
|
||||||
|
});
|
||||||
|
|
||||||
|
$dataqq = json_decode($response);
|
||||||
|
|
||||||
|
if (!empty($dataqq)) {
|
||||||
|
Flash::success("Sargydyňyz Üstünlikli Amala Aşyryldy");
|
||||||
|
return Redirect::to('/');
|
||||||
|
} elseif (empty($dataqq)) {
|
||||||
|
Flash::error('Ýalňyşlyk Ýüze Çykdy!!!');
|
||||||
|
return redirect()->refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function onSaveWishlist()
|
||||||
|
{
|
||||||
|
$getToken = SessionP::get('nurgulToken');
|
||||||
|
$dataInput = post();
|
||||||
|
|
||||||
|
|
||||||
|
$response = Http::post('https://nurgul.com.tm/app/api/customer/wishlist/'.$dataInput["product_id"], function ($http) use($getToken, $dataInput) {
|
||||||
|
// $http->header('Content-Type', 'application/json');
|
||||||
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
|
$http->header('Accept', 'application/json');
|
||||||
|
|
||||||
|
$http->setOption(CURLOPT_POSTFIELDS);
|
||||||
|
});
|
||||||
|
|
||||||
|
$dataqq = json_decode($response);
|
||||||
|
|
||||||
|
if (!empty($dataqq)) {
|
||||||
|
Flash::success("Halanlaryma Üstünlikli Goşuldy");
|
||||||
|
return Redirect::to('/wishlist');
|
||||||
|
} elseif (empty($dataqq)) {
|
||||||
|
Flash::error('Ýalňyşlyk Ýüze Çykdy!!!');
|
||||||
|
return redirect()->refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onGetWish()
|
||||||
|
{
|
||||||
|
$getToken = SessionP::get('nurgulToken');
|
||||||
|
|
||||||
|
$response = Http::get('https://nurgul.com.tm/app/api/customer/wishlist', function ($http) use($getToken) {
|
||||||
|
$http->header('Authorization', 'Bearer '.$getToken);
|
||||||
|
});
|
||||||
|
|
||||||
|
$dataqq = json_decode($response);
|
||||||
|
|
||||||
|
return $dataqq;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
title = "Cart"
|
|
||||||
url = "/cart"
|
url = "/cart"
|
||||||
layout = "mainN"
|
layout = "mainN"
|
||||||
|
title = "Cart"
|
||||||
==
|
==
|
||||||
{%partial "bread" title='cart.title'|_ %}
|
{%partial "bread" title='cart.title'|_ %}
|
||||||
|
|
||||||
|
|
@ -51,7 +51,7 @@ layout = "mainN"
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="btn-wrapper text-right">
|
<div class="btn-wrapper text-right">
|
||||||
<a href="/" class="theme-btn-1 btn btn-effect-1">{{'cart.checkout.title'|_}}</a>
|
<a href="/checkout" class="theme-btn-1 btn btn-effect-1">{{'cart.checkout.title'|_}}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -59,4 +59,4 @@ layout = "mainN"
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- SHOPING CART AREA END -->
|
<!-- SHOPING CART AREA END -->
|
||||||
|
|
@ -72,7 +72,7 @@ function onStart(){
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% partial 'product/tab-pane' %}
|
{% partial 'product/tab-pane' id='cat' %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,179 @@
|
||||||
|
title = "Checkout"
|
||||||
|
url = "/checkout"
|
||||||
|
layout = "mainN"
|
||||||
|
==
|
||||||
|
{%partial "bread" title='checkout.title'|_ %}
|
||||||
|
<div class="ltn__checkout-area mb-100">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="ltn__checkout-inner">
|
||||||
|
<div class="ltn__checkout-single-content ltn__coupon-code-wrap">
|
||||||
|
<h5>{{'checkout.select.addr'|_}} <a class="ltn__secondary-color"
|
||||||
|
href="checkout.html#ltn__coupon-code"
|
||||||
|
data-bs-toggle="collapse">{{'checkout.new.addr'|_}}</a></h5>
|
||||||
|
<div id="ltn__coupon-code" class="collapse ltn__checkout-single-content-info">
|
||||||
|
<div class="ltn__coupon-code-form">
|
||||||
|
<form data-request="onAddAddress">
|
||||||
|
<input type="text" name="new_addr" placeholder="{{'checkout.address.add'|_}}">
|
||||||
|
<button type="submit" class="btn theme-btn-2 btn-effect-2 text-uppercase">{{'add.btn'|_}}</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ltn__checkout-payment-method mt-50">
|
||||||
|
|
||||||
|
<div id="checkout_accordion_1">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-5 mt-30">
|
||||||
|
<h6>{{'checkout.select.payment.type'|_}}</h6>
|
||||||
|
<div class="input-item">
|
||||||
|
<select class="nice-select" onchange="savePayment(this.value);">
|
||||||
|
<option value="cash100">{{'cash.payment'|_}}</option>
|
||||||
|
<option value="terminal100">{{'cart.payment'|_}}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-7">
|
||||||
|
<div class="shoping-cart-total mt-50">
|
||||||
|
<h4 class="title-2">{{'checkout.cart.total'|_}}</h4>
|
||||||
|
<table class="table">
|
||||||
|
<tbody id="checkout_cart">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
<tfooter>
|
||||||
|
<tr>
|
||||||
|
<td><strong>{{'checkout.order.total'|_}}</strong></td>
|
||||||
|
<td><strong id="checkout_total">0.00 TMT</strong></td>
|
||||||
|
</tr>
|
||||||
|
</tfooter>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="ltn__payment-note mt-30 mb-30">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<button {% if nurgulToken != "" %} onclick="saveOrder();" {% endif %} class="btn theme-btn-1 btn-effect-1 text-uppercase"
|
||||||
|
type="button">{{'place.order'|_}}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if nurgulToken != "" %}
|
||||||
|
{% put scripts %}
|
||||||
|
<script>
|
||||||
|
oc.ajax('onGetCart', {
|
||||||
|
success: function (data) {
|
||||||
|
if (data.data != null) {
|
||||||
|
var cart = data.data;
|
||||||
|
|
||||||
|
$('#checkout_total').html(cart.formatted_grand_total);
|
||||||
|
|
||||||
|
for (var cart of cart.vendors["nurgulShop"]) {
|
||||||
|
$('#checkout_cart').append(`
|
||||||
|
<tr>
|
||||||
|
<td>` + cart.product.name + `<strong>× `+ cart.additional.quantity + `</strong></td>
|
||||||
|
<td>` + cart.formatted_total + `</td>
|
||||||
|
</tr>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
oc.ajax('onGetAddress', {
|
||||||
|
success: function (data) {
|
||||||
|
if (data.data != null) {
|
||||||
|
var addrs = data.data;
|
||||||
|
console.log(addrs[0]);
|
||||||
|
|
||||||
|
oc.ajax('onSaveShipping', {
|
||||||
|
data: { selected_address: addrs[0].address1[0] },
|
||||||
|
success: function (data) {
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
oc.ajax('onSavePayment', {
|
||||||
|
data: { payment: 'cash100' },
|
||||||
|
success: function (data) {
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
for (var i = 0, len = addrs.length; i < len; i++) {
|
||||||
|
// console.log(product.hasOwnProperty('special_price'));
|
||||||
|
$('#checkout_accordion_1').append(`
|
||||||
|
<div class="card" onclick="saveShipping('`+ addrs[i].address1[0] +`');">
|
||||||
|
<h5 class="collapsed ltn__card-title" data-bs-toggle="collapse"
|
||||||
|
data-bs-target="#faq-item-2-`+ (i + 1) + `" aria-expanded="` + (i == 0 ? `true` : `false`) + `">
|
||||||
|
#`+ (i + 1) + ` {{'addr.title.select'|_}}
|
||||||
|
</h5>
|
||||||
|
<div id="faq-item-2-`+ (i + 1) + `" class="collapse ` + (i == 0 ? `show` : ``) + `" data-bs-parent="#checkout_accordion_1">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>`+ addrs[i].address1[0] + `</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function saveShipping(addr) {
|
||||||
|
oc.ajax('onSaveShipping', {
|
||||||
|
data: { selected_address: addr },
|
||||||
|
success: function (data) {
|
||||||
|
console.log(data);
|
||||||
|
oc.flashMsg({
|
||||||
|
message: "{{'selected.address.success'|_}}",
|
||||||
|
type: 'success',
|
||||||
|
interval: 3
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function savePayment(paymentS) {
|
||||||
|
oc.ajax('onSavePayment', {
|
||||||
|
data: { payment: paymentS },
|
||||||
|
success: function (data) {
|
||||||
|
console.log(data);
|
||||||
|
oc.flashMsg({
|
||||||
|
message: "{{'selected.payment.success'|_}}",
|
||||||
|
type: 'success',
|
||||||
|
interval: 3
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveOrder() {
|
||||||
|
oc.ajax('onSaveOrder', {
|
||||||
|
success: function (data) {
|
||||||
|
console.log(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endput %}
|
||||||
|
{% endif %}
|
||||||
|
|
@ -87,24 +87,15 @@ function onStart(){
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<div class="cart-plus-minus">
|
<div class="cart-plus-minus">
|
||||||
<input type="text" value="02" name="qtybutton"
|
<input type="text" value="1" name="qtybutton"
|
||||||
class="cart-plus-minus-box">
|
class="cart-plus-minus-box">
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li id="detail_add_cart">
|
||||||
<a href="#"
|
|
||||||
class="theme-btn-1 btn btn-effect-1 d-add-to-cart"
|
|
||||||
title="Add to Cart" data-bs-toggle="modal"
|
|
||||||
data-bs-target="#add_to_cart_modal">
|
|
||||||
<span id="product_add"></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li id="detail_wishlist">
|
||||||
<a href="#"
|
|
||||||
class="btn btn-effect-1 d-add-to-wishlist" title="Add to Cart"
|
|
||||||
data-bs-toggle="modal" data-bs-target="#add_to_cart_modal">
|
|
||||||
<i class="icon-heart"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
title = "wishlist"
|
||||||
|
url = "/wishlist"
|
||||||
|
layout = "mainN"
|
||||||
|
==
|
||||||
|
|
||||||
|
{%partial "bread" title='wishlist.title'|_ %}
|
||||||
|
|
||||||
|
{% partial 'loader/loader' id='loader_wish' %}
|
||||||
|
|
||||||
|
<div id="detail_screen">
|
||||||
|
<div class="ltn__product-area mb-100">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="ltn__shop-options">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<div class="showing-product-number text-right" id="show_title">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<!-- <div class="short-by text-center">
|
||||||
|
<select class="nice-select">
|
||||||
|
<option>Default sorting</option>
|
||||||
|
<option>Sort by popularity</option>
|
||||||
|
<option>Sort by new arrivals</option>
|
||||||
|
<option>Sort by price: low to high</option>
|
||||||
|
<option>Sort by price: high to low</option>
|
||||||
|
</select>
|
||||||
|
</div> -->
|
||||||
|
<div class="ltn__grid-list-tab-menu ">
|
||||||
|
<div class="nav">
|
||||||
|
<a class="active show" data-bs-toggle="tab" href="#liton_product_grid"><i
|
||||||
|
class="icon-grid"></i></a>
|
||||||
|
<a data-bs-toggle="tab" href="#liton_product_list"><i class="icon-menu"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane fade active show" id="liton_product_grid">
|
||||||
|
<div class="ltn__product-tab-content-inner ltn__product-grid-view">
|
||||||
|
<div class="row" id="products_wish">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% partial 'product/tab-pane' id='wish' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% partial 'helper/pagination' %}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% partial 'scripts/getWishlist' add='add.cart'|_ id='wish' %}
|
||||||
|
|
@ -16,11 +16,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
<a href="/cart" class="theme-btn-1 btn btn-effect-1">{{'cart.view.title'|_}}</a>
|
<a href="/cart" class="theme-btn-1 btn btn-effect-1">{{'cart.view.title'|_}}</a>
|
||||||
<a href="/" class="theme-btn-2 btn btn-effect-2">{{'cart.checkout.title'|_}}</a>
|
<a href="/checkout" class="theme-btn-2 btn btn-effect-2">{{'cart.checkout.title'|_}}</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- <p>Free Shipping on All Orders Over $100!</p> -->
|
<!-- <p>Free Shipping on All Orders Over $100!</p> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Utilize Cart Menu End -->
|
<!-- Utilize Cart Menu End -->
|
||||||
|
|
@ -58,12 +58,8 @@
|
||||||
<li id="modal_add_btn">
|
<li id="modal_add_btn">
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li id="modal_wish">
|
||||||
<a href="#" class="btn btn-effect-1 d-add-to-wishlist"
|
|
||||||
title="Add to Cart" data-bs-toggle="modal"
|
|
||||||
data-bs-target="#liton_wishlist_modal">
|
|
||||||
<i class="icon-heart"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div class="tab-pane fade" id="liton_product_list">
|
<div class="tab-pane fade" id="liton_product_list">
|
||||||
<div class="ltn__product-tab-content-inner ltn__product-list-view">
|
<div class="ltn__product-tab-content-inner ltn__product-list-view">
|
||||||
<div class="row" id="products_list_cat">
|
<div class="row" id="products_list_{{id}}">
|
||||||
<!-- ltn__product-item -->
|
<!-- ltn__product-item -->
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
{% put scripts %}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
getWish();
|
||||||
|
$('#pagination').hide();
|
||||||
|
// console.log("qqq");
|
||||||
|
function getWish() {
|
||||||
|
|
||||||
|
oc.ajax('onGetWish', {
|
||||||
|
beforeSend: function () {
|
||||||
|
$('#products_{{id}}').html("");
|
||||||
|
$('#products_list_{{id}}').html("");
|
||||||
|
$('#pagination_numbers').html("");
|
||||||
|
$('#detail_screen').hide();
|
||||||
|
$('#products_{{id}}').hide();
|
||||||
|
$('#loader_{{id}}').show();
|
||||||
|
},
|
||||||
|
success: function (data, textStatus, xhr) {
|
||||||
|
$('#detail_screen').show();
|
||||||
|
$('#loader_{{id}}').hide();
|
||||||
|
$('#products_{{id}}').show();
|
||||||
|
// $('#show_title').html(`<span>{{'all'|_}}` + data.meta.total + `, {{'per.page'|_}} ` + data.meta.to + `</span>`);
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
var products = data.data;
|
||||||
|
if (products.length > 0) {
|
||||||
|
for (var product of products) {
|
||||||
|
// console.log(product.name);
|
||||||
|
$('#products_{{id}}').append(productCard(product.product));
|
||||||
|
$('#products_list_{{id}}').append(productList(product.product));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$('#products_{{id}}').html('<div>{{"no.product"|_}}</div>');
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function (xhr, textStatus, errorThrown) {
|
||||||
|
console.log('Error in Operation');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
{% endput %}
|
||||||
|
|
||||||
|
{%partial 'scripts/setModal' %}
|
||||||
|
{%partial 'scripts/prodCard' %}
|
||||||
|
|
@ -48,9 +48,8 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#" title="Quick View" data-bs-toggle="modal"
|
<a` + ("{{nurgulToken}}" == "" ? ` href='/login'` : ` href="javascript:;" data-request="onSaveWishlist" data-request-data="product_id: `+ product.id +`" `) + ` title="Quick View">
|
||||||
data-bs-target="#quick_view_modal">
|
<i class="icon-heart"></i>
|
||||||
<i class="icon-shuffle"></i>
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -147,7 +146,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li>`+
|
<li>`+
|
||||||
|
|
||||||
"<a href='#' onClick='setModal(" + product_str + ")' title='Quick View' data-bs-toggle='modal' data-bs-target='#quick_view_modal'><i class='icon-shuffle'></i></a>" +
|
`<a ` + ("{{nurgulToken}}" == "" ? ` href='/login'` : ` href="javascript:;" data-request="onSaveWishlist" data-request-data="product_id: `+ product.id +`" `) + ` title='Quick View'><i class='icon-heart'></i></a>` +
|
||||||
`</li>
|
`</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,20 @@
|
||||||
$('#product_price').html(product.formatted_price);
|
$('#product_price').html(product.formatted_price);
|
||||||
$('#product_desc_short').html(product.short_description);
|
$('#product_desc_short').html(product.short_description);
|
||||||
$('#product_desc').html(product.description);
|
$('#product_desc').html(product.description);
|
||||||
|
$('#detail_add_cart').html(
|
||||||
|
`<a ` + ("{{nurgulToken}}" == "" ? `href='/login'` : `href="javascrip:;" data-request="onAddCart" data-request-data="product_id: `+ product.id +`, quantity: `+ 1 +`"`) + `
|
||||||
|
class="theme-btn-1 btn btn-effect-1 d-add-to-cart"
|
||||||
|
title="Add to Cart" data-bs-toggle="modal"
|
||||||
|
data-bs-target="#add_to_cart_modal">
|
||||||
|
<span id="product_add"></span>
|
||||||
|
</a>`
|
||||||
|
);
|
||||||
|
$('#detail_wishlist').html(
|
||||||
|
`<a ` + ("{{nurgulToken}}" == "" ? `href='/login'` : `href="javascript:;" data-request="onSaveWishlist" data-request-data="product_id: `+ product.id +`" `) + ` class="btn btn-effect-1 d-add-to-wishlist" title="Add to Cart"
|
||||||
|
data-bs-toggle="modal" data-bs-target="#add_to_cart_modal">
|
||||||
|
<i class="icon-heart"></i>
|
||||||
|
</a>`
|
||||||
|
);
|
||||||
$('#product_add').html(`{{ 'add.cart'|_ }}`);
|
$('#product_add').html(`{{ 'add.cart'|_ }}`);
|
||||||
|
|
||||||
if (product.hasOwnProperty('special_price')) {
|
if (product.hasOwnProperty('special_price')) {
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,21 @@
|
||||||
$('#modal_desc').html(product.description);
|
$('#modal_desc').html(product.description);
|
||||||
|
|
||||||
$('#modal_add_btn').html(`
|
$('#modal_add_btn').html(`
|
||||||
<a ` + ("{{nurgulToken}}" == "" ? `href='/login'` : `href="javascrip:;" data-request="onAddCart" data-request-data="product_id: `+ product.id +`, quantity: `+ qtyBtn +`"`) + `
|
<a ` + ("{{nurgulToken}}" == "" ? `href='/login'` : `href="javascrip:;" data-request="onAddCart" data-request-data="product_id: `+ product.id +`, quantity: `+ 1 +`"`) + `
|
||||||
class="theme-btn-1 btn btn-effect-1 d-add-to-cart"
|
class="theme-btn-1 btn btn-effect-1 d-add-to-cart"
|
||||||
title="{{add}}" data-bs-toggle="modal"
|
title="{{add}}" data-bs-toggle="modal"
|
||||||
data-bs-target="#add_to_cart_modal">
|
data-bs-target="#add_to_cart_modal">
|
||||||
<span id="modal_add">{{add}}</span>
|
<span id="modal_add">{{add}}</span>
|
||||||
</a>
|
</a>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
$('#modal_wish').html(`
|
||||||
|
<a ` + ("{{nurgulToken}}" == "" ? `href='/login'` : `href="javascript:;" data-request="onSaveWishlist" data-request-data="product_id: `+ product.id +`" `) + ` class="btn btn-effect-1 d-add-to-wishlist"
|
||||||
|
title="Add to Cart" data-bs-toggle="modal"
|
||||||
|
data-bs-target="#liton_wishlist_modal">
|
||||||
|
<i class="icon-heart"></i>
|
||||||
|
</a>
|
||||||
|
`);
|
||||||
if (product.hasOwnProperty('special_price')) {
|
if (product.hasOwnProperty('special_price')) {
|
||||||
$('#modal_discount').show();
|
$('#modal_discount').show();
|
||||||
$('#modal_discount').html(product.formatted_regular_price);
|
$('#modal_discount').html(product.formatted_regular_price);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue