locale update

This commit is contained in:
gerchek 2024-03-14 13:57:46 +05:00
parent c846c81172
commit b2a363e4d9
3 changed files with 54 additions and 9 deletions

View File

@ -11,10 +11,10 @@ function onStart(){
$this['movies'] = Tps\Movies\Models\Movie::orderBy('created_at')->limit(15)->get();
$this['sales'] = Tps\Shops\Models\Sale::all();
$this['sales_all'] = $this['sales']->slice(0, 9);
$this['sales_news'] = $this['sales']->where("type", "news")->slice(0, 9);
$this['sales_promo'] = $this['sales']->where("type", "promo")->slice(0, 9);
$this['sales_discount'] = $this['sales']->where("type", "discount")->slice(0, 9);
$this['sales_all'] = $this['sales']->slice(0, 6);
$this['sales_news'] = $this['sales']->where("type", "news")->slice(0, 6);
$this['sales_promo'] = $this['sales']->where("type", "promo")->slice(0, 6);
$this['sales_discount'] = $this['sales']->where("type", "discount")->slice(0, 6);
$this['shop_categories'] = Tps\Shops\Models\Category::where("top_category_id", $this->theme->main_shops)->orderBy('sort_order')->limit(3)->get();
$this['shop_category_ids'] = $this['shop_categories']->lists('id');

View File

@ -47,12 +47,14 @@ function onStart(){
<h4 class="crumb_title">
<a href="{{ url('/') }}/main-category/{{shop.category.top_category.id}}/{{shop.category.top_category.name}}">
<!-- <a href="{{ url('/') }}/main-category/{{shop.category.top_category.id}}/{{shop.category.top_category.name}}"> -->
<a href="{{ url('/') }}/main-category/{{shop.category.top_category.id}}">
{{shop.category.top_category.name}}
</a>
</h4>
<h4 class="crumb_title">
<a href="{{ url('/') }}/category/{{shop.category.id}}/{{shop.category.name}}">
<!-- <a href="{{ url('/') }}/category/{{shop.category.id}}/{{shop.category.name}}"> -->
<a href="{{ url('/') }}/category/{{shop.category.id}}">
{{shop.category.name}}
</a>
</h4>
@ -156,7 +158,8 @@ function onStart(){
</div>
<div class="post_link">
<a href="{{ url('/') }}/category/{{shop.category.id}}/{{shop.category.name}}">
<!-- <a href="{{ url('/') }}/category/{{shop.category.id}}/{{shop.category.name}}"> -->
<a href="{{ url('/') }}/category/{{shop.category.id}}">
Посмотреть все
<span>
<svg width="14" height="12" viewBox="0 0 14 12" fill="none"

View File

@ -2,6 +2,26 @@
<?php
function onStart(){
$this['activeLocaleFlag'] = 'assets/images/flag_'. $this->activeLocale .'.png';
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http";
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['REQUEST_URI'];
$url = $protocol . "://" . $host . $uri;
$path = parse_url($url, PHP_URL_PATH);
$segmentsToRemove = array("tk", "en", "ru");
foreach ($segmentsToRemove as $segment) {
$path = str_replace("/$segment/", "/", $path);
}
$this["pageLink"] = $path;
//dd($this["pageLink"]);
}
?>
==
@ -42,7 +62,7 @@ function onStart(){
</span>
</h6>
<div class="lang_box">
<!-- <div class="lang_box">
{% for code, name in locales %}
{% if code != activeLocale %}
{% set aa = 'assets/images/flag_'~ code ~'.png'%}
@ -54,11 +74,33 @@ function onStart(){
/>
</span>
{{code|upper }}
</a>
{% endif %}
{% endfor %}
</div> -->
<div class="lang_box">
{% for code, name in locales %}
{% if code != activeLocale %}
{% set aa = 'assets/images/flag_'~ code ~'.png'%}
<a href="{{ url('/' ~ code ) }}{{pageLink}}">
<span class="lang_flag">
<img
src="{{ aa|theme }}"
alt="lang-flag"
/>
</span>
{{code|upper }}
</a>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>