diff --git a/.gitignore b/.gitignore
index 6833953..deb1aa2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,15 @@
-# ---> WordPress
-# Wordpress - ignore core, configuration, examples, uploads and logs.
-# https://github.com/github/gitignore/blob/main/WordPress.gitignore
+# htaccess
+.htaccess
+
+# GP | SEO
+sitemap*.xml
+!robots.txt
+yandex_*.html
+google_*.html
+yandex_turbo.xml
+turbo_yandex.xml
# Core
-#
-# Note: if you want to stage/commit WP core files
-# you can delete this whole section/until Configuration.
/wp-admin/
/wp-content/index.php
/wp-content/languages
@@ -20,6 +24,11 @@
# Configuration
wp-config.php
+wp-config-sample.php
+
+#plugins
+wp-content/plugins/*
+/wp-content/plugins/*
# Example themes
/wp-content/themes/twenty*/
@@ -29,26 +38,85 @@ wp-config.php
# Uploads
/wp-content/uploads/
+!/wp-content/uploads/elementor
+/wp-content/uploads-webpc/
# Log files
*.log
-# htaccess
-/.htaccess
-/*/.htaccess
-# vendor files in themes
-/wp-content/themes/*/vendor
-# All plugins
-#
-# Note: If you wish to whitelist plugins,
-
-/wp-content/plugins
-/wp-content/backups-dup-lite
-/wp-content/ai1wm-backups
-/wp-content/uploads-webpc
-
-# All themes
-#
-# Note: If you wish to whitelist themes,
-# uncomment the next line
-#/wp-content/themes
+# GP | Files ext
+*.sql
+*.tgz
+*.tar.gz
+*.tar
+*.rar
+*.zip
+*.mp3
+*.mp4
+*.webm
+*.mov
+*.MOV
+*.wav
+*.flv
+*.db
+*.psd
+*.pdf
+*.doc
+*.docx
+*.txt
+*.text
+*.log
+*.config
+*.xml
+*.tbk
+*.csv
+*.json
+*.BAK
+
+# GP | Dirs & files
+bower_components/
+node_modules/
+nbproject/
+cache/
+.cache/
+phpMyAdmin-*
+timthumb_cache/
+webstat/
+.idea/
+.tmb/
+.csscomb.json
+sftp-config.json
+bower.json
+.bowerrc
+backup_rsync/
+.bash_history
+.idea/
+.fleet/
+.DS_Store
+.config/
+.bash*
+.vim*
+test/
+test*.php
+gp-test*/
+gp-test*.php
+*/ewww/
+.*_lock
+db.php
+*/w3tc*
+*/wpvivid*
+*/mu-plugins/
+vendor/
+wp-content/webp*
+
+# GP | Duplicator
+dup-installer/
+*archive.daf
+installer*
+wp-content/backups-dup-lite/
+
+# GP | Query Monitor
+wp-content/db.php
+
+# Node-js скрипт для индексации 100 url в сутки
+.google-indexing/
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/.gitattributes b/wp-content/themes/cosmopet-timber/.gitattributes
deleted file mode 100644
index 2e1912c..0000000
--- a/wp-content/themes/cosmopet-timber/.gitattributes
+++ /dev/null
@@ -1,4 +0,0 @@
-/.gitattributes export-ignore
-/.github export-ignore
-/tests export-ignore
-/phpunit.xml
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/.github/PULL_REQUEST_TEMPLATE.md b/wp-content/themes/cosmopet-timber/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index 626a6ed..0000000
--- a/wp-content/themes/cosmopet-timber/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-Related:
-
-- Ticket 1
-- Ticket 2
-
-## Issue
-
-
-
-## Solution
-
-
-
-## Impact
-
-
-
-## Usage Changes
-
-
-## Considerations
-
-
-
-## Testing
-
diff --git a/wp-content/themes/cosmopet-timber/.github/workflows/test.yml b/wp-content/themes/cosmopet-timber/.github/workflows/test.yml
deleted file mode 100644
index f949e1e..0000000
--- a/wp-content/themes/cosmopet-timber/.github/workflows/test.yml
+++ /dev/null
@@ -1,76 +0,0 @@
-name: Timber starter theme tests
-
-on:
- push:
- branches:
- - '1.x'
- - '2.x'
- pull_request:
- types:
- - opened
- - synchronize
- - ready_for_review
-
-# Cancel previous workflow run groups that have not completed.
-concurrency:
- # Group workflow runs by workflow name, along with the head branch ref of the pull request
- # or otherwise the branch or tag ref.
- group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
- cancel-in-progress: true
-
-jobs:
- phpunit:
- runs-on: ubuntu-latest
-
- continue-on-error: ${{ matrix.experimental }}
- strategy:
- fail-fast: false
- matrix:
- php: ['8.1', '8.2']
- wp: ['latest']
- multisite: ['0', '1']
- extensions: ['gd']
- experimental: [false]
- include:
- # PHP 8.2 / experimental
- - php: '8.2'
- wp: 'trunk'
- dependency-version: 'highest'
- multisite: '0'
- experimental: true
- # PHP 8.3 / experimental
- - php: '8.3'
- wp: 'trunk'
- dependency-version: 'highest'
- multisite: '0'
- experimental: true
- # Coverage
- - php: '8.1'
- wp: 'latest'
- dependency-version: 'highest'
- multisite: '0'
- experimental: false
-
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- tools: composer:v2
- extensions: curl, date, dom, iconv, json, libxml, gd
-
- - name: Setup problem matchers for PHP
- run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
-
- - name: Setup problem matchers for PHPUnit
- run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
-
- - uses: ramsey/composer-install@v3
-
- - name: Run tests
- run: composer run test
- env:
- WP_MULTISITE: ${{ matrix.multisite }}
diff --git a/wp-content/themes/cosmopet-timber/.gitignore b/wp-content/themes/cosmopet-timber/.gitignore
deleted file mode 100644
index 9477bf3..0000000
--- a/wp-content/themes/cosmopet-timber/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/composer.lock
-/vendor/
-/wordpress/
-.phpunit.result.cache
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/404.php b/wp-content/themes/cosmopet-timber/404.php
deleted file mode 100644
index a51168d..0000000
--- a/wp-content/themes/cosmopet-timber/404.php
+++ /dev/null
@@ -1,11 +0,0 @@
- $title,
- ]
-);
-
-Timber::render( $templates, $context );
diff --git a/wp-content/themes/cosmopet-timber/assets/fonts/.gitkeep b/wp-content/themes/cosmopet-timber/assets/fonts/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/wp-content/themes/cosmopet-timber/assets/images/.gitkeep b/wp-content/themes/cosmopet-timber/assets/images/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/wp-content/themes/cosmopet-timber/assets/scripts/site.js b/wp-content/themes/cosmopet-timber/assets/scripts/site.js
deleted file mode 100644
index 6655bd0..0000000
--- a/wp-content/themes/cosmopet-timber/assets/scripts/site.js
+++ /dev/null
@@ -1,5 +0,0 @@
-jQuery( document ).ready( function( $ ) {
-
- // Your JavaScript goes here
-
-});
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/assets/styles/.gitkeep b/wp-content/themes/cosmopet-timber/assets/styles/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/wp-content/themes/cosmopet-timber/author.php b/wp-content/themes/cosmopet-timber/author.php
deleted file mode 100644
index dae48bc..0000000
--- a/wp-content/themes/cosmopet-timber/author.php
+++ /dev/null
@@ -1,18 +0,0 @@
-name() );
-}
-
-Timber::render( [ 'templates/author.twig', 'templates/archive.twig' ], $context );
diff --git a/wp-content/themes/cosmopet-timber/composer.json b/wp-content/themes/cosmopet-timber/composer.json
deleted file mode 100644
index 1e1dcd5..0000000
--- a/wp-content/themes/cosmopet-timber/composer.json
+++ /dev/null
@@ -1,75 +0,0 @@
-{
- "name": "timber/starter-theme",
- "description": "Starter theme to build a Timber theme",
- "type":"wordpress-theme",
- "license": "MIT",
- "authors": [
- {
- "name": "Erik van der Bas",
- "email": "erik@basedonline.nl",
- "homepage": "https://basedonline.nl"
- },
- {
- "name": "Lukas Gächter",
- "email": "lukas.gaechter@mind.ch",
- "homepage": "https://www.mind.ch"
- },
- {
- "name": "Nicolas Lemoine",
- "email": "nico@n5s.dev",
- "homepage": "https://n5s.dev"
- },
- {
- "name": "Jared Novack",
- "email": "jared@upstatement.com",
- "homepage": "https://upstatement.com"
- },
- {
- "name": "Timber Community",
- "homepage": "https://github.com/timber/timber"
- }
- ],
- "repositories": [
- {
- "type": "composer",
- "url": "https://wpackagist.org"
- }
- ],
- "require": {
- "timber/timber": "^2.1"
- },
- "require-dev": {
- "automattic/wordbless": "^0.4.2",
- "yoast/wp-test-utils": "^1.0",
- "wp-coding-standards/wpcs": "^3.1",
- "phpcompatibility/php-compatibility": "^9",
- "szepeviktor/phpstan-wordpress": "^1.3",
- "10up/phpcs-composer": "^3.0"
- },
- "extra": {
- "installer-paths": {
- "vendor/automattic/wordbless/": [
- "automattic/wordbless"
- ]
- },
- "wordpress-install-dir": "wordpress"
- },
- "config": {
- "allow-plugins": {
- "roots/wordpress-core-installer": true,
- "composer/installers": true,
- "dealerdirect/phpcodesniffer-composer-installer": true
- }
- },
- "autoload": {
- "psr-4": {
- "App\\": "src/"
- }
- },
- "scripts": {
- "test": "phpunit",
- "cs": "@php ./vendor/bin/phpcs --colors -s -p -v ./",
- "cs:fix": "@php ./vendor/bin/phpcbf --colors -s -p -v ./",
- "phpstan": "@php ./vendor/bin/phpstan analyse"
- }
-}
diff --git a/wp-content/themes/cosmopet-timber/functions.php b/wp-content/themes/cosmopet-timber/functions.php
deleted file mode 100644
index 76890b8..0000000
--- a/wp-content/themes/cosmopet-timber/functions.php
+++ /dev/null
@@ -1,19 +0,0 @@
- 'bar',
- ]
-);
-
-Timber::render( $templates, $context );
diff --git a/wp-content/themes/cosmopet-timber/page.php b/wp-content/themes/cosmopet-timber/page.php
deleted file mode 100644
index 34c142d..0000000
--- a/wp-content/themes/cosmopet-timber/page.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- .
-
- */node_modules/*
- */wordpress/*
- */vendor/*
- */resources/*
- */dist/*
- */tests/*
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/phpstan.neon b/wp-content/themes/cosmopet-timber/phpstan.neon
deleted file mode 100644
index 5ce8f6d..0000000
--- a/wp-content/themes/cosmopet-timber/phpstan.neon
+++ /dev/null
@@ -1,15 +0,0 @@
-parameters:
- editorUrl: 'vscode://file/%%file%%:%%line%%'
- level: 5 # Increase until "max"
- paths:
- - src/
- - %currentWorkingDirectory%/
- excludePaths:
- - tests/*
- - docs/*
- - vendor/*
- - wordpress/*
- ignoreErrors:
-
-includes:
- - vendor/szepeviktor/phpstan-wordpress/extension.neon
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/phpunit.xml b/wp-content/themes/cosmopet-timber/phpunit.xml
deleted file mode 100644
index c0f40d4..0000000
--- a/wp-content/themes/cosmopet-timber/phpunit.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- ./tests/
-
-
-
diff --git a/wp-content/themes/cosmopet-timber/screenshot.png b/wp-content/themes/cosmopet-timber/screenshot.png
deleted file mode 100644
index f37bb02..0000000
Binary files a/wp-content/themes/cosmopet-timber/screenshot.png and /dev/null differ
diff --git a/wp-content/themes/cosmopet-timber/search.php b/wp-content/themes/cosmopet-timber/search.php
deleted file mode 100644
index 9e1ac5f..0000000
--- a/wp-content/themes/cosmopet-timber/search.php
+++ /dev/null
@@ -1,18 +0,0 @@
- 'Search results for ' . get_search_query(),
- ]
-);
-
-Timber::render( $templates, $context );
diff --git a/wp-content/themes/cosmopet-timber/single.php b/wp-content/themes/cosmopet-timber/single.php
deleted file mode 100644
index df070cf..0000000
--- a/wp-content/themes/cosmopet-timber/single.php
+++ /dev/null
@@ -1,20 +0,0 @@
-post_type . '.twig', 'templates/single.twig' ];
-
-if ( post_password_required( $post->ID ) ) {
- $templates = 'templates/single-password.twig';
-}
-
-Timber::render( $templates, $context );
diff --git a/wp-content/themes/cosmopet-timber/src/StarterSite.php b/wp-content/themes/cosmopet-timber/src/StarterSite.php
deleted file mode 100644
index 834eaad..0000000
--- a/wp-content/themes/cosmopet-timber/src/StarterSite.php
+++ /dev/null
@@ -1,186 +0,0 @@
- _x( 'Main menu', 'Backend - menu name', 'timber-starter' ),
- ]
- );
-
- // Add default posts and comments RSS feed links to head.
- add_theme_support( 'automatic-feed-links' );
-
- /*
- * Let WordPress manage the document title.
- * By adding theme support, we declare that this theme does not use a
- * hard-coded
tag in the document head, and expect WordPress to
- * provide it for us.
- */
- add_theme_support( 'title-tag' );
-
- /*
- * Enable support for Post Thumbnails on posts and pages.
- *
- * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
- */
- add_theme_support( 'post-thumbnails' );
-
- /*
- * Switch default core markup for search form, comment form, and comments
- * to output valid HTML5.
- */
- add_theme_support(
- 'html5',
- [
- 'comment-form',
- 'comment-list',
- 'gallery',
- 'caption',
- ]
- );
-
- /*
- * Enable support for Post Formats.
- *
- * See: https://codex.wordpress.org/Post_Formats
- */
- add_theme_support(
- 'post-formats',
- [
- 'aside',
- 'image',
- 'video',
- 'quote',
- 'link',
- 'gallery',
- 'audio',
- ]
- );
-
- add_theme_support( 'menus' );
- }
-
- /**
- * This would return 'foo bar!'.
- *
- * @param string $text being 'foo', then returned 'foo bar!'
- */
- public function myfoo( $text ) {
- $text .= ' bar!';
-
- return $text;
- }
-
- /**
- * This is where you can add your own functions to twig.
- *
- * @link https://timber.github.io/docs/v2/hooks/filters/#timber/twig/filters
- * @param array $filters an array of Twig filters.
- */
- public function add_filters_to_twig( $filters ) {
-
- $additional_filters = [
- 'myfoo' => [
- 'callable' => [ $this, 'myfoo' ],
- ],
- ];
-
- return array_merge( $filters, $additional_filters );
- }
-
-
- /**
- * This is where you can add your own functions to twig.
- *
- * @link https://timber.github.io/docs/v2/hooks/filters/#timber/twig/functions
- * @param array $functions an array of existing Twig functions.
- */
- public function add_functions_to_twig( $functions ) {
- $additional_functions = [
- 'get_theme_mod' => [
- 'callable' => 'get_theme_mod',
- ],
- ];
-
- return array_merge( $functions, $additional_functions );
- }
-
- /**
- * Updates Twig environment options.
- *
- * @see https://twig.symfony.com/doc/2.x/api.html#environment-options
- *
- * @param array $options an array of environment options
- *
- * @return array
- */
- public function update_twig_environment_options( $options ) {
- // $options['autoescape'] = true;
-
- return $options;
- }
-}
diff --git a/wp-content/themes/cosmopet-timber/src/style.css b/wp-content/themes/cosmopet-timber/src/style.css
deleted file mode 100644
index e7b0324..0000000
--- a/wp-content/themes/cosmopet-timber/src/style.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * Theme Name: Cosmopet Theme
- * Description: Boilerplate Theme for Cosmopet site
- * Author: Good Production
-*/
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/style.css b/wp-content/themes/cosmopet-timber/style.css
deleted file mode 100644
index e8aa430..0000000
--- a/wp-content/themes/cosmopet-timber/style.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * Theme Name: Cosmopet Theme
- * Description: Boilerplate Theme for Cosmopet site
- * Author: Good Production
-*/
diff --git a/wp-content/themes/cosmopet-timber/tests/bootstrap.php b/wp-content/themes/cosmopet-timber/tests/bootstrap.php
deleted file mode 100644
index fb3f982..0000000
--- a/wp-content/themes/cosmopet-timber/tests/bootstrap.php
+++ /dev/null
@@ -1,28 +0,0 @@
-assertTrue(is_array($context));
- }
-
- function testFunctionsPHP()
- {
- $context = Timber::context();
- $this->assertEquals('App\StarterSite', get_class($context['site']));
- $this->assertTrue(current_theme_supports('post-thumbnails'));
- $this->assertEquals('bar', $context['foo']);
- }
-
- function testLoading()
- {
- $str = Timber::compile('partials/tease.twig');
- $this->assertStringStartsWith('', $str);
- $this->assertStringEndsWith(' ', $str);
- }
-
- /**
- * Helper test to output current twig version
- */
- function testTwigVersion()
- {
- $version = Timber::compile_string("{{ version }}", ['version' => Twig\Environment::VERSION]);
- $this->assertEquals(Twig\Environment::VERSION, $version);
- }
-
- // function testTwigFilter() {
- // $str = Timber::compile_string('{{ "foo"|myfoo }}');
- // $this->assertEquals('foo bar!', $str);
- // }
-}
diff --git a/wp-content/themes/cosmopet-timber/views/layouts/base.twig b/wp-content/themes/cosmopet-timber/views/layouts/base.twig
deleted file mode 100644
index 537c08d..0000000
--- a/wp-content/themes/cosmopet-timber/views/layouts/base.twig
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
- {% block head %}
- {% include 'partials/head.twig' %}
- {% endblock %}
-
-
- {{ function('wp_body_open') }}
- {{ _e('Skip to content') }}
-
-
-
- {% if title %}
- {{ title }}
- {% endif %}
-
- {% block content %}
- Sorry, no content
- {% endblock %}
-
-
-
- {% block footer %}
- {% include 'partials/footer.twig' %}
- {% endblock %}
- {{ function('wp_footer') }}
- {% do action('get_footer') %}
-
-
diff --git a/wp-content/themes/cosmopet-timber/views/partials/comment-form.twig b/wp-content/themes/cosmopet-timber/views/partials/comment-form.twig
deleted file mode 100644
index 565f4b6..0000000
--- a/wp-content/themes/cosmopet-timber/views/partials/comment-form.twig
+++ /dev/null
@@ -1,32 +0,0 @@
-
diff --git a/wp-content/themes/cosmopet-timber/views/partials/comment.twig b/wp-content/themes/cosmopet-timber/views/partials/comment.twig
deleted file mode 100644
index 710f979..0000000
--- a/wp-content/themes/cosmopet-timber/views/partials/comment.twig
+++ /dev/null
@@ -1,19 +0,0 @@
-
diff --git a/wp-content/themes/cosmopet-timber/views/partials/footer.twig b/wp-content/themes/cosmopet-timber/views/partials/footer.twig
deleted file mode 100644
index 606165c..0000000
--- a/wp-content/themes/cosmopet-timber/views/partials/footer.twig
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/wp-content/themes/cosmopet-timber/views/partials/head.twig b/wp-content/themes/cosmopet-timber/views/partials/head.twig
deleted file mode 100644
index ea68c2a..0000000
--- a/wp-content/themes/cosmopet-timber/views/partials/head.twig
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
- {% do action('get_header') %}
- {{ function('wp_head') }}
-
diff --git a/wp-content/themes/cosmopet-timber/views/partials/menu.twig b/wp-content/themes/cosmopet-timber/views/partials/menu.twig
deleted file mode 100644
index 377dc98..0000000
--- a/wp-content/themes/cosmopet-timber/views/partials/menu.twig
+++ /dev/null
@@ -1,12 +0,0 @@
-{% if menu %}
-
- {% for item in items %}
-
- {{ item.title }}
- {% include 'partials/menu.twig' with {
- items: item.children
- } %}
-
- {% endfor %}
-
-{% endif %}
diff --git a/wp-content/themes/cosmopet-timber/views/partials/pagination.twig b/wp-content/themes/cosmopet-timber/views/partials/pagination.twig
deleted file mode 100644
index e4d737b..0000000
--- a/wp-content/themes/cosmopet-timber/views/partials/pagination.twig
+++ /dev/null
@@ -1,44 +0,0 @@
-{% if posts.pagination.pages is not empty %}
-
-{% endif %}
diff --git a/wp-content/themes/cosmopet-timber/views/partials/tease-post.twig b/wp-content/themes/cosmopet-timber/views/partials/tease-post.twig
deleted file mode 100644
index 5a08767..0000000
--- a/wp-content/themes/cosmopet-timber/views/partials/tease-post.twig
+++ /dev/null
@@ -1,16 +0,0 @@
-{% extends 'partials/tease.twig' %}
-
-{% block content %}
-
-
- {{
- post.excerpt({
- words: 5,
- read_more: 'Keep reading'
- })
- }}
-
- {% if post.thumbnail.src %}
-
- {% endif %}
-{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/partials/tease.twig b/wp-content/themes/cosmopet-timber/views/partials/tease.twig
deleted file mode 100644
index 1a0f7b0..0000000
--- a/wp-content/themes/cosmopet-timber/views/partials/tease.twig
+++ /dev/null
@@ -1,9 +0,0 @@
-
- {% block content %}
-
- {{ post.excerpt }}
- {% if post.thumbnail %}
-
- {% endif %}
- {% endblock %}
-
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet-timber/views/templates/404.twig b/wp-content/themes/cosmopet-timber/views/templates/404.twig
deleted file mode 100644
index 1b2073c..0000000
--- a/wp-content/themes/cosmopet-timber/views/templates/404.twig
+++ /dev/null
@@ -1,5 +0,0 @@
-{% extends 'layouts/base.twig' %}
-
-{% block content %}
- Sorry, we couldn't find what you're looking for.
-{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/archive.twig b/wp-content/themes/cosmopet-timber/views/templates/archive.twig
deleted file mode 100644
index ae021ea..0000000
--- a/wp-content/themes/cosmopet-timber/views/templates/archive.twig
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends 'layouts/base.twig' %}
-
-{% block content %}
- {% for post in posts %}
- {% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
- {% endfor %}
-
- {% include 'partials/pagination.twig' with {
- pagination: posts.pagination({
- show_all: false,
- mid_size: 3,
- end_size: 2
- })
- } %}
-{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/author.twig b/wp-content/themes/cosmopet-timber/views/templates/author.twig
deleted file mode 100644
index 6d19761..0000000
--- a/wp-content/themes/cosmopet-timber/views/templates/author.twig
+++ /dev/null
@@ -1,7 +0,0 @@
-{% extends 'layouts/base.twig' %}
-
-{% block content %}
- {% for post in posts %}
- {% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
- {% endfor %}
-{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/index.twig b/wp-content/themes/cosmopet-timber/views/templates/index.twig
deleted file mode 100644
index b68fbd7..0000000
--- a/wp-content/themes/cosmopet-timber/views/templates/index.twig
+++ /dev/null
@@ -1,16 +0,0 @@
-{% extends 'layouts/base.twig' %}
-
-{% block content %}
- {{ foo }}
- {% for post in posts %}
- {% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
- {% endfor %}
-
- {% include 'partials/pagination.twig' with {
- pagination: posts.pagination({
- show_all: false,
- mid_size: 3,
- end_size: 2
- })
- } %}
-{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/page.twig b/wp-content/themes/cosmopet-timber/views/templates/page.twig
deleted file mode 100644
index 7709c52..0000000
--- a/wp-content/themes/cosmopet-timber/views/templates/page.twig
+++ /dev/null
@@ -1,12 +0,0 @@
-{% extends 'layouts/base.twig' %}
-
-{% block content %}
-
-
-
- {{ post.title }}
- {{ post.content }}
-
-
-
-{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/search.twig b/wp-content/themes/cosmopet-timber/views/templates/search.twig
deleted file mode 100644
index f8853a6..0000000
--- a/wp-content/themes/cosmopet-timber/views/templates/search.twig
+++ /dev/null
@@ -1,18 +0,0 @@
-{# see `templates/archive.twig` for an alternative strategy of extending templates #}
-{% extends 'layouts/base.twig' %}
-
-{% block content %}
-
- {% for post in posts %}
- {% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
- {% endfor %}
-
- {% include 'partials/pagination.twig' with {
- pagination: posts.pagination({
- show_all: false,
- mid_size: 3,
- end_size: 2
- })
- } %}
-
-{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/single-password.twig b/wp-content/themes/cosmopet-timber/views/templates/single-password.twig
deleted file mode 100644
index fc62761..0000000
--- a/wp-content/themes/cosmopet-timber/views/templates/single-password.twig
+++ /dev/null
@@ -1,17 +0,0 @@
-{% extends 'layouts/base.twig' %}
-
-{% block content %}
-
-{% endblock %}
diff --git a/wp-content/themes/cosmopet-timber/views/templates/single.twig b/wp-content/themes/cosmopet-timber/views/templates/single.twig
deleted file mode 100644
index 584450d..0000000
--- a/wp-content/themes/cosmopet-timber/views/templates/single.twig
+++ /dev/null
@@ -1,37 +0,0 @@
-{% extends 'layouts/base.twig' %}
-
-{% block content %}
-
-
-
-
- {{ post.title }}
-
- By
- {{ post.author.name }}
- •
- {{ post.date }}
-
- {{ post.content }}
-
-
-
-
-{% endblock %}
diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php
index d0d6129..f6405ef 100644
--- a/wp-content/themes/cosmopet/functions.php
+++ b/wp-content/themes/cosmopet/functions.php
@@ -24,11 +24,11 @@ add_filter( 'timber/integrations', function ( array $integrations ): array {
return $integrations;
} );
-function theme_enqueue_scripts() {
- // Swiper
- wp_enqueue_script( 'gp-front-page-materialize', get_template_directory_uri() . '/modules/layout/assets/js/materialize.min.js', array(), null, true );
-}
-add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');
+// function theme_enqueue_scripts() {
+// // Swiper
+// wp_enqueue_script( 'gp-front-page-materialize', get_template_directory_uri() . '/modules/layout/assets/js/materialize.min.js', array(), null, true );
+// }
+// add_action('wp_enqueue_scripts', 'theme_enqueue_scripts');
add_action('timber/init', function() {
@@ -434,7 +434,7 @@ require_once('modules/blog/module-ajax-controller.php');
require_once('modules/forms/module-ajax-controller.php');
require_once('modules/shop/module-ajax-controller.php');
require_once('modules/profile/module-ajax-controller.php');
-
+require_once('modules/footer/module-ajax-controller.php');
add_action('wp', 'my_custom_checkout_code');
function my_custom_checkout_code() {
diff --git a/wp-content/themes/cosmopet/modules/footer/module-ajax-controller.php b/wp-content/themes/cosmopet/modules/footer/module-ajax-controller.php
index e69de29..4f04a01 100644
--- a/wp-content/themes/cosmopet/modules/footer/module-ajax-controller.php
+++ b/wp-content/themes/cosmopet/modules/footer/module-ajax-controller.php
@@ -0,0 +1,202 @@
+
+
+ Hello, " . esc_html($current_user->display_name) . "!";
+ echo "Log out
";
+ }
+}
+
+function tgScript(){
+ $bot_username = BOT_USERNAME;
+ ?>
+
+
+ sanitize_text_field($_POST['userid']),
+ 'first_name' => sanitize_text_field($_POST['fname']),
+ 'last_name' => sanitize_text_field($_POST['lname']),
+ 'username' => sanitize_text_field($_POST['username'] ?? ''),
+ ];
+
+ if (!$auth_data['id']) {
+ wp_die(json_encode(['status' => 'error', 'message' => 'Invalid Telegram data']));
+ }
+
+ // Проверяем существование пользователя по tg_account
+ $users = get_users([
+ 'meta_key' => 'tg_account',
+ 'meta_value' => $auth_data['id'],
+ 'number' => 1
+ ]);
+
+ $password = wp_generate_password(12, true, false); // Генерация безопасного пароля
+
+ if ($users) {
+ // Существующий пользователь
+ $user = $users[0];
+ wp_set_password($password, $user->ID);
+ $login = wp_signon([
+ 'user_login' => $user->user_login,
+ 'user_password' => $password,
+ 'remember' => true
+ ]);
+
+ if (!is_wp_error($login)) {
+ session_start();
+ $_SESSION['tg_user'] = $auth_data;
+ session_write_close();
+ wp_die(json_encode(['status' => 'success', 'redirect' => admin_url()]));
+ }
+ } else {
+ // Новый пользователь
+ $username = sanitize_user($auth_data['username'] ?: $auth_data['first_name'] . '_' . $auth_data['last_name'], true);
+ $username = wp_slash($username); // Экранируем для безопасности
+ $user_id = wp_create_user($username, $password, $username . '@telegram.com');
+
+ if (!is_wp_error($user_id)) {
+ wp_update_user([
+ 'ID' => $user_id,
+ 'display_name' => $auth_data['first_name'] . ' ' . $auth_data['last_name'],
+ 'first_name' => $auth_data['first_name'],
+ 'last_name' => $auth_data['last_name']
+ ]);
+ add_user_meta($user_id, 'tg_account', $auth_data['id']);
+ add_user_meta($user_id, 'tg_username', $auth_data['username']);
+
+ $login = wp_signon([
+ 'user_login' => $username,
+ 'user_password' => $password,
+ 'remember' => true
+ ]);
+
+ if (!is_wp_error($login)) {
+ session_start();
+ $_SESSION['tg_user'] = $auth_data;
+ session_write_close();
+ wp_die(json_encode(['status' => 'success', 'redirect' => admin_url()]));
+ }
+ }
+ }
+
+ wp_die(json_encode(['status' => 'error', 'message' => 'Login failed']));
+}
+
+// Функция привязки Telegram к существующему пользователю
+add_action('wp_ajax_linktelegram', 'linkTelegram');
+add_action('wp_ajax_nopriv_linktelegram', 'linkTelegram');
+
+function linkTelegram() {
+ if (!is_user_logged_in()) {
+ wp_die(json_encode(['status' => 'error', 'message' => 'Not logged in']));
+ }
+
+ $tg_id = sanitize_text_field($_POST['userid']);
+ $user_id = get_current_user_id();
+
+ add_user_meta($user_id, 'tg_account', $tg_id);
+ wp_update_user([
+ 'ID' => $user_id,
+ 'first_name' => sanitize_text_field($_POST['fname']),
+ 'last_name' => sanitize_text_field($_POST['lname'])
+ ]);
+
+ wp_die(json_encode(['status' => 'success']));
+}
+
+// Функция обновления email
+add_action('wp_ajax_email_link', 'emailLink');
+add_action('wp_ajax_nopriv_email_link', 'emailLink');
+
+function emailLink() {
+ if (!is_user_logged_in()) {
+ wp_die(json_encode(['status' => 'error', 'message' => 'Not logged in']));
+ }
+
+ $email = sanitize_email($_POST['email']);
+ $user_id = get_current_user_id();
+
+ if (email_exists($email)) {
+ wp_die(json_encode(['status' => 'error', 'message' => 'Email is already registered']));
+ }
+
+ wp_update_user(['ID' => $user_id, 'user_email' => $email]);
+ wp_die(json_encode(['status' => 'success']));
+}
+
+// Добавление и настройка колонки Telegram
+add_filter('manage_users_columns', 'add_tg_account_column');
+function add_tg_account_column($columns) {
+ $columns['tg_username'] = 'Telegram';
+ return $columns;
+}
+
+add_action('manage_users_custom_column', 'add_tg_account_column_content', 10, 3);
+function add_tg_account_column_content($value, $column_name, $user_id) {
+ if ('tg_username' == $column_name) {
+ $tg_username = get_user_meta($user_id, 'tg_username', true);
+ return $tg_username ? '@' . esc_html($tg_username) . ' ' : 'не указан ';
+ }
+ return $value;
+}
+
+add_filter('manage_users_sortable_columns', 'make_tg_account_column_sortable');
+function make_tg_account_column_sortable($columns) {
+ $columns['tg_username'] = 'tg_username';
+ return $columns;
+}
+
+add_action('pre_get_users', 'handle_tg_account_sorting');
+function handle_tg_account_sorting($query) {
+ if (!is_admin() || !$query->is_main_query()) return;
+ if ('tg_username' === $query->get('orderby')) {
+ $query->set('meta_key', 'tg_username');
+ $query->set('orderby', 'meta_value');
+ }
+}
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/modules/footer/module-controller.php b/wp-content/themes/cosmopet/modules/footer/module-controller.php
index 64ed74f..84ea5a5 100644
--- a/wp-content/themes/cosmopet/modules/footer/module-controller.php
+++ b/wp-content/themes/cosmopet/modules/footer/module-controller.php
@@ -9,184 +9,3 @@ add_filter('timber/context', function($context) {
return $context;
});
-// Динамическое определение BOT_USERNAME
-$site_url = site_url();
-if ($site_url === 'https://cosmopet-test-ru.cp.good-production.xyz') {
- define('BOT_USERNAME', 'cosmopet_test_RU_bot');
-} elseif ($site_url === 'https://cosmopet-test-ae.cp.good-production.xyz') {
- define('BOT_USERNAME', 'cosmopet_test_AE_bot');
-} else {
- define('BOT_USERNAME', 'cosmopet_test_default_bot'); // Фallback на случай других доменов
-}
-
-// Функция получения данных Telegram
-function getTelegramUserData() {
- if (isset($_SESSION['tg_user'])) {
- return $_SESSION['tg_user'];
- }
- return false;
-}
-
-// Функция вывода Telegram Widget
-function tgWidget() {
- if (!is_user_logged_in()) {
- $bot_username = BOT_USERNAME;
- $html = '';
- echo $html;
- } else {
- $current_user = wp_get_current_user();
- $html = "Hello, " . esc_html($current_user->display_name) . "! ";
- $html .= "Log out
";
- echo $html;
- }
-}
-
-// Обработчик авторизации через Telegram
-add_action('wp_ajax_ontelegramauth', 'onTelegramAuth');
-add_action('wp_ajax_nopriv_ontelegramauth', 'onTelegramAuth');
-
-function onTelegramAuth() {
- // Получаем данные от Telegram
- $auth_data = [
- 'id' => sanitize_text_field($_POST['id']),
- 'first_name' => sanitize_text_field($_POST['first_name']),
- 'last_name' => sanitize_text_field($_POST['last_name']),
- 'username' => sanitize_text_field($_POST['username'] ?? ''),
- 'photo_url' => sanitize_text_field($_POST['photo_url'] ?? '')
- ];
-
- if (!$auth_data['id']) {
- wp_die(json_encode(['status' => 'error', 'message' => 'Invalid Telegram data']));
- }
-
- // Проверяем существование пользователя по tg_account
- $users = get_users([
- 'meta_key' => 'tg_account',
- 'meta_value' => $auth_data['id'],
- 'number' => 1
- ]);
-
- $password = wp_generate_password(12, true, false); // Генерация безопасного пароля
-
- if ($users) {
- // Существующий пользователь
- $user = $users[0];
- wp_set_password($password, $user->ID);
- $login = wp_signon([
- 'user_login' => $user->user_login,
- 'user_password' => $password,
- 'remember' => true
- ]);
-
- if (!is_wp_error($login)) {
- session_start();
- $_SESSION['tg_user'] = $auth_data;
- session_write_close();
- wp_die(json_encode(['status' => 'success', 'redirect' => admin_url()]));
- }
- } else {
- // Новый пользователь
- $username = sanitize_user($auth_data['username'] ?: $auth_data['first_name'] . '_' . $auth_data['last_name'], true);
- $username = wp_slash($username); // Экранируем для безопасности
- $user_id = wp_create_user($username, $password, $username . '@telegram.com');
-
- if (!is_wp_error($user_id)) {
- wp_update_user([
- 'ID' => $user_id,
- 'display_name' => $auth_data['first_name'] . ' ' . $auth_data['last_name'],
- 'first_name' => $auth_data['first_name'],
- 'last_name' => $auth_data['last_name']
- ]);
- add_user_meta($user_id, 'tg_account', $auth_data['id']);
- add_user_meta($user_id, 'tg_username', $auth_data['username']);
-
- $login = wp_signon([
- 'user_login' => $username,
- 'user_password' => $password,
- 'remember' => true
- ]);
-
- if (!is_wp_error($login)) {
- session_start();
- $_SESSION['tg_user'] = $auth_data;
- session_write_close();
- wp_die(json_encode(['status' => 'success', 'redirect' => admin_url()]));
- }
- }
- }
-
- wp_die(json_encode(['status' => 'error', 'message' => 'Login failed']));
-}
-
-// Функция привязки Telegram к существующему пользователю
-add_action('wp_ajax_linktelegram', 'linkTelegram');
-add_action('wp_ajax_nopriv_linktelegram', 'linkTelegram');
-
-function linkTelegram() {
- if (!is_user_logged_in()) {
- wp_die(json_encode(['status' => 'error', 'message' => 'Not logged in']));
- }
-
- $tg_id = sanitize_text_field($_POST['userid']);
- $user_id = get_current_user_id();
-
- add_user_meta($user_id, 'tg_account', $tg_id);
- wp_update_user([
- 'ID' => $user_id,
- 'first_name' => sanitize_text_field($_POST['fname']),
- 'last_name' => sanitize_text_field($_POST['lname'])
- ]);
-
- wp_die(json_encode(['status' => 'success']));
-}
-
-// Функция обновления email
-add_action('wp_ajax_email_link', 'emailLink');
-add_action('wp_ajax_nopriv_email_link', 'emailLink');
-
-function emailLink() {
- if (!is_user_logged_in()) {
- wp_die(json_encode(['status' => 'error', 'message' => 'Not logged in']));
- }
-
- $email = sanitize_email($_POST['email']);
- $user_id = get_current_user_id();
-
- if (email_exists($email)) {
- wp_die(json_encode(['status' => 'error', 'message' => 'Email is already registered']));
- }
-
- wp_update_user(['ID' => $user_id, 'user_email' => $email]);
- wp_die(json_encode(['status' => 'success']));
-}
-
-// Добавление и настройка колонки Telegram
-add_filter('manage_users_columns', 'add_tg_account_column');
-function add_tg_account_column($columns) {
- $columns['tg_username'] = 'Telegram';
- return $columns;
-}
-
-add_action('manage_users_custom_column', 'add_tg_account_column_content', 10, 3);
-function add_tg_account_column_content($value, $column_name, $user_id) {
- if ('tg_username' == $column_name) {
- $tg_username = get_user_meta($user_id, 'tg_username', true);
- return $tg_username ? '@' . esc_html($tg_username) . ' ' : 'не указан ';
- }
- return $value;
-}
-
-add_filter('manage_users_sortable_columns', 'make_tg_account_column_sortable');
-function make_tg_account_column_sortable($columns) {
- $columns['tg_username'] = 'tg_username';
- return $columns;
-}
-
-add_action('pre_get_users', 'handle_tg_account_sorting');
-function handle_tg_account_sorting($query) {
- if (!is_admin() || !$query->is_main_query()) return;
- if ('tg_username' === $query->get('orderby')) {
- $query->set('meta_key', 'tg_username');
- $query->set('orderby', 'meta_value');
- }
-}
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/modules/footer/module.template.twig b/wp-content/themes/cosmopet/modules/footer/module.template.twig
index 5574dc8..8ccbf19 100644
--- a/wp-content/themes/cosmopet/modules/footer/module.template.twig
+++ b/wp-content/themes/cosmopet/modules/footer/module.template.twig
@@ -49,4 +49,4 @@
-
\ No newline at end of file
+
diff --git a/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css b/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css
index dad8e2b..a0fb9f7 100644
--- a/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css
+++ b/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css
@@ -1270,14 +1270,11 @@ textarea{
}
.toggle::after{
content: '';
-
position: absolute;
top: 24px;
right: 0;
-
width: 24px;
aspect-ratio: 1;
-
background-image: url(../img/svg/main/black-x.svg);
transform: rotate(45deg);
transition: transform .2s;
@@ -2178,3 +2175,9 @@ textarea{
}
+.modal__button--center{
+ margin-right: auto;
+ margin-left: auto;
+ display: block;
+ width: max-content;
+}
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/modules/layout/assets/img/svg/main/black-x.svg b/wp-content/themes/cosmopet/modules/layout/assets/img/svg/main/black-x.svg
new file mode 100644
index 0000000..cb3041d
--- /dev/null
+++ b/wp-content/themes/cosmopet/modules/layout/assets/img/svg/main/black-x.svg
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js b/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js
index 60c24ee..c10052e 100644
--- a/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js
+++ b/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js
@@ -450,26 +450,6 @@ if (document.querySelector('.header').classList.contains('white')) {
// });
// });
-var slider = carousel_init();
-
-function carousel_init() {
- var carousel = document.querySelectorAll('.carousel');
- var options = {
- numVisible: window.innerWidth > 421 ? 5 : 3,
- indicators: false // Removed dots
- };
- var instances = M.Carousel.init(carousel, options);
- document.querySelectorAll('.about_slider_nav').forEach(btn => {
- btn.addEventListener('click', function (e) {
- if (e.target.closest('button').classList.contains('next')) {
- instances[0].next();
- } else {
- instances[0].prev();
- }
- });
- });
- return instances;
-}
document.addEventListener('DOMContentLoaded', function () {
const petsSlider = new Swiper(".discount_cosmodog__slider", {
diff --git a/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js b/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js
index 0bd386d..53162d7 100644
--- a/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js
+++ b/wp-content/themes/cosmopet/modules/shop/components/cart/assets/js/cart.js
@@ -341,13 +341,12 @@ jQuery(document).ready(function($) {
if (response.success) {
$('#modal-basket-content').html(response.data.contents);
$('.modal-block-price__price').html(response.data.total);
+ $('#modal-basket-footer').html(response.data.cart_bottom)
$('.mini-profile__button--counter').text(response.data.count);
if (response.data.count > 0) {
$('.mini-profile__button--counter').removeClass('disabled');
- $('.proceed-to-checkout').css('display', ''); // Показываем кнопку, если есть товары
} else {
$('.mini-profile__button--counter').addClass('disabled');
- $('.proceed-to-checkout').css('display', 'none'); // Скрываем кнопку, если корзина пуста
}
}
},
diff --git a/wp-content/themes/cosmopet/modules/shop/components/checkout/assets/js/script.js b/wp-content/themes/cosmopet/modules/shop/components/checkout/assets/js/script.js
index fafa1a1..e5e05eb 100644
--- a/wp-content/themes/cosmopet/modules/shop/components/checkout/assets/js/script.js
+++ b/wp-content/themes/cosmopet/modules/shop/components/checkout/assets/js/script.js
@@ -151,182 +151,14 @@ jQuery(document).ready(function ($) {
$('#delete_coupon').on('click', function(){
$('.woocommerce-remove-coupon[data-coupon=' + $(this).data('coupon') + ']').click()
+ $('#promo_form').show()
+ $('#promo_delete').hide()
})
$('.woocommerce-remove-coupon').on('click', function(){
-
$('#promo_form').show()
- $('#promo_delete').hide()
+ $('#promo_delete').hide()
})
});
-jQuery(document).ready(function($) {
- // Функция для получения активных фильтров из URL
- function getActiveFilters() {
- const params = new URLSearchParams(window.location.search);
- const filters = [];
-
- params.forEach((value, key) => {
- if (key.startsWith('filter_') || key === 'min_price' || key === 'max_price') {
- let filterName = key.replace('filter_', '').replace('_', ' ');
- let filterValue = value.split(',').map(val => decodeURIComponent(val.replace(/\+/g, ' ')));
-
- if (key === 'min_price') {
- filterName = 'Цена от';
- filterValue = [value + ' ₽'];
- } else if (key === 'max_price') {
- filterName = 'Цена до';
- filterValue = [value + ' ₽'];
- }
-
- filters.push({
- key: key,
- name: filterName.charAt( W1).toUpperCase() + filterName.slice(1),
- values: filterValue
- });
- }
- });
-
- return filters;
- }
-
- // Функция для отображения активных фильтров
- function displayActiveFilters() {
- const $filterList = $('.active-filters__list');
- const $filterContainer = $('.active-filters');
- const $clearButton = $('.active-filters__clear');
- $filterList.empty();
-
- const activeFilters = getActiveFilters();
-
- if (activeFilters.length > 0) {
- $filterContainer.show();
- $clearButton.show();
-
- activeFilters.forEach(filter => {
- filter.values.forEach(value => {
- const $filterTag = $('', {
- class: 'active-filters__tag',
- html: `${filter.name}: ${value} × `
- });
- $filterList.append($filterTag);
- });
- });
- W2 else {
- $filterContainer.hide();
- $clearButton.hide();
- }
- }
-
- // Инициализация при загрузке страницы
- displayActiveFilters();
-
- // Обновление фильтров после AJAX-фильтрации
- $(document).on('wcpf_after_filtering', function() {
- displayActiveFilters();
- });
-
- // Удаление фильтра
- $(document).on('click', '.active-filters__remove', function() {
- const key = $(this).data('key');
- const value = $(this).data('value');
- const params = new URLSearchParams(window.location.search);
-
- if (key === 'min_price' || key === 'max_price') {
- params.delete(key);
- } else {
- let values = params.get(key) ? params.get(key).split(',') : [];
- values = values.filter(val => decodeURIComponent(val.replace(/\+/g, ' ')) !== value);
- if (values.length > 0) {
- params.set(key, values.join(','));
- } else {
- params.delete(key);
- }
- }
-
- const newUrl = window.location.pathname + (params.toString() ? '?' + params.toString() : '');
- window.history.pushState({}, '', newUrl);
-
- // Запуск AJAX-фильтрации
- $.ajax({
- url: wc_checkout_params.ajax_url,
- type: 'POST',
- data: {
- action: 'wcpf_filter',
- query: params.toString(),
- category_id: $('#load-more-products').data('category_id'),
- category_type: $('#load-more-products').data('category_type')
- },
- success: function(response) {
- if (response.success) {
- $('.product__main').html(response.data.products);
- displayActiveFilters();
- $(document.body).trigger('wc_fragments_refreshed');
- }
- },
- error: function() {
- alert('Ошибка при обновлении фильтров');
- }
- });
- });
-
- // Очистка всех фильтров
- $(document).on('click', '.active-filters__clear', function() {
- const params = new URLSearchParams(window.location.search);
- const newUrl = window.location.pathname;
- window.history.pushState({}, '', newUrl);
-
- $.ajax({
- url: wc_checkout_params.ajax_url,
- type: 'POST',
- data: {
- action: 'wcpf_filter',
- query: '',
- category_id: $('#load-more-products').data('category_id'),
- category_type: $('#load-more-products').data('category_type')
- },
- success: function(response) {
- if (response.success) {
- $('.product__main').html(response.data.products);
- displayActiveFilters();
- $(document.body).trigger('wc_fragments_refreshed');
- }
- },
- error: function() {
- alert('Ошибка при очистке фильтров');
- }
- });
- });
- // Обработка загрузки дополнительных продуктов
- $(document).on('click', '#load-more-products', function() {
- const $button = $(this);
- const categoryId = $button.data('category_id');
- const categoryType = $button.data('category_type');
- const page = parseInt($button.data('page') || 1) + 1;
-
- $.ajax({
- url: wc_checkout_params.ajax_url,
- type: 'POST',
- data: {
- action: 'load_more_products',
- category_id: categoryId,
- category_type: categoryType,
- page: page,
- query: window.location.search
- },
- success: function(response) {
- if (response.success) {
- $('.product__main').append(response.data.products);
- $button.data('page', page);
- if (!response.data.has_more) {
- $button.hide();
- }
- }
- },
- error: function() {
- alert('Ошибка при загрузке продуктов');
- }
- });
- });
-});
diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css
index dfd284e..c3fd1d3 100644
--- a/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css
+++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/assets/css/gp-style-core.css
@@ -1560,4 +1560,9 @@ input:checked + .subscription-option-details::before, input:checked + .wcsatt-op
.detail #wc-stripe-express-checkout-element{
display: none !important;
+}
+
+.detail-block-form__item--radio{
+ display: flex;
+ gap: 10px;
}
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/modules/shop/components/single-product/component-template.twig b/wp-content/themes/cosmopet/modules/shop/components/single-product/component-template.twig
index 5dfbb56..974cdfe 100644
--- a/wp-content/themes/cosmopet/modules/shop/components/single-product/component-template.twig
+++ b/wp-content/themes/cosmopet/modules/shop/components/single-product/component-template.twig
@@ -96,10 +96,16 @@
{% if siblings %}
-
+{% verbatim %}
\ No newline at end of file
diff --git a/wp-content/themes/cosmopet/templates/pet-card.twig b/wp-content/themes/cosmopet/templates/pet-card.twig
index f1d642c..b0c76fc 100644
--- a/wp-content/themes/cosmopet/templates/pet-card.twig
+++ b/wp-content/themes/cosmopet/templates/pet-card.twig
@@ -10,37 +10,37 @@
-
{{ pll_e('Breed') }}:
+
{{ fn('pll_e', 'Breed') }}:
{{ function('get_field', 'breed', pet_id) }}
-
{{ pll_e('Weight') }}:
+
{{ fn('pll_e','Weight') }}:
{% set weight_key = function('get_field', 'weight', pet_id) %}
- {% if weight_key == 'below_1_5' %}{{ pll_e('from 0,5 kg to 1,5 kg') }}
- {% elseif weight_key == '1_5-3' %}{{ pll_e('from 1.5 to 3 kg') }}
- {% elseif weight_key == '3-5' %}{{ pll_e('from 3 to 5 kg') }}
- {% elseif weight_key == '5-8' %}{{ pll_e('from 5 to 8 kg') }}
- {% elseif weight_key == '8-11' %}{{ pll_e('from 8 to 11 kg') }}
- {% elseif weight_key == '11-15' %}{{ pll_e('from 11 to 15 kg') }}
- {% elseif weight_key == '15-20' %}{{ pll_e('from 15 to 20 kg') }}
- {% elseif weight_key == '20-25' %}{{ pll_e('from 20 to 25 kg') }}
- {% elseif weight_key == '25-35' %}{{ pll_e('from 25 to 35 kg') }}
- {% elseif weight_key == 'more_35' %}{{ pll_e('More than 35 kg') }}
+ {% if weight_key == 'below_1_5' %}{{ fn('pll_e', 'from 0,5 kg to 1,5 kg') }}
+ {% elseif weight_key == '1_5-3' %}{{ fn('pll_e', 'from 1.5 to 3 kg') }}
+ {% elseif weight_key == '3-5' %}{{ fn('pll_e', 'from 3 to 5 kg') }}
+ {% elseif weight_key == '5-8' %}{{ fn('pll_e', 'from 5 to 8 kg') }}
+ {% elseif weight_key == '8-11' %}{{ fn('pll_e', 'from 8 to 11 kg') }}
+ {% elseif weight_key == '11-15' %}{{ fn('pll_e', 'from 11 to 15 kg') }}
+ {% elseif weight_key == '15-20' %}{{ fn('pll_e', 'from 15 to 20 kg') }}
+ {% elseif weight_key == '20-25' %}{{ fn('pll_e', 'from 20 to 25 kg') }}
+ {% elseif weight_key == '25-35' %}{{ fn('pll_e', 'from 25 to 35 kg') }}
+ {% elseif weight_key == 'more_35' %}{{ fn('pll_e', 'More than 35 kg') }}
{% endif %}
{% if function('get_field', 'old', pet_id) %}
-
{{ pll_e('Age') }}:
+
{{ fn('pll_e', 'Age') }}:
{% set age_key = function('get_field', 'old', pet_id) %}
- {% if age_key == 'normal' %}{{ pll_e('Adult (from 1 year to 7 years)') }}
- {% elseif age_key == 'old' %}{{ pll_e('Elderly (from 7 to 12 years)') }}
- {% elseif age_key == 'very_old' %}{{ pll_e('Aging (12 years and older)') }}
- {% elseif age_key == 'baby' %}{{ pll_e('Baby (from 0 to 1 year)') }}
+ {% if age_key == 'normal' %}{{ fn('pll_e', 'Adult (from 1 year to 7 years)') }}
+ {% elseif age_key == 'old' %}{{ fn('pll_e', 'Elderly (from 7 to 12 years)') }}
+ {% elseif age_key == 'very_old' %}{{ fn('pll_e', 'Aging (12 years and older)') }}
+ {% elseif age_key == 'baby' %}{{ fn('pll_e', 'Baby (from 0 to 1 year)') }}
{% endif %}
@@ -48,7 +48,7 @@
{% set month = function('get_field', 'month', pet_id) %}
{% set zero = month < 10 ? '0' : '' %}
-
{{ pll_e('Birthday') }}:
+
{{ fn('pll_e', 'Birthday') }}:
{{ function('get_field', 'day', pet_id) }}.{{ zero }}{{ month }}.{{ function('get_field', 'year', pet_id) }}
@@ -56,25 +56,25 @@
{% endif %}
-
{{ pll_e('Activity') }}:
+
{{ fn('pll_e', 'Activity') }}:
{% set activity_key = function('get_field', 'activity', pet_id) %}
- {% if activity_key == 'low' %}{{ pll_e('Low') }}
- {% elseif activity_key == 'moderate' %}{{ pll_e('Moderate') }}
- {% elseif activity_key == 'high' %}{{ pll_e('High') }}
+ {% if activity_key == 'low' %}{{ fn('pll_e', 'Low') }}
+ {% elseif activity_key == 'moderate' %}{{ fn('pll_e', 'Moderate') }}
+ {% elseif activity_key == 'high' %}{{ fn('pll_e', 'High') }}
{% endif %}
{% if function('get_field', 'type', pet_id) == 'cat' and function('get_field', 'sterilized', pet_id) %}
-
{{ pll_e('Sterilized') }}
+
{{ fn('pll_e', 'Sterilized') }}
{% endif %}
- {{ pll_e('Edit') }}
+ {{ fn('pll_e', 'Edit') }}
diff --git a/wp-content/themes/cosmopet/templates/profile/profile.twig b/wp-content/themes/cosmopet/templates/profile/profile.twig
index 59c67ea..7b79b8a 100644
--- a/wp-content/themes/cosmopet/templates/profile/profile.twig
+++ b/wp-content/themes/cosmopet/templates/profile/profile.twig
@@ -107,14 +107,9 @@
-{% endblock %}
-
-
-
-
+
-
{{ fn('pll_e', 'Вес') }}
+
{{ fn('pll_e', 'Вес') }}
+
+
{{ fn('pll_e', 'Добавить') }}
+
+
Add comment
- -