2023-06-19 17:37:09 +00:00
|
|
|
{% put scripts %}
|
|
|
|
|
|
2023-06-20 19:29:41 +00:00
|
|
|
<script>
|
|
|
|
|
function setModal(product) {
|
2023-06-21 00:01:58 +00:00
|
|
|
|
|
|
|
|
|
2023-06-20 19:29:41 +00:00
|
|
|
$('#modal_img').html(`<img src="` + product.images[0].original_image_url + `" alt="Nurgul ` + product.name + `">`);
|
|
|
|
|
$('#modal_name').html(product.name);
|
|
|
|
|
$('#modal_price').html(product.formatted_price);
|
|
|
|
|
$('#modal_desc').html(product.description);
|
2023-06-21 00:01:58 +00:00
|
|
|
|
|
|
|
|
$('#modal_add_btn').html(`
|
|
|
|
|
<a ` + ('{{nurgulToken}}' == "" ? `href='/login'` : `href="javascrip:;" data-request="onAddCart" data-request-data="product_id: `+ product.id +`, quantity: `+ qtyBtn +`"`) + `
|
|
|
|
|
class="theme-btn-1 btn btn-effect-1 d-add-to-cart"
|
|
|
|
|
title="{{add}}" data-bs-toggle="modal"
|
|
|
|
|
data-bs-target="#add_to_cart_modal">
|
|
|
|
|
<span id="modal_add">{{add}}</span>
|
|
|
|
|
</a>
|
|
|
|
|
`);
|
2023-06-20 19:29:41 +00:00
|
|
|
if (product.hasOwnProperty('special_price')) {
|
|
|
|
|
$('#modal_discount').show();
|
|
|
|
|
$('#modal_discount').html(product.formatted_regular_price);
|
|
|
|
|
} else {
|
|
|
|
|
$('#modal_discount').hide();
|
2023-06-19 17:37:09 +00:00
|
|
|
}
|
2023-06-20 19:29:41 +00:00
|
|
|
}
|
2023-06-21 00:01:58 +00:00
|
|
|
|
2023-06-20 19:29:41 +00:00
|
|
|
</script>
|
2023-06-19 17:37:09 +00:00
|
|
|
|
2023-06-19 18:52:12 +00:00
|
|
|
{% endput %}
|