30coffee 19.07

This commit is contained in:
Kerim 2022-07-19 10:50:22 +05:00
parent ebbc94d173
commit ddcadd1188
18 changed files with 898 additions and 167 deletions

View File

@ -3,6 +3,7 @@
use Lang; use Lang;
use Input; use Input;
use Cms\Classes\ComponentBase; use Cms\Classes\ComponentBase;
use Illuminate\Support\Facades\Redirect;
use Kharanenka\Helper\Result; use Kharanenka\Helper\Result;
use Lovata\Toolbox\Traits\Helpers\TraitValidationHelper; use Lovata\Toolbox\Traits\Helpers\TraitValidationHelper;
@ -12,6 +13,7 @@ use Lovata\OrdersShopaholic\Classes\Item\PaymentMethodItem;
use Lovata\OrdersShopaholic\Classes\Item\ShippingTypeItem; use Lovata\OrdersShopaholic\Classes\Item\ShippingTypeItem;
use Lovata\OrdersShopaholic\Classes\Processor\CartProcessor; use Lovata\OrdersShopaholic\Classes\Processor\CartProcessor;
use Lovata\OrdersShopaholic\Classes\Processor\OfferCartPositionProcessor; use Lovata\OrdersShopaholic\Classes\Processor\OfferCartPositionProcessor;
use PHP_CodeSniffer\Reports\Info;
/** /**
* Class Cart * Class Cart
@ -64,11 +66,12 @@ class Cart extends ComponentBase
*/ */
public function onAdd() public function onAdd()
{ {
// log("sdfsdfsd");
$arRequestData = Input::get('cart'); $arRequestData = Input::get('cart');
CartProcessor::instance()->add($arRequestData, OfferCartPositionProcessor::class); CartProcessor::instance()->add($arRequestData, OfferCartPositionProcessor::class);
Result::setData(CartProcessor::instance()->getCartData()); Result::setData(CartProcessor::instance()->getCartData());
return Result::get(); return Result::get();
} }

View File

@ -35,6 +35,12 @@ class Post extends ComponentBase
'default' => '{{ :slug }}', 'default' => '{{ :slug }}',
'type' => 'string', 'type' => 'string',
], ],
'id' => [
'title' => 'Post Id',
'description' => 'Post Id',
'default' => '{{ :id }}',
'type' => 'string',
],
'categoryPage' => [ 'categoryPage' => [
'title' => 'rainlab.blog::lang.settings.post_category', 'title' => 'rainlab.blog::lang.settings.post_category',
'description' => 'rainlab.blog::lang.settings.post_category_description', 'description' => 'rainlab.blog::lang.settings.post_category_description',

View File

@ -0,0 +1,3 @@
<h2>About Our Stqqory</h2>
<p>A restaurant sometimes known as a diner is a place where cooked food is sold to the public, and where people sit down to eat it. It is also a place where people go to enjoy the time and to eat a meal. Some restaurants are a chain, meaning that there are restaurants which have the same name and servqqqe is also a place where people go to enjoy the time and to eat a meal the same food.</p>

View File

@ -1,7 +1,11 @@
[localePicker]
forceUrl = 0
[Cart]
== ==
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zxx"> <html lang="{{activeLocale}}">
{% set obCartPositionList = Cart.get() %}
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -50,11 +54,58 @@
max-width: 60% !important; max-width: 60% !important;
margin: auto; margin: auto;
} }
#toast-success {
visibility: hidden; /* Hidden by default. Visible on click */
min-width: 250px; /* Set a default minimum width */
margin-left: -125px; /* Divide value of min-width by 2 */
background-color: #333; /* Black background color */
color: #fff; /* White text color */
text-align: center; /* Centered text */
border-radius: 2px; /* Rounded borders */
padding: 16px; /* Padding */
position: fixed; /* Sit on top of the screen */
z-index: 1; /* Add a z-index if needed */
left: 50%; /* Center the snackbar */
bottom: 30px; /* 30px from the bottom */
}
/* Show the snackbar when clicking on a button (class added with JavaScript) */
#toast-success.show {
visibility: visible; /* Show the snackbar */
/* Add animation: Take 0.5 seconds to fade in and out the snackbar.
However, delay the fade out process for 2.5 seconds */
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
/* Animations to fade the snackbar in and out */
@-webkit-keyframes fadein {
from {bottom: 0; opacity: 0;}
to {bottom: 30px; opacity: 1;}
}
@keyframes fadein {
from {bottom: 0; opacity: 0;}
to {bottom: 30px; opacity: 1;}
}
@-webkit-keyframes fadeout {
from {bottom: 30px; opacity: 1;}
to {bottom: 0; opacity: 0;}
}
@keyframes fadeout {
from {bottom: 30px; opacity: 1;}
to {bottom: 0; opacity: 0;}
}
</style> </style>
</head> </head>
<body> <body>
<div class="loader"> <div class="loader">
<div class="d-table"> <div class="d-table">
<div class="d-table-cell"> <div class="d-table-cell">
@ -72,7 +123,7 @@
</a> </a>
</div> </div>
<div class="main-nav"> <div class="main-nav main-nav-three">
<div class="container"> <div class="container">
<nav class="navbar navbar-expand-md navbar-light"> <nav class="navbar navbar-expand-md navbar-light">
<a class="navbar-brand" href="/"> <a class="navbar-brand" href="/">
@ -80,11 +131,26 @@
<img src="{{'assets/img/logo-two.png'|theme}}" class="logo-two" alt="30Coffe"> <img src="{{'assets/img/logo-two.png'|theme}}" class="logo-two" alt="30Coffe">
</a> </a>
<div class="collapse navbar-collapse mean-menu" id="navbarSupportedContent"> <div class="collapse navbar-collapse mean-menu" id="navbarSupportedContent">
{% partial 'menu' %}
<div class="side-nav"> {% partial 'menu' %}
<a class="nav-cart" href="#">
<div class="side-nav">
{% if activeLocale == 'ru'%}
<button data-request="onSwitchLocale" data-request-data="locale: 'tm'" class="nav-tel">
Türkmençe
</button>
{% else %}
<button data-request="onSwitchLocale" data-request-data="locale: 'ru'" class="nav-tel">
Русский
</button>
{% endif %}
<a class="nav-cart" href="/sebet">
<i class='bx bxs-cart'></i> <i class='bx bxs-cart'></i>
<span>1</span> <span id="qty">{{obCartPositionList.getTotalQuantity}}</span>
</a> </a>
<a class="nav-tel" href="tel:{{this.theme.phone}}"> <a class="nav-tel" href="tel:{{this.theme.phone}}">
<i class='bx bxs-phone-call'></i> <i class='bx bxs-phone-call'></i>
@ -99,7 +165,7 @@
{% page %} {% page %}
<footer class="pt-100 pb-70" style="background-color: aliceblue;"> <footer class="pt-100 pb-70" style="background-color: #37a2ff1a;">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-sm-6 col-lg-3"> <div class="col-sm-6 col-lg-3">
@ -266,10 +332,10 @@
<div class="container"> <div class="container">
<div class="copyright-item"> <div class="copyright-item">
<p>Copyright © <p>Copyright ©
<script data-cfasync="false"
src="../../cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script> <script>document.write(new Date().getFullYear())</script> Kafe <a
<script>document.write(new Date().getFullYear())</script> Design & Developed by <a href="#" target="_blank">30Coffee</a>
href="https://hibootstrap.com/" target="_blank">HiBootstrap</a>
</p> </p>
</div> </div>
</div> </div>
@ -296,5 +362,19 @@
<script src="{{'assets/js/jquery.magnific-popup.min.js'|theme}}"></script> <script src="{{'assets/js/jquery.magnific-popup.min.js'|theme}}"></script>
<script src="{{'assets/js/custom.js'|theme}}"></script> <script src="{{'assets/js/custom.js'|theme}}"></script>
{% scripts %}
{% framework extras %}
<script>
function onMerd(){
$.request('onGetData', {
success: function() {
console.log('Finished!');
document.getElementById("qty").innerHTML = 'text';
}
});
}
</script>
</body> </body>
</html> </html>

View File

@ -11,20 +11,24 @@ items:
viewBag: viewBag:
locale: locale:
ru: ru:
title: '' title: Glavnaya
url: '' url: ''
isHidden: '0' isHidden: '0'
cssClass: '' cssClass: ''
isExternal: '0' isExternal: '0'
- -
title: 'Biz Barada' title: 'Biz Barada'
nesting: null
type: url type: url
url: /a url: /biz-barada
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
ru: ru:
title: '' title: 'O nas'
url: '' url: ''
isHidden: '0' isHidden: '0'
cssClass: '' cssClass: ''
@ -32,55 +36,53 @@ items:
items: items:
- -
title: Hyzmatlarymyz title: Hyzmatlarymyz
nesting: null
type: url type: url
url: /s url: /s
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
ru: ru:
title: '' title: 'Nashi Servisy'
url: '' url: ''
isHidden: '0' isHidden: '0'
cssClass: '' cssClass: ''
isExternal: '0' isExternal: '0'
-
title: 'Habarlaşmak Üçin'
type: url
url: /d
code: ''
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
- -
title: Habarlar title: Habarlar
nesting: null
type: url type: url
url: /f url: /habarlar
code: '' code: ''
reference: null
cmsPage: null
replace: null
viewBag: viewBag:
locale: locale:
ru: ru:
title: '' title: Novosti
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
-
title: 'Habarlaşmak Üçin'
nesting: null
type: url
url: /habarlashmak
code: ''
reference: null
cmsPage: null
replace: null
viewBag:
locale:
ru:
title: 'Svyazhites '
url: '' url: ''
isHidden: '0' isHidden: '0'
cssClass: '' cssClass: ''
isExternal: '0' isExternal: '0'
items:
-
title: Wideolar
type: url
url: /g
code: ''
viewBag:
locale:
ru:
title: ''
url: ''
isHidden: '0'
cssClass: ''
isExternal: '0'
name: top_menu name: top_menu

View File

@ -0,0 +1,19 @@
title = 404
url = "/404"
layout = "master"
is_hidden = 0
==
<section class="error-area">
<div class="error-item">
<div class="d-table">
<div class="d-table-cell">
<div class="error-text">
<h1>404!</h1>
<p>Sorry! The Page Not Found</p>
<span>Oops! The page you are looking for does not exit. it might been moved or deleted.</span>
<a href="/">Return to Home</a>
</div>
</div>
</div>
</div>
</section>

View File

@ -0,0 +1,29 @@
title = "Biz Barada"
url = "/biz-barada"
layout = "master"
is_hidden = 0
==
<div class="page-title-area page-title-img-two">
<div class="container">
<div class="page-title-item">
<h2>{{this.page.title}}</h2>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<i class='bx bx-chevron-right'></i>
</li>
<li>{{this.page.title}}</li>
</ul>
</div>
</div>
</div>
<section class="story-area pt-100 pb-70">
<div class="container">
<div class="story-head">
{% content 'biz-barada' %}
</div>
</div>
</section>

View File

@ -0,0 +1,84 @@
title = "Category page"
url = "/category-page/:slug"
layout = "master"
is_hidden = 0
[CategoryPage]
slug = "{{ :slug }}"
slug_required = 1
smart_url_check = 1
has_wildcard = 0
skip_error = 0
[ProductList]
sorting = "no"
==
{% set obCategory = CategoryPage.get() %}
{% set obProductList = ProductList.make().sort(ProductList.getSorting()).active().category(obCategory.id) %}
<div class="page-title-area page-title-img-two">
<div class="container">
<div class="page-title-item">
<h2>Harytlar</h2>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<i class='bx bx-chevron-right'></i>
</li>
<li>{{ obCategory.name }}{{obCategory.id}}</li>
</ul>
</div>
</div>
</div>
<section class="collection-area pb-100" style="padding-top: 75px;">
<div class="container">
<div id="Container" class="row">
{% if obProductList.isNotEmpty() %}
{% for obProduct in obProductList %}
{% set obOffer = obProduct.offer.first() %}
<div class="col-sm-6 col-lg-3 mix">
<div class="collection-item" style="height: 93%;">
<div class="collection-top">
{% if obProduct.preview_image is not empty %}
<img src="{{ obProduct.preview_image.path }}" alt="{{ obProduct.name }}">
{% endif %}
<div class="add-cart">
<a href="#">
<i class='bx bxs-cart'></i>
Add to Cart
</a>
</div>
</div>
<div class="collection-bottom">
<h3>{{ obProduct.name }}</h3>
<ul>
{% if obOffer.isNotEmpty() %}
<li>
<span>{{obOffer.price_value}} {{obOffer.currency}}</span>
{% if obOffer.old_price != 0 %}
<span style="color:#656565;text-decoration: line-through;">{{obOffer.old_price}} {{obOffer.currency}}</span>
{% endif %}
</li>
{% endif %}
<li>
<div class="number">
<span class="minus">-</span>
<input type="text" class="form-control" value="1" />
<span class="plus">+</span>
</div>
</li>
</ul>
</div>
</div>
</div>
{% endfor %}
{%else%}
<div class="col-sm-12">
<h2>HARYT YOK</h2>
</div>
{%endif%}
</div>
</div>
</section>

View File

@ -0,0 +1,45 @@
title = "Habar"
url = "/post/:id/:slug"
layout = "master"
is_hidden = 0
[blogPost]
id = "{{ :id }}"
categoryPage = 404
==
{% set post = blogPost.post %}
<div class="page-title-area page-title-img-two">
<div class="container">
<div class="page-title-item">
<h2>Habarlar</h2>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<i class='bx bx-chevron-right'></i>
</li>
<li>{{post.title}}</li>
</ul>
</div>
</div>
</div>
<div class="service-details-area pt-100 pb-70">
<div class="container">
<div class="row">
<div class="col-lg-9">
<div class="service-details-item">
<div class="service-details-fresh">
<h2>{{post.title}}</h2>
<h5 style="color:#7b7b7b;">{{ post.published_at|date('d.m.Y') }}</h5>
<img src="{{ post.featured_images[0].thumb(467,300,{'mode':'crop'}) }}" alt="{{ image.description }}" style="margin-top: 30px;width: 100%;">
<p>{{ post.content_html|raw }}</p>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,85 @@
title = "Habarlar"
url = "/habarlar"
layout = "master"
is_hidden = 0
[blogPosts]
pageNumber = "{{ :page }}"
postsPerPage = 10
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = 404
postPage = "habar"
exceptPost = "{{ :id }}"
==
<div class="page-title-area page-title-img-two">
<div class="container">
<div class="page-title-item">
<h2>{{this.page.title}}</h2>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<i class='bx bx-chevron-right'></i>
</li>
<li>{{this.page.title}}</li>
</ul>
</div>
</div>
</div>
{% set posts = blogPosts.posts %}
<section class="blog-area ptb-100">
<div class="container">
<div class="section-title">
<h2>Habarlar</h2>
<!-- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do tempor incididunt ut labore et dolore
magna aliqua.</p> -->
</div>
<div class="row">
{% for post in posts %}
<div class="col-sm-6 col-lg-4">
<div class="blog-item">
<div class="blog-top">
<a href="{{ post.url }}">
<img src="{{ post.featured_images[0].thumb(467,300,{'mode':'crop'}) }}" alt="Blog">
</a>
<span>{{ post.published_at|date('d.m.Y') }}</span>
</div>
<div class="blog-bottom">
<h3>
<a href="{{ post.url }}">{{ post.title }}</a>
</h3>
<p>{{ post.excerpt }}</p>
<a class="cmn-btn" href="{{ post.url }}">Read More</a>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="row">
{% if posts.lastPage > 1 %}
<ul class="pagination">
{% if posts.currentPage > 1 %}
<li><a href="{{ this.page.baseFileName|page({ (blogPosts.pageParam): (posts.currentPage-1) }) }}">&larr; Prev</a></li>
{% endif %}
{% for page in 1..posts.lastPage %}
<li class="{{ posts.currentPage == page ? 'active' : null }}">
<a href="{{ this.page.baseFileName|page({ (blogPosts.pageParam): page }) }}">{{ page }}</a>
</li>
{% endfor %}
{% if posts.lastPage > posts.currentPage %}
<li><a href="{{ this.page.baseFileName|page({ (blogPosts.pageParam): (posts.currentPage+1) }) }}">Next &rarr;</a></li>
{% endif %}
</ul>
{% endif %}
</div>
</div>
</section>

View File

@ -0,0 +1,119 @@
title = "Habarlashmak"
url = "/habarlashmak"
layout = "master"
is_hidden = 0
[genericForm]
group = "Habarlashmak Uchin"
messages_success = "Your form was successfully submitted"
messages_errors = "There were errors with your submission"
mail_enabled = 1
mail_subject = "30Coffee"
mail_recipients[] = "shokki.a96@gmail.com"
mail_replyto = "shokki.a96@gmail.com"
mail_template = "martin.forms::mail.notification"
inline_errors = "disabled"
sanitize_data = "disabled"
anonymize_ip = "disabled"
recaptcha_theme = "light"
recaptcha_type = "image"
recaptcha_size = "normal"
emails_date_format = "Y-m-d"
==
<div class="page-title-area page-title-img-two">
<div class="container">
<div class="page-title-item">
<h2>{{this.page.title}}</h2>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<i class='bx bx-chevron-right'></i>
</li>
<li>{{this.page.title}}</li>
</ul>
</div>
</div>
</div>
<div class="contact-location-area pt-100 pb-70">
<div class="container">
<div class="row">
<div class="col-sm-6 col-lg-4">
<div class="location-item">
<img src="{{'assets/img/home-one/service-shape.png'|theme}}" alt="Location">
<i class='bx bxs-time-five' style="color: #f5e9b3;"></i>
<ul>
<li>9:00 AM to 12:00 AM</li>
<li>(Saturday to Thursday)</li>
</ul>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<div class="location-item active">
<img src="{{'assets/img/home-one/service-shape.png'|theme}}" alt="Location">
<i class='bx bxs-location-plus' style="color: #f5e9b3;"></i>
<ul>
<li>Br1. 28/A Street, New York, USA</li>
<li>Br2. 31/B Street, Washington, USA</li>
</ul>
</div>
</div>
<div class="col-sm-6 offset-sm-3 offset-lg-0 col-lg-4">
<div class="location-item">
<img src="{{'assets/img/home-one/service-shape.png'|theme}}" alt="Location">
<i class='bx bxs-phone-call' style="color: #f5e9b3;"></i>
<ul>
<li>
<a href="tel:+11234567890">(Branch 1) +1 123 456 7890</a>
</li>
<li>
<a href="tel:+23256594596">(Branch 2) +2 325 659 4596</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<form data-request="{{ genericForm }}::onFormSubmit">
<div class="row">
{{ form_token() }}
<div id="{{ genericForm }}_forms_flash"></div>
<div class="col-md-6">
<input type="text" name="name" class="form-control" placeholder="Ady" style="margin-top: 25px;">
</div>
<div class="col-md-6">
<input type="text" name="surname" class="form-control" placeholder="Familiyasy"
style="margin-top: 25px;">
</div>
<div class="col-md-6">
<input type="text" name="subject" class="form-control" placeholder="Tema"
style="margin-top: 25px;">
</div>
<div class="col-md-6">
<input type="text" name="email" class="form-control" placeholder="Email" style="margin-top: 25px;">
</div>
<div class="col-md-6">
<textarea class="form-control" name="message" placeholder="hat" rows="6" style="margin-top: 25px;">
</textarea>
</div>
<div class="col-md-12">
<button type="submit" class="cmn-btn btn disabled"
style="pointer-events: all; cursor: pointer;margin-top: 25px;margin-bottom: 25px;">
Send Message
</button>
</div>
</div>
</form>
</div>

View File

@ -2,9 +2,188 @@ title = "Baş Sahypa"
url = "/" url = "/"
layout = "master" layout = "master"
is_hidden = 0 is_hidden = 0
[CategoryList]
[CategoryData]
[ProductList]
sorting = "no"
[Cart]
== ==
{% put styles %}
<style>
.qty-button {
border: 0px;
font-weight: 900;
background-color:#af9400 !important;
}
</style>
{% endput %}
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" id="toast-success">
<div class="toast-body" style="background: green;color:white;">
Haryt Sebede Ustunlikli Goshuldy!!!
</div>
</div>
{% partial 'home/slider' %} {% partial 'home/slider' %}
{% partial 'home/categories' %} {% partial 'home/categories' %}
{% partial 'home/content' %} {% partial 'home/content' %}
{% partial 'home/products' %}
{% set obCategoryList = CategoryList.make().tree() %}
{% set obCartPositionList = Cart.get() %}
<section class="collection-area pb-100" style="padding-top: 75px;">
<div class="container">
<div class="section-title">
<h2>Our Regular Food Collections</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua.</p>
</div>
<div class="sorting-menu">
<ul>
{% if obCategoryList.isNotEmpty() %}
<li class="filter active" data-filter="all">All</li>
{% for obCategory in obCategoryList %}
{% if obCategory.featured == 1 %}
<li class="filter" data-filter=".q{{obCategory.id}}{{obCategory.slug}}">{{obCategory.name}}</li>
{% endif %}
{% endfor %}
{% endif %}
</ul>
</div>
<div id="Container" class="row">
{% if obCategoryList.isNotEmpty() %}
{% for obCategory in obCategoryList %}
{% if obCategory.featured == 1 %}
{% set obCategoryq = CategoryData.get(obCategory.id) %}
{% set obProductList = ProductList.make().sort(ProductList.getSorting()).active().category(obCategoryq.id) %}
{% for obProduct in obProductList %}
{% set obOffer = obProduct.offer.first() %}
<div class="col-sm-6 col-lg-3 mix q{{obCategoryq.id}}{{obCategory.slug}}">
<div class="collection-item" style="height: 93%;">
<div class="collection-top _shopaholic-product-wrapper">
{% if obProduct.preview_image is not empty %}
<img src="{{ obProduct.preview_image.path }}" alt="{{ obProduct.name }}">
{% endif %}
<div class="add-cart">
<a href="javascript:;" onClick="onMerdan({{obProduct.id}});">
<i class='bx bxs-cart'></i>
Add to Cart
</a>
</div>
</div>
<div class="collection-bottom">
<h3>{{ obProduct.name }}</h3>
<ul>
{% if obOffer.isNotEmpty() %}
<li>
<span>{{obOffer.price_value}} {{obOffer.currency}}</span>
{% if obOffer.old_price != 0 %}
<span style="color:#656565;text-decoration: line-through;">{{obOffer.old_price}} {{obOffer.currency}}</span>
{% endif %}
</li>
{% endif %}
<li>
{% if obCartPositionList.isNotEmpty() %}
{% for cart in obCartPositionList %}
{% if obProduct.id == cart.item_id %}
<div class="number" {{obProduct.id == cart.item_id ? 'style="display: block;"' : 'style="display: none;'}}>
<span class="minus">-</span>
<input type="text" name="quantity" class="form-control" value="{{cart.quantity}}" />
<span class="plus" onClick="onQuantity();">+</span>
</div>
{% else %}
<div class="number" {{loop.index0 ? 'style="display: none;"' : ''}}>
<button class="minus qty-button" id="qty-btn" disabled>-</button>
<input type="text" name="quantity" class="form-control" id="qty-input" value="1" readonly style="background: white;"/>
<button class="plus qty-button" id="qty-btn" disabled>+</button>
</div>
{% endif %}
{% endfor %}
{% else %}
<div class="number">
<button class="minus qty-button" id="qty-btn" disabled>-</button>
<input type="text" name="quantity" class="form-control" id="qty-input" value="1" readonly style="background: white;"/>
<button class="plus qty-button" id="qty-btn" disabled>+</button>
</div>
{% endif %}
</li>
</ul>
</div>
</div>
</div>
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
</div>
<div class="more-collection">
<a href="/">Doly Gor</a>
</div>
</div>
</section>
<script>
function onMerdan(data) {
$.request('onAdd', {
data: {'cart': [{'offer_id': data, 'quantity': 1}]},
success: function() {
console.log('Added product!');
// Get the snackbar DIV
var x = document.getElementById("toast-success");
var qty = document.getElementById("qty");
var qtyInt = document.getElementById("qty").innerHTML;
var qtyBtn = document.getElementById("qty-btn");
var qtyInput = document.getElementById("qty-input");
qtyBtn.removeAttribute('disabled');
var qq = qtyInput.removeAttribute('readonly');
console.log(qq);
// Add the "show" class to DIV
x.className = "show";
// After 3 seconds, remove the show class from DIV
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
// qty.innerHTML = parseInt(qty) + 1;
qty.innerHTML = parseInt(qtyInt) + 1
//console.log(qty.innerHTML = parseInt(qtyInt) + 1);
//console.log(qtyInt);
}
});
}
</script>
{% partial 'home/posts' %} {% partial 'home/posts' %}

View File

@ -0,0 +1,100 @@
title = "Sebet"
url = "/sebet"
layout = "master"
is_hidden = 0
[Cart]
==
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true" id="toast-success">
<div class="toast-body" style="background: green;color:white;">
Haryt Ustunlikli Sebetden Pozuldy!!!
</div>
</div>
<div class="page-title-area page-title-img-two">
<div class="container">
<div class="page-title-item">
<h2>{{this.page.title}}</h2>
<ul>
<li>
<a href="/">Home</a>
</li>
<li>
<i class='bx bx-chevron-right'></i>
</li>
<li>{{this.page.title}}</li>
</ul>
</div>
</div>
</div>
{% set obCartElementList = Cart.get() %}
<section class="cart-area ptb-100">
<div class="container">
<div class="cart-wrap">
{% if obCartElementList.isNotEmpty() %}
<table class="table">
<thead class="thead">
<tr>
<!-- <th class="table-head" scope="col">Suraty</th> -->
<th class="table-head" scope="col">Haryt Ady</th>
<th class="table-head" scope="col">Bahasy</th>
<th class="table-head" scope="col">Mukdary</th>
<th class="table-head" scope="col">Jemi</th>
<th class="table-head" scope="col">Sazlamalar</th>
</tr>
</thead>
<tbody>
{% for obCartElement in obCartElementList %}
{% set obOffer = obCartElement.offer %}
<tr>
<td>{{ obOffer.product.name }}</td>
<td>{{ obOffer.price }} {{ obOffer.currency }}</td>
<td>{{ obCartElement.quantity }}</td>
<td>{{ obCartElement.price }} {{ obCartElement.currency }}</td>
<td>
<a href="javascript:;" onClick="onRemoveInCart({{obOffer.id}});">
<i class='bx bx-x'></i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<!-- <div class="shop-back">
<a href="#">Go for Order?</a>
</div> -->
<div class="total-shopping" style="margin-top: 70px;">
<h2>UMUMY SARGYTLAR</h2>
<h3>Umumy Baha: <span>{{ obCartElementList.getTotalPrice() }} {{ obCartElementList.getCurrency() }}</span></h3>
<a href="/">Taýýarla</a>
</div>
{% else %}
<h1>Sebet Bosh</h1>
{% endif %}
</div>
</div>
</section>
<script>
function onRemoveInCart(prodId) {
$.request('onRemove', {
data: {'cart': [prodId]},
success: function() {
console.log('Finished!');
// Get the snackbar DIV
window.location.reload();
}
});
}
</script>

View File

@ -21,7 +21,7 @@
<span>{{obCategory.name}}</span> <span>{{obCategory.name}}</span>
</li> </li>
<li> <li>
<a href="#"> <a href="{{ obCategory.getPageUrl('category-page') }}">
<i class='bx bx-right-arrow-alt'></i> <i class='bx bx-right-arrow-alt'></i>
</a> </a>
</li> </li>

View File

@ -1,6 +1,6 @@
[viewBag] [viewBag]
== ==
<div class="restant-area" style="background: aliceblue;"> <div class="restant-area" style="background: #37a2ff1a;">
<div class="restant-shape"> <div class="restant-shape">
<img src="{{'assets/img/home-one/service-shape2.png'|theme}}" alt="Shape"> <img src="{{'assets/img/home-one/service-shape2.png'|theme}}" alt="Shape">
</div> </div>

View File

@ -2,14 +2,14 @@
[blogPosts] [blogPosts]
pageNumber = "{{ :page }}" pageNumber = "{{ :page }}"
categoryFilter = "umumy"
postsPerPage = 3 postsPerPage = 3
noPostsMessage = "No posts found" noPostsMessage = "No posts found"
sortOrder = "published_at desc" sortOrder = "published_at desc"
categoryPage = "home" categoryPage = 404
postPage = "home" postPage = "habar"
== ==
{% component 'blogPosts' %} {% set posts = blogPosts.posts %}
<section class="blog-area ptb-100"> <section class="blog-area ptb-100">
<div class="container"> <div class="container">
<div class="section-title"> <div class="section-title">
@ -18,63 +18,28 @@ postPage = "home"
magna aliqua.</p> --> magna aliqua.</p> -->
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-6 col-lg-4">
<div class="blog-item"> {% for post in posts %}
<div class="blog-top"> <div class="col-sm-6 col-lg-4">
<a href="blog-details.html"> <div class="blog-item">
<img src="assets/img/home-one/blog1.jpg" alt="Blog"> <div class="blog-top">
</a> <a href="{{ post.url }}">
<span>01 May 2020</span> <img src="{{ post.featured_images[0].thumb(467,300,{'mode':'crop'}) }}" alt="Blog">
</div> </a>
<div class="blog-bottom"> <span>{{ post.published_at|date('d.m.Y') }}</span>
<h3> </div>
<a href="blog-details.html">Brief About How to Make Pasta</a> <div class="blog-bottom">
</h3> <h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt <a href="{{ post.url }}">{{ post.title }}</a>
ut labore</p> </h3>
<a class="cmn-btn" href="blog-details.html">Read More</a> <p>{{ post.excerpt }}</p>
<a class="cmn-btn" href="{{ post.url }}">Read More</a>
</div>
</div> </div>
</div> </div>
</div> {% endfor %}
<div class="col-sm-6 col-lg-4">
<div class="blog-item">
<div class="blog-top">
<a href="blog-details.html">
<img src="assets/img/home-one/blog2.jpg" alt="Blog">
</a>
<span>02 May 2020</span>
</div>
<div class="blog-bottom">
<h3>
<a href="blog-details.html">Brief About How to Make Pizza</a>
</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore</p>
<a class="cmn-btn" href="blog-details.html">Read More</a>
</div>
</div>
</div>
<div class="col-sm-6 offset-sm-3 offset-lg-0 col-lg-4">
<div class="blog-item">
<div class="blog-top">
<a href="blog-details.html">
<img src="assets/img/home-one/blog3.jpg" alt="Blog">
</a>
<span>03 May 2020</span>
</div>
<div class="blog-bottom">
<h3>
<a href="blog-details.html">Brief About How to Make Burger</a>
</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore</p>
<a class="cmn-btn" href="blog-details.html">Read More</a>
</div>
</div>
</div>
</div>
<div class="text-center">
<a class="read-blog-btn" href="blog.html">Read More Blogs</a>
</div> </div>
</div> </div>
</section> </section>

View File

@ -6,9 +6,11 @@
[ProductList] [ProductList]
sorting = "no" sorting = "no"
[Cart]
== ==
{% set obCategoryList = CategoryList.make().tree() %} {% set obCategoryList = CategoryList.make().tree() %}
{% set obCartPositionList = Cart.get() %}
<section class="collection-area pb-100" style="padding-top: 75px;"> <section class="collection-area pb-100" style="padding-top: 75px;">
<div class="container"> <div class="container">
<div class="section-title"> <div class="section-title">
@ -28,6 +30,10 @@ sorting = "no"
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
<div id="Container" class="row"> <div id="Container" class="row">
{% if obCategoryList.isNotEmpty() %} {% if obCategoryList.isNotEmpty() %}
@ -39,42 +45,42 @@ sorting = "no"
{% for obProduct in obProductList %} {% for obProduct in obProductList %}
{% set obOffer = obProduct.offer.first() %} {% set obOffer = obProduct.offer.first() %}
<div class="col-sm-6 col-lg-3 mix q{{obCategoryq.id}}{{obCategory.slug}}"> <div class="col-sm-6 col-lg-3 mix q{{obCategoryq.id}}{{obCategory.slug}}">
<div class="collection-item" style="height: 93%;"> <div class="collection-item" style="height: 93%;">
<div class="collection-top"> <div class="collection-top _shopaholic-product-wrapper" data-product-id="{{ obProduct.id }}">
<input type="hidden" name="offer_id" value="{{ obOffer.id }}">
{% if obProduct.preview_image is not empty %} {% if obProduct.preview_image is not empty %}
<img src="{{ obProduct.preview_image.path }}" alt="{{ obProduct.name }}"> <img src="{{ obProduct.preview_image.path }}" alt="{{ obProduct.name }}">
{% endif %} {% endif %}
<div class="add-cart"> <div class="add-cart">
<a href="#"> <a class="_shopaholic-cart-add" data-request="onAdd({{obProduct.id}})">
<i class='bx bxs-cart'></i> <i class='bx bxs-cart'></i>
Add to Cart Add to Cart
</a> </a>
</div>
</div>
<div class="collection-bottom">
<h3>{{ obProduct.name }}</h3>
<ul>
{% if obOffer.isNotEmpty() %}
<li>
<span>{{obOffer.price_value}} {{obOffer.currency}}</span>
{% if obOffer.old_price != 0 %}
<span style="color:#656565;text-decoration: line-through;">{{obOffer.old_price}} {{obOffer.currency}}</span>
{% endif %}
</li>
{% endif %}
<li>
<div class="number">
<span class="minus">-</span>
<input type="text" name="quantity" class="form-control" value="1" />
<span class="plus">+</span>
</div>
</li>
</ul>
</div>
</div> </div>
</div> </div>
<div class="collection-bottom">
<h3>{{ obProduct.name }}</h3>
<ul>
{% if obOffer.isNotEmpty() %}
<li>
<span>{{obOffer.price_value}} {{obOffer.currency}}</span>
{% if obOffer.old_price != 0 %}
<span style="color:#656565;text-decoration: line-through;">{{obOffer.old_price}} {{obOffer.currency}}</span>
{% endif %}
</li>
{% endif %}
<li>
<div class="number">
<span class="minus">-</span>
<input type="text" class="form-control" value="1" />
<span class="plus">+</span>
</div>
</li>
</ul>
</div>
</div>
</div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@ -85,4 +91,10 @@ sorting = "no"
<a href="food-collection.html">Doly Gor</a> <a href="food-collection.html">Doly Gor</a>
</div> </div>
</div> </div>
</section> </section>
<script>
function onAdd(data) {
console.log(data);
}
</script>

View File

@ -1,26 +1,26 @@
[viewBag]
[staticMenu] [staticMenu]
code = "top_menu" code = "top_menu"
[viewBag]
== ==
<ul class="navbar-nav"> <ul class="navbar-nav">
{% for item in staticMenu.menuItems %} {% for item in staticMenu.menuItems %}
{% if not item.isHidden and item.items|length %} {% if not item.isHidden and item.items|length %}
<li class="nav-item"> <li class="nav-item">
<a href="{{ item.url }}" class="nav-link dropdown-toggle {% if (item.isActive) %} active {% endif %}">{{ item.title }} <i <a href="{{ item.url }}" class="nav-link dropdown-toggle {% if (item.isActive) %} active {% endif %}">{{ item.title }} <i
class='bx bx-chevron-down'></i></a> class='bx bx-chevron-down'></i></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for item in item.items %} {% for item in item.items %}
<li class="nav-item"> <li class="nav-item">
<a href="{{ item.url }}" class="nav-link {% if (item.isActive) %} active {% endif %}">{{ item.title }}</a> <a href="{{ item.url }}" class="nav-link {% if (item.isActive) %} active {% endif %}">{{ item.title }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</li> </li>
{% elseif not item.viewBag.isHidden %} {% elseif not item.viewBag.isHidden %}
<li class="nav-item"> <li class="nav-item">
<a href="{{ item.url }}" class="nav-link {% if (item.isActive) %} active {% endif %}">{{ item.title }}</a> <a href="{{ item.url }}" class="nav-link {% if (item.isActive) %} active {% endif %}">{{ item.title }}</a>
</li> </li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</ul> </ul>