* @version 2022-01-02
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['elfinder'], factory);
} else if (typeof exports !== 'undefined') {
module.exports = factory(require('elfinder'));
} else {
factory(root.elFinder);
}
}(this, function(elFinder) {
elFinder.prototype.i18.ru = {
translator : 'Dmitry "dio" Levashov <dio@std42.ru>, Andrew Berezovsky <andrew.berezovsky@gmail.com>, Alex Yashkin <alex@yashkin.by>',
language : 'Русский язык',
direction : 'ltr',
dateFormat : 'd M Y H:i', // will show like: 02 Янв 2022 19:53
fancyDateFormat : '$1 H:i', // will show like: Сегодня 19:53
nonameDateFormat : 'ymd-His', // noname upload will show like: 220102-195313
messages : {
/********************************** errors **********************************/
'error' : 'Ошибка',
'errUnknown' : 'Неизвестная ошибка.',
'errUnknownCmd' : 'Неизвестная команда.',
'errJqui' : 'Отсутствуют необходимые компоненты jQuery UI - selectable, draggable и droppable.',
'errNode' : 'Отсутствует DOM элемент для инициализации elFinder.',
'errURL' : 'Неверная конфигурация elFinder! Не указан URL.',
'errAccess' : 'Доступ запрещен.',
'errConnect' : 'Не удалось соединиться с сервером.',
'errAbort' : 'Соединение прервано.',
'errTimeout' : 'Таймаут соединения.',
'errNotFound' : 'Сервер не найден.',
'errResponse' : 'Некорректный ответ сервера.',
'errConf' : 'Некорректная настройка сервера.',
'errJSON' : 'Модуль PHP JSON не установлен.',
'errNoVolumes' : 'Отсутствуют корневые директории достуные для чтения.',
'errCmdParams' : 'Некорректные параметры команды "$1".',
'errDataNotJSON' : 'Данные не в формате JSON.',
'errDataEmpty' : 'Данные отсутствуют.',
'errCmdReq' : 'Для запроса к серверу необходимо указать имя команды.',
'errOpen' : 'Не удалось открыть "$1".',
'errNotFolder' : 'Объект не является папкой.',
'errNotFile' : 'Объект не является файлом.',
'errRead' : 'Ошибка чтения "$1".',
'errWrite' : 'Ошибка записи в "$1".',
'errPerm' : 'Доступ запрещен.',
'errLocked' : '"$1" защищен и не может быть переименован, перемещен или удален.',
'errExists' : 'В папке уже существует файл с именем "$1".',
'errInvName' : 'Недопустимое имя файла.',
'errInvDirname' : 'Недопустимое имя папки.', // from v2.1.24 added 12.4.2017
'errFolderNotFound' : 'Папка не найдена.',
'errFileNotFound' : 'Файл не найден.',
'errTrgFolderNotFound' : 'Целевая папка "$1" не найдена.',
'errPopup' : 'Браузер заблокировал открытие нового окна. Чтобы открыть файл, измените настройки браузера.',
'errMkdir' : 'Ошибка создания папки "$1".',
'errMkfile' : 'Ошибка создания файла "$1".',
'errRename' : 'Ошибка переименования "$1".',
'errCopyFrom' : 'Копирование файлов из директории "$1" запрещено.',
'errCopyTo' : 'Копирование файлов в директорию "$1" запрещено.',
'errMkOutLink' : 'Невозможно создать ссылку вне корня раздела.', // from v2.1 added 03.10.2015
'errUpload' : 'Ошибка загрузки.', // old name - errUploadCommon
'errUploadFile' : 'Невозможно загрузить "$1".', // old name - errUpload
'errUploadNoFiles' : 'Нет файлов для загрузки.',
'errUploadTotalSize' : 'Превышен допустимый размер загружаемых данных.', // old name - errMaxSize
'errUploadFileSize' : 'Размер файла превышает допустимый.', // old name - errFileMaxSize
'errUploadMime' : 'Недопустимый тип файла.',
'errUploadTransfer' : 'Ошибка передачи файла "$1".',
'errUploadTemp' : 'Невозможно создать временный файл для загрузки.', // from v2.1 added 26.09.2015
'errNotReplace' : 'Объект "$1" по этому адресу уже существует и не может быть заменен объектом другого типа.', // new
'errReplace' : 'Невозможно заменить "$1".',
'errSave' : 'Невозможно сохранить "$1".',
'errCopy' : 'Невозможно скопировать "$1".',
'errMove' : 'Невозможно переместить "$1".',
'errCopyInItself' : 'Невозможно скопировать "$1" в самого себя.',
'errRm' : 'Невозможно удалить "$1".',
'errTrash' : 'Невозможно переместить в корзину.', // from v2.1.24 added 30.4.2017
'errRmSrc' : 'Невозможно удалить файлы источника.',
'errExtract' : 'Невозможно извлечь фалы из "$1".',
'errArchive' : 'Невозможно создать архив.',
'errArcType' : 'Неподдерживаемый тип архива.',
'errNoArchive' : 'Файл не является архивом или неподдерживаемый тип архива.',
'errCmdNoSupport' : 'Сервер не поддерживает эту команду.',
'errReplByChild' : 'Невозможно заменить папку "$1" содержащимся в ней объектом.',
'errArcSymlinks' : 'По соображениям безопасности запрещена распаковка архивов, содержащих ссылки (symlinks) или файлы с недопустимыми именами.', // edited 24.06.2012
'errArcMaxSize' : 'Размер файлов в архиве превышает максимально разрешенный.',
'errResize' : 'Не удалось изменить размер "$1".',
'errResizeDegree' : 'Некорректный градус поворота.', // added 7.3.2013
'errResizeRotate' : 'Невозможно повернуть изображение.', // added 7.3.2013
'errResizeSize' : 'Некорректный размер изображения.', // added 7.3.2013
'errResizeNoChange' : 'Размер изображения не изменился.', // added 7.3.2013
'errUsupportType' : 'Неподдерживаемый тип файла.',
'errNotUTF8Content' : 'Файл "$1" содержит текст в кодировке отличной от UTF-8 и не может быть отредактирован.', // added 9.11.2011
'errNetMount' : 'Невозможно подключить "$1".', // added 17.04.2012
'errNetMountNoDriver' : 'Неподдерживаемый протокол.', // added 17.04.2012
'errNetMountFailed' : 'Ошибка монтирования.', // added 17.04.2012
'errNetMountHostReq' : 'Требуется указать хост.', // added 18.04.2012
'errSessionExpires' : 'Сессия была завершена так как превышено время отсутствия активности.',
'errCreatingTempDir' : 'Невозможно создать временную директорию: "$1"',
'errFtpDownloadFile' : 'Невозможно скачать файл с FTP: "$1"',
'errFtpUploadFile' : 'Невозможно загрузить файл на FTP: "$1"',
'errFtpMkdir' : 'Невозможно создать директорию на FTP: "$1"',
'errArchiveExec' : 'Ошибка при выполнении архивации: "$1"',
'errExtractExec' : 'Ошибка при выполнении распаковки: "$1"',
'errNetUnMount' : 'Невозможно отключить', // from v2.1 added 30.04.2012
'errConvUTF8' : 'Не конвертируется в UTF-8', // from v2.1 added 08.04.2014
'errFolderUpload' : 'Если вы хотите загружать папки, попробуйте Google Chrome.', // from v2.1 added 26.6.2015
'errSearchTimeout' : 'Превышено время ожидания при поиске "$1". Результаты поиска частичные.', // from v2.1 added 12.1.2016
'errReauthRequire' : 'Требуется повторная авторизация.', // from v2.1.10 added 24.3.2016
'errMaxTargets' : 'Максимальное число выбираемых файлов: $1.', // from v2.1.17 added 17.10.2016
'errRestore' : 'Невозможно восстановить из корзины. Не удалось определить путь для восстановления.', // from v2.1.24 added 3.5.2017
'errEditorNotFound' : 'Не найден редактор для этого типа файлов.', // from v2.1.25 added 23.5.2017
'errServerError' : 'Возникла ошибка на стороне сервера.', // from v2.1.25 added 16.6.2017
'errEmpty' : 'Невозможно очистить папку "$1".', // from v2.1.25 added 22.6.2017
'moreErrors' : 'Еще ошибок: $1', // from v2.1.44 added 9.12.2018
'errMaxMkdirs' : 'Вы можете создать за один раз папок: $1.', // from v2.1.58 added 20.6.2021
/******************************* commands names ********************************/
'cmdarchive' : 'Создать архив',
'cmdback' : 'Назад',
'cmdcopy' : 'Копировать',
'cmdcut' : 'Вырезать',
'cmddownload' : 'Скачать',
'cmdduplicate' : 'Сделать копию',
'cmdedit' : 'Редактировать файл',
'cmdextract' : 'Распаковать архив',
'cmdforward' : 'Вперед',
'cmdgetfile' : 'Выбрать файлы',
'cmdhelp' : 'О программе',
'cmdhome' : 'Домой',
'cmdinfo' : 'Свойства',
'cmdmkdir' : 'Новая папка',
'cmdmkdirin' : 'В новую папку', // from v2.1.7 added 19.2.2016
'cmdmkfile' : 'Новый файл',
'cmdopen' : 'Открыть',
'cmdpaste' : 'Вставить',
'cmdquicklook' : 'Быстрый просмотр',
'cmdreload' : 'Обновить',
'cmdrename' : 'Переименовать',
'cmdrm' : 'Удалить',
'cmdtrash' : 'Переместить в корзину', //from v2.1.24 added 29.4.2017
'cmdrestore' : 'Восстановить', //from v2.1.24 added 3.5.2017
'cmdsearch' : 'Поиск файлов',
'cmdup' : 'Наверх',
'cmdupload' : 'Загрузить файлы',
'cmdview' : 'Вид',
'cmdresize' : 'Изменить размер и повернуть',
'cmdsort' : 'Сортировать',
'cmdnetmount' : 'Подключить сетевой раздел', // added 18.04.2012
'cmdnetunmount': 'Отключить', // from v2.1 added 30.04.2012
'cmdplaces' : 'В избранное', // added 28.12.2014
'cmdchmod' : 'Изменить права доступа', // from v2.1 added 20.6.2015
'cmdopendir' : 'Открыть папку', // from v2.1 added 13.1.2016
'cmdcolwidth' : 'Сбросить ширину колонок', // from v2.1.13 added 12.06.2016
'cmdfullscreen': 'Полный экран', // from v2.1.15 added 03.08.2016
'cmdmove' : 'Переместить', // from v2.1.15 added 21.08.2016
'cmdempty' : 'Очистить папку', // from v2.1.25 added 22.06.2017
'cmdundo' : 'Отменить', // from v2.1.27 added 31.07.2017
'cmdredo' : 'Вернуть', // from v2.1.27 added 31.07.2017
'cmdpreference': 'Предпочтения', // from v2.1.27 added 03.08.2017
'cmdselectall' : 'Выбрать все', // from v2.1.28 added 15.08.2017
'cmdselectnone': 'Отменить выбор', // from v2.1.28 added 15.08.2017
'cmdselectinvert': 'Инвертировать выбор', // from v2.1.28 added 15.08.2017
'cmdopennew' : 'Открыть в новом окне', // from v2.1.38 added 3.4.2018
'cmdhide' : 'Скрыть (персонально)', // from v2.1.41 added 24.7.2018
/*********************************** buttons ***********************************/
'btnClose' : 'Закрыть',
'btnSave' : 'Сохранить',
'btnRm' : 'Удалить',
'btnApply' : 'Применить',
'btnCancel' : 'Отмена',
'btnNo' : 'Нет',
'btnYes' : 'Да',
'btnMount' : 'Подключить', // added 18.04.2012
'btnApprove': 'Перейти в $1 и применить', // from v2.1 added 26.04.2012
'btnUnmount': 'Отключить', // from v2.1 added 30.04.2012
'btnConv' : 'Конвертировать', // from v2.1 added 08.04.2014
'btnCwd' : 'Здесь', // from v2.1 added 22.5.2015
'btnVolume' : 'Раздел', // from v2.1 added 22.5.2015
'btnAll' : 'Все', // from v2.1 added 22.5.2015
'btnMime' : 'MIME тип', // from v2.1 added 22.5.2015
'btnFileName':'Имя файла', // from v2.1 added 22.5.2015
'btnSaveClose': 'Сохранить и закрыть', // from v2.1 added 12.6.2015
'btnBackup' : 'Резервная копия', // fromv2.1 added 28.11.2015
'btnRename' : 'Переименовать', // from v2.1.24 added 6.4.2017
'btnRenameAll' : 'Переименовать (все)', // from v2.1.24 added 6.4.2017
'btnPrevious' : 'Пред. ($1/$2)', // from v2.1.24 added 11.5.2017
'btnNext' : 'След. ($1/$2)', // from v2.1.24 added 11.5.2017
'btnSaveAs' : 'Сохранить как', // from v2.1.25 added 24.5.2017
/******************************** notifications ********************************/
'ntfopen' : 'Открыть папку',
'ntffile' : 'Открыть файл',
'ntfreload' : 'Обновить текущую папку',
'ntfmkdir' : 'Создание папки',
'ntfmkfile' : 'Создание файлов',
'ntfrm' : 'Удалить файлы',
'ntfcopy' : 'Скопировать файлы',
'ntfmove' : 'Переместить файлы',
'ntfprepare' : 'Подготовка к копированию файлов',
'ntfrename' : 'Переименовать файлы',
'ntfupload' : 'Загрузка файлов',
'ntfdownload' : 'Скачивание файлов',
'ntfsave' : 'Сохранить файлы',
'ntfarchive' : 'Создание архива',
'ntfextract' : 'Распаковка архива',
'ntfsearch' : 'Поиск файлов',
'ntfresize' : 'Изменение размеров изображений',
'ntfsmth' : 'Занят важным делом',
'ntfloadimg' : 'Загрузка изображения',
'ntfnetmount' : 'Подключение сетевого диска', // added 18.04.2012
'ntfnetunmount': 'Отключение сетевого диска', // from v2.1 added 30.04.2012
'ntfdim' : 'Получение размеров изображения', // added 20.05.2013
'ntfreaddir' : 'Чтение информации о папке', // from v2.1 added 01.07.2013
'ntfurl' : 'Получение URL ссылки', // from v2.1 added 11.03.2014
'ntfchmod' : 'Изменение прав доступа к файлу', // from v2.1 added 20.6.2015
'ntfpreupload': 'Проверка измени загруженного файла', // from v2.1 added 31.11.2015
'ntfzipdl' : 'Создание файла для скачки', // from v2.1.7 added 23.1.2016
'ntfparents' : 'Получение информации о пути', // from v2.1.17 added 2.11.2016
'ntfchunkmerge': 'Обработка загруженного файла', // from v2.1.17 added 2.11.2016
'ntftrash' : 'Перемещение в корзину', // from v2.1.24 added 2.5.2017
'ntfrestore' : 'Восстановление из корзины', // from v2.1.24 added 3.5.2017
'ntfchkdir' : 'Проверка папки назначения', // from v2.1.24 added 3.5.2017
'ntfundo' : 'Отмена предыдущей операции', // from v2.1.27 added 31.07.2017
'ntfredo' : 'Восстановление предыдущей операции', // from v2.1.27 added 31.07.2017
'ntfchkcontent' : 'Проверка содержимого', // from v2.1.41 added 3.8.2018
/*********************************** volumes *********************************/
'volume_Trash' : 'Корзина', //from v2.1.24 added 29.4.2017
/************************************ dates **********************************/
'dateUnknown' : 'неизвестно',
'Today' : 'Сегодня',
'Yesterday' : 'Вчера',
'msJan' : 'Янв',
'msFeb' : 'Фев',
'msMar' : 'Мар',
'msApr' : 'Апр',
'msMay' : 'Май',
'msJun' : 'Июн',
'msJul' : 'Июл',
'msAug' : 'Авг',
'msSep' : 'Сен',
'msOct' : 'Окт',
'msNov' : 'Ноя',
'msDec' : 'Дек',
'January' : 'Январь',
'February' : 'Февраль',
'March' : 'Март',
'April' : 'Апрель',
'May' : 'Май',
'June' : 'Июнь',
'July' : 'Июль',
'August' : 'Август',
'September' : 'Сентябрь',
'October' : 'Октябрь',
'November' : 'Ноябрь',
'December' : 'Декабрь',
'Sunday' : 'Воскресенье',
'Monday' : 'Понедельник',
'Tuesday' : 'Вторник',
'Wednesday' : 'Среда',
'Thursday' : 'Четверг',
'Friday' : 'Пятница',
'Saturday' : 'Суббота',
'Sun' : 'Вск',
'Mon' : 'Пнд',
'Tue' : 'Втр',
'Wed' : 'Срд',
'Thu' : 'Чтв',
'Fri' : 'Птн',
'Sat' : 'Сбт',
/******************************** sort variants ********************************/
'sortname' : 'по имени',
'sortkind' : 'по типу',
'sortsize' : 'по размеру',
'sortdate' : 'по дате',
'sortFoldersFirst' : 'Папки в начале',
'sortperm' : 'по разрешениям', // from v2.1.13 added 13.06.2016
'sortmode' : 'по режиму', // from v2.1.13 added 13.06.2016
'sortowner' : 'по владельцу', // from v2.1.13 added 13.06.2016
'sortgroup' : 'по группе', // from v2.1.13 added 13.06.2016
'sortAlsoTreeview' : 'Также и дерево каталогов', // from v2.1.15 added 01.08.2016
/********************************** new items **********************************/
'untitled file.txt' : 'НовыйФайл.txt', // added 10.11.2015
'untitled folder' : 'НоваяПапка', // added 10.11.2015
'Archive' : 'НовыйАрхив', // from v2.1 added 10.11.2015
'untitled file' : 'НовыйФайл.$1', // from v2.1.41 added 6.8.2018
'extentionfile' : '$1 Файл', // from v2.1.41 added 6.8.2018
'extentiontype' : '$1: $2', // from v2.1.43 added 17.10.2018
/********************************** messages **********************************/
'confirmReq' : 'Необходимо подтверждение',
'confirmRm' : 'Вы уверены, что хотите удалить файлы?
Действие необратимо!',
'confirmRepl' : 'Заменить старый файл новым?',
'confirmRest' : 'Заменить существующий файл файлом из корзины?', // fromv2.1.24 added 5.5.2017
'confirmConvUTF8' : 'Не UTF-8
Сконвертировать в UTF-8?
Данные станут UTF-8 при сохранении после конвертации.', // from v2.1 added 08.04.2014
'confirmNonUTF8' : 'Невозможно определить кодировку файла. Необходима предварительная конвертация файла в UTF-8 для дальнейшего редактирования.
Выберите кодировку файла.', // from v2.1.19 added 28.11.2016
'confirmNotSave' : 'Произошли изменения.
Если не сохраните изменения, то потеряете их.', // from v2.1 added 15.7.2015
'confirmTrash' : 'Вы уверены, что хотите переместить файлы в корзину?', //from v2.1.24 added 29.4.2017
'confirmMove' : 'Вы уверены, что хотите переместить файлы в "$1"?', //from v2.1.50 added 27.7.2019
'apllyAll' : 'Применить для всех',
'name' : 'Имя',
'size' : 'Размер',
'perms' : 'Доступ',
'modify' : 'Изменен',
'kind' : 'Тип',
'read' : 'чтение',
'write' : 'запись',
'noaccess' : 'нет доступа',
'and' : 'и',
'unknown' : 'неизвестно',
'selectall' : 'Выбрать все файлы',
'selectfiles' : 'Выбрать файл(ы)',
'selectffile' : 'Выбрать первый файл',
'selectlfile' : 'Выбрать последний файл',
'viewlist' : 'В виде списка',
'viewicons' : 'В виде иконок',
'viewSmall' : 'Маленькие иконки', // from v2.1.39 added 22.5.2018
'viewMedium' : 'Средние иконки', // from v2.1.39 added 22.5.2018
'viewLarge' : 'Большие иконки', // from v2.1.39 added 22.5.2018
'viewExtraLarge' : 'Очень большие иконки', // from v2.1.39 added 22.5.2018
'places' : 'Избранное',
'calc' : 'Вычислить',
'path' : 'Путь',
'aliasfor' : 'Указывает на',
'locked' : 'Защита',
'dim' : 'Размеры',
'files' : 'Файлы',
'folders' : 'Папки',
'items' : 'Объекты',
'yes' : 'да',
'no' : 'нет',
'link' : 'Ссылка',
'searcresult' : 'Результаты поиска',
'selected' : 'выбрано',
'about' : 'О программе',
'shortcuts' : 'Горячие клавиши',
'help' : 'Помощь',
'webfm' : 'Файловый менеджер для Web',
'ver' : 'Версия',
'protocolver' : 'версия протокола',
'homepage' : 'Сайт проекта',
'docs' : 'Документация',
'github' : 'Форкните на GitHub',
'twitter' : 'Следите в Twitter',
'facebook' : 'Присоединяйтесь на Facebook',
'team' : 'Команда',
'chiefdev' : 'ведущий разработчик',
'developer' : 'разработчик',
'contributor' : 'участник',
'maintainer' : 'сопровождение проекта',
'translator' : 'переводчик',
'icons' : 'Иконки',
'dontforget' : 'и не забудьте взять своё полотенце',
'shortcutsof' : 'Горячие клавиши отключены',
'dropFiles' : 'Перетащите файлы сюда',
'or' : 'или',
'selectForUpload' : 'Выбрать файлы для загрузки',
'moveFiles' : 'Переместить файлы',
'copyFiles' : 'Скопировать файлы',
'restoreFiles' : 'Восстановить файлы', // from v2.1.24 added 5.5.2017
'rmFromPlaces' : 'Удалить из избранного',
'aspectRatio' : 'Соотношение сторон',
'scale' : 'Масштаб',
'width' : 'Ширина',
'height' : 'Высота',
'resize' : 'Изменить размер',
'crop' : 'Обрезать',
'rotate' : 'Повернуть',
'rotate-cw' : 'Повернуть на 90 градусов по часовой стрелке',
'rotate-ccw' : 'Повернуть на 90 градусов против часовой стрелке',
'degree' : '°',
'netMountDialogTitle' : 'Подключить сетевой диск', // added 18.04.2012
'protocol' : 'Протокол', // added 18.04.2012
'host' : 'Хост', // added 18.04.2012
'port' : 'Порт', // added 18.04.2012
'user' : 'Пользователь', // added 18.04.2012
'pass' : 'Пароль', // added 18.04.2012
'confirmUnmount' : 'Вы хотите отключить $1?', // from v2.1 added 30.04.2012
'dropFilesBrowser': 'Перетащите или вставьте файлы из браузера', // from v2.1 added 30.05.2012
'dropPasteFiles' : 'Перетащите или вставьте файлы и ссылки сюда', // from v2.1 added 07.04.2014
'encoding' : 'Кодировка', // from v2.1 added 19.12.2014
'locale' : 'Локаль', // from v2.1 added 19.12.2014
'searchTarget' : 'Цель: $1', // from v2.1 added 22.5.2015
'searchMime' : 'Поиск по введенному MIME типу', // from v2.1 added 22.5.2015
'owner' : 'Владелец', // from v2.1 added 20.6.2015
'group' : 'Группа', // from v2.1 added 20.6.2015
'other' : 'Остальные', // from v2.1 added 20.6.2015
'execute' : 'Исполнить', // from v2.1 added 20.6.2015
'perm' : 'Разрешение', // from v2.1 added 20.6.2015
'mode' : 'Режим', // from v2.1 added 20.6.2015
'emptyFolder' : 'Папка пуста', // from v2.1.6 added 30.12.2015
'emptyFolderDrop' : 'Папка пуста\\A Перетащите чтобы добавить', // from v2.1.6 added 30.12.2015
'emptyFolderLTap' : 'Папка пуста\\A Долгое нажатие чтобы добавить', // from v2.1.6 added 30.12.2015
'quality' : 'Качество', // from v2.1.6 added 5.1.2016
'autoSync' : 'Авто синхронизация', // from v2.1.6 added 10.1.2016
'moveUp' : 'Передвинуть вверх', // from v2.1.6 added 18.1.2016
'getLink' : 'Получить URL ссылку', // from v2.1.7 added 9.2.2016
'selectedItems' : 'Выбранные объекты ($1)', // from v2.1.7 added 2.19.2016
'folderId' : 'ID папки', // from v2.1.10 added 3.25.2016
'offlineAccess' : 'Позволить автономный доступ', // from v2.1.10 added 3.25.2016
'reAuth' : 'Авторизоваться повторно', // from v2.1.10 added 3.25.2016
'nowLoading' : 'Загружается...', // from v2.1.12 added 4.26.2016
'openMulti' : 'Открыть несколько файлов', // from v2.1.12 added 5.14.2016
'openMultiConfirm': 'Вы пытаетесь открыть $1 файл(а/ов). Вы уверены, что хотите открыть их в браузере?', // from v2.1.12 added 5.14.2016
'emptySearch' : 'Ничего не найдено', // from v2.1.12 added 5.16.2016
'editingFile' : 'Это редактируемый файл.', // from v2.1.13 added 6.3.2016
'hasSelected' : 'Вы выбрали $1 файл(-ов).', // from v2.1.13 added 6.3.2016
'hasClipboard' : 'У вас $1 файл(-ов) в буфере обмена.', // from v2.1.13 added 6.3.2016
'incSearchOnly' : 'Инкрементный поиск возможен только из текущего вида.', // from v2.1.13 added 6.30.2016
'reinstate' : 'Восстановить', // from v2.1.15 added 3.8.2016
'complete' : '$1 завершен', // from v2.1.15 added 21.8.2016
'contextmenu' : 'Контекстное меню', // from v2.1.15 added 9.9.2016
'pageTurning' : 'Переключение страницы', // from v2.1.15 added 10.9.2016
'volumeRoots' : 'Корни томов', // from v2.1.16 added 16.9.2016
'reset' : 'Сбросить', // from v2.1.16 added 1.10.2016
'bgcolor' : 'Фоновый цвет', // from v2.1.16 added 1.10.2016
'colorPicker' : 'Выбор цвета', // from v2.1.16 added 1.10.2016
'8pxgrid' : '8px сетка', // from v2.1.16 added 4.10.2016
'enabled' : 'Включено', // from v2.1.16 added 4.10.2016
'disabled' : 'Отключено', // from v2.1.16 added 4.10.2016
'emptyIncSearch' : 'Ничего не найдено в текущем виде.\\AНажмите [Enter] для развертывания цели поиска.', // from v2.1.16 added 5.10.2016
'emptyLetSearch' : 'Поиск по первому символу не дал результатов в текущем виде.', // from v2.1.23 added 24.3.2017
'textLabel' : 'Текстовая метка', // from v2.1.17 added 13.10.2016
'minsLeft' : '$1 минут осталось', // from v2.1.17 added 13.11.2016
'openAsEncoding' : 'Переоткрыть с выбранной кодировкой', // from v2.1.19 added 2.12.2016
'saveAsEncoding' : 'Сохранить с выбранной кодировкой', // from v2.1.19 added 2.12.2016
'selectFolder' : 'Выбрать папку', // from v2.1.20 added 13.12.2016
'firstLetterSearch': 'Поиск по первому символу', // from v2.1.23 added 24.3.2017
'presets' : 'Пресеты', // from v2.1.25 added 26.5.2017
'tooManyToTrash' : 'Слишком много файлов для перемещения в корзину.', // from v2.1.25 added 9.6.2017
'TextArea' : 'Текстовая область', // from v2.1.25 added 14.6.2017
'folderToEmpty' : 'Очистить папку "$1".', // from v2.1.25 added 22.6.2017
'filderIsEmpty' : 'Нет файлов в паке "$1".', // from v2.1.25 added 22.6.2017
'preference' : 'Настройки', // from v2.1.26 added 28.6.2017
'language' : 'Язык', // from v2.1.26 added 28.6.2017
'clearBrowserData': 'Сбросить настройки для этого браузера', // from v2.1.26 added 28.6.2017
'toolbarPref' : 'Настройки панели', // from v2.1.27 added 2.8.2017
'charsLeft' : '... еще символов: $1.', // from v2.1.29 added 30.8.2017
'linesLeft' : '... еще строк: $1.', // from v2.1.52 added 16.1.2020
'sum' : 'Общий размер', // from v2.1.29 added 28.9.2017
'roughFileSize' : 'Приблизительный размер файла', // from v2.1.30 added 2.11.2017
'autoFocusDialog' : 'Фокус на элементе диалога при наведении мыши', // from v2.1.30 added 2.11.2017
'select' : 'Выбрать', // from v2.1.30 added 23.11.2017
'selectAction' : 'Действие при выборе файла', // from v2.1.30 added 23.11.2017
'useStoredEditor' : 'Открывать в редакторе, выбранном в прошлый раз', // from v2.1.30 added 23.11.2017
'selectinvert' : 'Выбрать элементы с инвертированием', // from v2.1.30 added 25.11.2017
'renameMultiple' : 'Переименовать выбранные элементы ($1 шт.) в $2?
Действие нельзя отменить!', // from v2.1.31 added 4.12.2017
'batchRename' : 'Групповое переименование', // from v2.1.31 added 8.12.2017
'plusNumber' : '+ Число', // from v2.1.31 added 8.12.2017
'asPrefix' : 'Добавить префикс', // from v2.1.31 added 8.12.2017
'asSuffix' : 'Добавить суффикс', // from v2.1.31 added 8.12.2017
'changeExtention' : 'Изменить расширение', // from v2.1.31 added 8.12.2017
'columnPref' : 'Настройки колонок (для просмотра в виде списка)', // from v2.1.32 added 6.2.2018
'reflectOnImmediate' : 'Все изменения будут немедленно отражены в архиве.', // from v2.1.33 added 2.3.2018
'reflectOnUnmount' : 'Изменения не вступят в силу до тех пор, пока вы не размонтируете этот том.', // from v2.1.33 added 2.3.2018
'unmountChildren' : 'Тома, смонтированные на этом томе, также будут размонтированы. Вы хотите отключить его?', // from v2.1.33 added 5.3.2018
'selectionInfo' : 'Свойства', // from v2.1.33 added 7.3.2018
'hashChecker' : 'Алгоритмы для отображения хеш-сумм файлов', // from v2.1.33 added 10.3.2018
'infoItems' : 'Элементы в панели свойств', // from v2.1.38 added 28.3.2018
'pressAgainToExit': 'Нажмите снова для выхода.', // from v2.1.38 added 1.4.2018
'toolbar' : 'Панель', // from v2.1.38 added 4.4.2018
'workspace' : 'Рабочая область', // from v2.1.38 added 4.4.2018
'dialog' : 'Диалог', // from v2.1.38 added 4.4.2018
'all' : 'Все', // from v2.1.38 added 4.4.2018
'iconSize' : 'Размер иконок (В виде иконок)', // from v2.1.39 added 7.5.2018
'editorMaximized' : 'Открывать редактор в развернутом виде', // from v2.1.40 added 30.6.2018
'editorConvNoApi' : 'Так как конвертация с помощью API недоступно, произведите конвертацию на веб-сайте.', //from v2.1.40 added 8.7.2018
'editorConvNeedUpload' : 'После конвертации вы должны загрузить скачанный файл, чтобы сохранить его.', //from v2.1.40 added 8.7.2018
'convertOn' : 'Конвертировать на сайте $1', // from v2.1.40 added 10.7.2018
'integrations' : 'Интеграции', // from v2.1.40 added 11.7.2018
'integrationWith' : 'Менеджер elFinder интегрирован со следующими внешними сервисами. Ознакомьтесь с правилами пользования, политиками безопасности и др. перед их использованием.', // from v2.1.40 added 11.7.2018
'showHidden' : 'Показать скрытые элементы', // from v2.1.41 added 24.7.2018
'hideHidden' : 'Скрыть скрытые элементы', // from v2.1.41 added 24.7.2018
'toggleHidden' : 'Показать/скрыть скрытые элементы', // from v2.1.41 added 24.7.2018
'makefileTypes' : 'Типы файлов в меню "Новый файл"', // from v2.1.41 added 7.8.2018
'typeOfTextfile' : 'Тип текстового файла', // from v2.1.41 added 7.8.2018
'add' : 'Добавить', // from v2.1.41 added 7.8.2018
'theme' : 'Тема', // from v2.1.43 added 19.10.2018
'default' : 'По умолчанию', // from v2.1.43 added 19.10.2018
'description' : 'Описание', // from v2.1.43 added 19.10.2018
'website' : 'Веб-сайт', // from v2.1.43 added 19.10.2018
'author' : 'Автор', // from v2.1.43 added 19.10.2018
'email' : 'Email', // from v2.1.43 added 19.10.2018
'license' : 'Лицензия', // from v2.1.43 added 19.10.2018
'exportToSave' : 'Невозможно сохранить файл. Чтобы не потерять изменения, экспортируйте их на свой ПК.', // from v2.1.44 added 1.12.2018
'dblclickToSelect': 'Двойной клик по файлу для его выбора.', // from v2.1.47 added 22.1.2019
'useFullscreen' : 'Использовать полноэкранный режим', // from v2.1.47 added 19.2.2019
/********************************** mimetypes **********************************/
'kindUnknown' : 'Неизвестный',
'kindRoot' : 'Корень тома', // from v2.1.16 added 16.10.2016
'kindFolder' : 'Папка',
'kindSelects' : 'Выбор', // from v2.1.29 added 29.8.2017
'kindAlias' : 'Ссылка',
'kindAliasBroken' : 'Битая ссылка',
// applications
'kindApp' : 'Приложение',
'kindPostscript' : 'Документ Postscript',
'kindMsOffice' : 'Документ Microsoft Office',
'kindMsWord' : 'Документ Microsoft Word',
'kindMsExcel' : 'Документ Microsoft Excel',
'kindMsPP' : 'Презентация Microsoft Powerpoint',
'kindOO' : 'Документ Open Office',
'kindAppFlash' : 'Приложение Flash',
'kindPDF' : 'Документ PDF',
'kindTorrent' : 'Файл Bittorrent',
'kind7z' : 'Архив 7z',
'kindTAR' : 'Архив TAR',
'kindGZIP' : 'Архив GZIP',
'kindBZIP' : 'Архив BZIP',
'kindXZ' : 'Архив XZ',
'kindZIP' : 'Архив ZIP',
'kindRAR' : 'Архив RAR',
'kindJAR' : 'Файл Java JAR',
'kindTTF' : 'Шрифт True Type',
'kindOTF' : 'Шрифт Open Type',
'kindRPM' : 'Пакет RPM',
// texts
'kindText' : 'Текстовый документ',
'kindTextPlain' : 'Простой текст',
'kindPHP' : 'Исходник PHP',
'kindCSS' : 'Таблицы стилей CSS',
'kindHTML' : 'Документ HTML',
'kindJS' : 'Исходник Javascript',
'kindRTF' : 'Rich Text Format',
'kindC' : 'Исходник C',
'kindCHeader' : 'Заголовочный файл C',
'kindCPP' : 'Исходник C++',
'kindCPPHeader' : 'Заголовочный файл C++',
'kindShell' : 'Скрипт Unix shell',
'kindPython' : 'Исходник Python',
'kindJava' : 'Исходник Java',
'kindRuby' : 'Исходник Ruby',
'kindPerl' : 'Исходник Perl',
'kindSQL' : 'Исходник SQL',
'kindXML' : 'Документ XML',
'kindAWK' : 'Исходник AWK',
'kindCSV' : 'Текст с разделителями',
'kindDOCBOOK' : 'Документ Docbook XML',
'kindMarkdown' : 'Текст Markdown', // added 20.7.2015
// images
'kindImage' : 'Изображение',
'kindBMP' : 'Изображение BMP',
'kindJPEG' : 'Изображение JPEG',
'kindGIF' : 'Изображение GIF',
'kindPNG' : 'Изображение PNG',
'kindTIFF' : 'Изображение TIFF',
'kindTGA' : 'Изображение TGA',
'kindPSD' : 'Изображение Adobe Photoshop',
'kindXBITMAP' : 'Изображение X bitmap',
'kindPXM' : 'Изображение Pixelmator',
// media
'kindAudio' : 'Аудио файл',
'kindAudioMPEG' : 'Аудио MPEG',
'kindAudioMPEG4' : 'Аудио MPEG-4',
'kindAudioMIDI' : 'Аудио MIDI',
'kindAudioOGG' : 'Аудио Ogg Vorbis',
'kindAudioWAV' : 'Аудио WAV',
'AudioPlaylist' : 'Плейлист MP3',
'kindVideo' : 'Видео файл',
'kindVideoDV' : 'Видео DV',
'kindVideoMPEG' : 'Видео MPEG',
'kindVideoMPEG4' : 'Видео MPEG-4',
'kindVideoAVI' : 'Видео AVI',
'kindVideoMOV' : 'Видео Quick Time',
'kindVideoWM' : 'Видео Windows Media',
'kindVideoFlash' : 'Видео Flash',
'kindVideoMKV' : 'Видео Matroska',
'kindVideoOGG' : 'Видео Ogg'
}
};
}));
/**
* WooCommerce Widget Functions
*
* Widget related functions and widget registration.
*
* @package WooCommerce\Functions
* @version 2.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Include widget classes.
require_once dirname( __FILE__ ) . '/abstracts/abstract-wc-widget.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-cart.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-layered-nav-filters.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-layered-nav.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-price-filter.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-product-categories.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-product-search.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-product-tag-cloud.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-products.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-rating-filter.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-recent-reviews.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-recently-viewed.php';
require_once dirname( __FILE__ ) . '/widgets/class-wc-widget-top-rated-products.php';
/**
* Register Widgets.
*
* @since 2.3.0
*/
function wc_register_widgets() {
register_widget( 'WC_Widget_Cart' );
register_widget( 'WC_Widget_Layered_Nav_Filters' );
register_widget( 'WC_Widget_Layered_Nav' );
register_widget( 'WC_Widget_Price_Filter' );
register_widget( 'WC_Widget_Product_Categories' );
register_widget( 'WC_Widget_Product_Search' );
register_widget( 'WC_Widget_Product_Tag_Cloud' );
register_widget( 'WC_Widget_Products' );
register_widget( 'WC_Widget_Recently_Viewed' );
if ( 'yes' === get_option( 'woocommerce_enable_reviews', 'yes' ) ) {
register_widget( 'WC_Widget_Top_Rated_Products' );
register_widget( 'WC_Widget_Recent_Reviews' );
register_widget( 'WC_Widget_Rating_Filter' );
}
}
add_action( 'widgets_init', 'wc_register_widgets' );/**
* WooCommerce Cart Functions
*
* Functions for cart specific things.
*
* @package WooCommerce\Functions
* @version 2.5.0
*/
use Automattic\Jetpack\Constants;
use Automattic\WooCommerce\StoreApi\Utilities\LocalPickupUtils;
defined( 'ABSPATH' ) || exit;
/**
* Prevent password protected products being added to the cart.
*
* @param bool $passed Validation.
* @param int $product_id Product ID.
* @return bool
*/
function wc_protected_product_add_to_cart( $passed, $product_id ) {
if ( post_password_required( $product_id ) ) {
$passed = false;
wc_add_notice( __( 'This product is protected and cannot be purchased.', 'woocommerce' ), 'error' );
}
return $passed;
}
add_filter( 'woocommerce_add_to_cart_validation', 'wc_protected_product_add_to_cart', 10, 2 );
/**
* Clears the cart session when called.
*/
function wc_empty_cart() {
if ( ! isset( WC()->cart ) || '' === WC()->cart ) {
WC()->cart = new WC_Cart();
}
WC()->cart->empty_cart( false );
}
/**
* Load the persistent cart.
*
* @param string $user_login User login.
* @param WP_User $user User data.
* @deprecated 2.3
*/
function wc_load_persistent_cart( $user_login, $user ) {
if ( ! $user || ! apply_filters( 'woocommerce_persistent_cart_enabled', true ) ) {
return;
}
$saved_cart = get_user_meta( $user->ID, '_woocommerce_persistent_cart_' . get_current_blog_id(), true );
if ( ! $saved_cart ) {
return;
}
$cart = WC()->session->cart;
if ( empty( $cart ) || ! is_array( $cart ) || 0 === count( $cart ) ) {
WC()->session->cart = $saved_cart['cart'];
}
}
/**
* Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.
*
* Do not use for redirects, use {@see wp_get_referer()} instead.
*
* @since 2.6.1
* @return string|false Referer URL on success, false on failure.
*/
function wc_get_raw_referer() {
if ( function_exists( 'wp_get_raw_referer' ) ) {
return wp_get_raw_referer();
}
if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) { // WPCS: input var ok, CSRF ok.
return wp_unslash( $_REQUEST['_wp_http_referer'] ); // WPCS: input var ok, CSRF ok, sanitization ok.
} elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) { // WPCS: input var ok, CSRF ok.
return wp_unslash( $_SERVER['HTTP_REFERER'] ); // WPCS: input var ok, CSRF ok, sanitization ok.
}
return false;
}
/**
* Add to cart messages.
*
* @param int|array $products Product ID list or single product ID.
* @param bool $show_qty Should quantities be shown? Added in 2.6.0.
* @param bool $return Return message rather than add it.
*
* @return mixed
*/
function wc_add_to_cart_message( $products, $show_qty = false, $return = false ) {
$titles = array();
$count = 0;
if ( ! is_array( $products ) ) {
$products = array( $products => 1 );
$show_qty = false;
}
if ( ! $show_qty ) {
$products = array_fill_keys( array_keys( $products ), 1 );
}
$product_id = null;
foreach ( $products as $product_id => $qty ) {
/* translators: %s: product name */
$titles[] = apply_filters( 'woocommerce_add_to_cart_qty_html', ( $qty > 1 ? absint( $qty ) . ' × ' : '' ), $product_id ) . apply_filters( 'woocommerce_add_to_cart_item_name_in_quotes', sprintf( _x( '“%s”', 'Item name in quotes', 'woocommerce' ), strip_tags( get_the_title( $product_id ) ) ), $product_id );
$count += $qty;
}
$titles = array_filter( $titles );
/* translators: %s: product name */
$added_text = sprintf( _n( '%s has been added to your cart.', '%s have been added to your cart.', $count, 'woocommerce' ), wc_format_list_of_items( $titles ) );
// Output success messages.
$wp_button_class = wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '';
if ( 'yes' === get_option( 'woocommerce_cart_redirect_after_add' ) ) {
$return_to = apply_filters( 'woocommerce_continue_shopping_redirect', wc_get_raw_referer() ? wp_validate_redirect( wc_get_raw_referer(), false ) : wc_get_page_permalink( 'shop' ) );
$message = sprintf( '%s %s', esc_url( $return_to ), esc_attr( $wp_button_class ), esc_html__( 'Continue shopping', 'woocommerce' ), esc_html( $added_text ) );
} else {
$message = sprintf( '%s %s', esc_url( wc_get_cart_url() ), esc_attr( $wp_button_class ), esc_html__( 'View cart', 'woocommerce' ), esc_html( $added_text ) );
}
if ( has_filter( 'wc_add_to_cart_message' ) ) {
wc_deprecated_function( 'The wc_add_to_cart_message filter', '3.0', 'wc_add_to_cart_message_html' );
$message = apply_filters( 'wc_add_to_cart_message', $message, $product_id );
}
$message = apply_filters( 'wc_add_to_cart_message_html', $message, $products, $show_qty );
if ( $return ) {
return $message;
} else {
wc_add_notice( $message, apply_filters( 'woocommerce_add_to_cart_notice_type', 'success' ) );
}
}
/**
* Comma separate a list of item names, and replace final comma with 'and'.
*
* @param array $items Cart items.
* @return string
*/
function wc_format_list_of_items( $items ) {
$item_string = '';
foreach ( $items as $key => $item ) {
$item_string .= $item;
if ( count( $items ) === $key + 2 ) {
$item_string .= ' ' . __( 'and', 'woocommerce' ) . ' ';
} elseif ( count( $items ) !== $key + 1 ) {
$item_string .= ', ';
}
}
return $item_string;
}
/**
* Clear cart after payment.
*/
function wc_clear_cart_after_payment() {
global $wp;
if ( ! empty( $wp->query_vars['order-received'] ) ) {
$order_id = absint( $wp->query_vars['order-received'] );
$order_key = isset( $_GET['key'] ) ? wc_clean( wp_unslash( $_GET['key'] ) ) : ''; // WPCS: input var ok, CSRF ok.
if ( $order_id > 0 ) {
$order = wc_get_order( $order_id );
if ( $order instanceof WC_Order && hash_equals( $order->get_order_key(), $order_key ) ) {
WC()->cart->empty_cart();
}
}
}
if ( WC()->session->order_awaiting_payment > 0 ) {
$order = wc_get_order( WC()->session->order_awaiting_payment );
if ( $order instanceof WC_Order && $order->get_id() > 0 ) {
// If the order has not failed, or is not pending, the order must have gone through.
if ( ! $order->has_status( array( 'failed', 'pending', 'cancelled' ) ) ) {
WC()->cart->empty_cart();
}
}
}
}
add_action( 'template_redirect', 'wc_clear_cart_after_payment', 20 );
/**
* Get the subtotal.
*/
function wc_cart_totals_subtotal_html() {
echo WC()->cart->get_cart_subtotal(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Get shipping methods.
*/
function wc_cart_totals_shipping_html() {
$packages = WC()->shipping()->get_packages();
$first = true;
foreach ( $packages as $i => $package ) {
$chosen_method = isset( WC()->session->chosen_shipping_methods[ $i ] ) ? WC()->session->chosen_shipping_methods[ $i ] : '';
$product_names = array();
if ( count( $packages ) > 1 ) {
foreach ( $package['contents'] as $item_id => $values ) {
$product_names[ $item_id ] = $values['data']->get_name() . ' ×' . $values['quantity'];
}
$product_names = apply_filters( 'woocommerce_shipping_package_details_array', $product_names, $package );
}
wc_get_template(
'cart/cart-shipping.php',
array(
'package' => $package,
'available_methods' => $package['rates'],
'show_package_details' => count( $packages ) > 1,
'show_shipping_calculator' => is_cart() && apply_filters( 'woocommerce_shipping_show_shipping_calculator', $first, $i, $package ),
'package_details' => implode( ', ', $product_names ),
/* translators: %d: shipping package number */
'package_name' => apply_filters( 'woocommerce_shipping_package_name', ( ( $i + 1 ) > 1 ) ? sprintf( _x( 'Shipping %d', 'shipping packages', 'woocommerce' ), ( $i + 1 ) ) : _x( 'Shipping', 'shipping packages', 'woocommerce' ), $i, $package ),
'index' => $i,
'chosen_method' => $chosen_method,
'formatted_destination' => WC()->countries->get_formatted_address( $package['destination'], ', ' ),
'has_calculated_shipping' => WC()->customer->has_calculated_shipping(),
)
);
$first = false;
}
}
/**
* Get taxes total.
*/
function wc_cart_totals_taxes_total_html() {
echo apply_filters( 'woocommerce_cart_totals_taxes_total_html', wc_price( WC()->cart->get_taxes_total() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Get a coupon label.
*
* @param string|WC_Coupon $coupon Coupon data or code.
* @param bool $echo Echo or return.
*
* @return string
*/
function wc_cart_totals_coupon_label( $coupon, $echo = true ) {
if ( is_string( $coupon ) ) {
$coupon = new WC_Coupon( $coupon );
}
/* translators: %s: coupon code */
$label = apply_filters( 'woocommerce_cart_totals_coupon_label', sprintf( esc_html__( 'Coupon: %s', 'woocommerce' ), $coupon->get_code() ), $coupon );
if ( $echo ) {
echo $label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} else {
return $label;
}
}
/**
* Get coupon display HTML.
*
* @param string|WC_Coupon $coupon Coupon data or code.
*/
function wc_cart_totals_coupon_html( $coupon ) {
if ( is_string( $coupon ) ) {
$coupon = new WC_Coupon( $coupon );
}
$amount = WC()->cart->get_coupon_discount_amount( $coupon->get_code(), WC()->cart->display_cart_ex_tax );
$discount_amount_html = '-' . wc_price( $amount );
if ( $coupon->get_free_shipping() && empty( $amount ) ) {
$discount_amount_html = __( 'Free shipping coupon', 'woocommerce' );
}
$discount_amount_html = apply_filters( 'woocommerce_coupon_discount_amount_html', $discount_amount_html, $coupon );
$coupon_html = $discount_amount_html . ' ' . __( '[Remove]', 'woocommerce' ) . '';
echo wp_kses( apply_filters( 'woocommerce_cart_totals_coupon_html', $coupon_html, $coupon, $discount_amount_html ), array_replace_recursive( wp_kses_allowed_html( 'post' ), array( 'a' => array( 'data-coupon' => true ) ) ) ); // phpcs:ignore PHPCompatibility.PHP.NewFunctions.array_replace_recursiveFound
}
/**
* Get order total html including inc tax if needed.
*/
function wc_cart_totals_order_total_html() {
$value = '' . WC()->cart->get_total() . ' ';
// If prices are tax inclusive, show taxes here.
if ( wc_tax_enabled() && WC()->cart->display_prices_including_tax() ) {
$tax_string_array = array();
$cart_tax_totals = WC()->cart->get_tax_totals();
if ( get_option( 'woocommerce_tax_total_display' ) === 'itemized' ) {
foreach ( $cart_tax_totals as $code => $tax ) {
$tax_string_array[] = sprintf( '%s %s', $tax->formatted_amount, $tax->label );
}
} elseif ( ! empty( $cart_tax_totals ) ) {
$tax_string_array[] = sprintf( '%s %s', wc_price( WC()->cart->get_taxes_total( true, true ) ), WC()->countries->tax_or_vat() );
}
if ( ! empty( $tax_string_array ) ) {
$taxable_address = WC()->customer->get_taxable_address();
if ( WC()->customer->is_customer_outside_base() && ! WC()->customer->has_calculated_shipping() ) {
$country = WC()->countries->estimated_for_prefix( $taxable_address[0] ) . WC()->countries->countries[ $taxable_address[0] ];
/* translators: 1: tax amount 2: country name */
$tax_text = wp_kses_post( sprintf( __( '(includes %1$s estimated for %2$s)', 'woocommerce' ), implode( ', ', $tax_string_array ), $country ) );
} else {
/* translators: %s: tax amount */
$tax_text = wp_kses_post( sprintf( __( '(includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) ) );
}
$value .= '' . $tax_text . '';
}
}
echo apply_filters( 'woocommerce_cart_totals_order_total_html', $value ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Get the fee value.
*
* @param object $fee Fee data.
*/
function wc_cart_totals_fee_html( $fee ) {
$cart_totals_fee_html = WC()->cart->display_prices_including_tax() ? wc_price( $fee->total + $fee->tax ) : wc_price( $fee->total );
echo apply_filters( 'woocommerce_cart_totals_fee_html', $cart_totals_fee_html, $fee ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
/**
* Get a shipping methods full label including price.
*
* @param WC_Shipping_Rate $method Shipping method rate data.
* @return string
*/
function wc_cart_totals_shipping_method_label( $method ) {
$label = $method->get_label();
$has_cost = 0 < $method->cost;
$hide_cost = ! $has_cost && in_array( $method->get_method_id(), array( 'free_shipping', 'local_pickup' ), true );
if ( $has_cost && ! $hide_cost ) {
if ( WC()->cart->display_prices_including_tax() ) {
$label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() );
if ( $method->get_shipping_tax() > 0 && ! wc_prices_include_tax() ) {
$label .= ' ' . WC()->countries->inc_tax_or_vat() . '';
}
} else {
$label .= ': ' . wc_price( $method->cost );
if ( $method->get_shipping_tax() > 0 && wc_prices_include_tax() ) {
$label .= ' ' . WC()->countries->ex_tax_or_vat() . '';
}
}
}
return apply_filters( 'woocommerce_cart_shipping_method_full_label', $label, $method );
}
/**
* Round discount.
*
* @param double $value Amount to round.
* @param int $precision DP to round.
* @return float
*/
function wc_cart_round_discount( $value, $precision ) {
return wc_round_discount( $value, $precision );
}
/**
* Gets chosen shipping method IDs from chosen_shipping_methods session, without instance IDs.
*
* @since 2.6.2
* @return string[]
*/
function wc_get_chosen_shipping_method_ids() {
$method_ids = array();
$chosen_methods = WC()->session->get( 'chosen_shipping_methods', array() );
foreach ( $chosen_methods as $chosen_method ) {
if ( ! is_string( $chosen_method ) ) {
continue;
}
$chosen_method = explode( ':', $chosen_method );
$method_ids[] = current( $chosen_method );
}
return $method_ids;
}
/**
* Get chosen method for package from session.
*
* @since 3.2.0
* @param int $key Key of package.
* @param array $package Package data array.
* @return string|bool Either the chosen method ID or false if nothing is chosen yet.
*/
function wc_get_chosen_shipping_method_for_package( $key, $package ) {
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' );
$chosen_method = isset( $chosen_methods[ $key ] ) ? $chosen_methods[ $key ] : false;
$changed = wc_shipping_methods_have_changed( $key, $package );
// This is deprecated but here for BW compat. TODO: Remove in 4.0.0.
$method_counts = WC()->session->get( 'shipping_method_counts' );
if ( ! empty( $method_counts[ $key ] ) ) {
$method_count = absint( $method_counts[ $key ] );
} else {
$method_count = 0;
}
if ( ! isset( $package['rates'] ) || ! is_array( $package['rates'] ) ) {
$package['rates'] = array();
}
// If not set, not available, or available methods have changed, set to the DEFAULT option.
if ( ! $chosen_method || $changed || ! isset( $package['rates'][ $chosen_method ] ) || count( $package['rates'] ) !== $method_count ) {
$chosen_method = wc_get_default_shipping_method_for_package( $key, $package, $chosen_method );
$chosen_methods[ $key ] = $chosen_method;
$method_counts[ $key ] = count( $package['rates'] );
WC()->session->set( 'chosen_shipping_methods', $chosen_methods );
WC()->session->set( 'shipping_method_counts', $method_counts );
do_action( 'woocommerce_shipping_method_chosen', $chosen_method );
}
return $chosen_method;
}
/**
* Choose the default method for a package.
*
* @since 3.2.0
* @param int $key Key of package.
* @param array $package Package data array.
* @param string $chosen_method Chosen shipping method. e.g. flat_rate:1.
* @return string
*/
function wc_get_default_shipping_method_for_package( $key, $package, $chosen_method ) {
$chosen_method_id = current( explode( ':', $chosen_method ) );
$rate_keys = array_keys( $package['rates'] );
$chosen_method_exists = in_array( $chosen_method, $rate_keys, true );
/**
* If the customer has selected local pickup, keep it selected if it's still in the package. We don't want to auto
* toggle between shipping and pickup even if available shipping methods are changed.
*
* This is important for block based checkout where there is an explicit toggle between shipping and pickup.
*/
$local_pickup_method_ids = LocalPickupUtils::get_local_pickup_method_ids();
$is_local_pickup_chosen = in_array( $chosen_method_id, $local_pickup_method_ids, true );
// Default to the first method in the package. This can be sorted in the backend by the merchant.
$default = current( $rate_keys );
// Default to local pickup if its chosen already.
if ( $chosen_method_exists && $is_local_pickup_chosen ) {
$default = $chosen_method;
} else {
// Check coupons to see if free shipping is available. If it is, we'll use that method as the default.
$coupons = WC()->cart->get_coupons();
foreach ( $coupons as $coupon ) {
if ( $coupon->get_free_shipping() ) {
foreach ( $rate_keys as $rate_key ) {
if ( 0 === stripos( $rate_key, 'free_shipping' ) ) {
$default = $rate_key;
break;
}
}
break;
}
}
}
/**
* Filters the default shipping method for a package.
*
* @since 3.2.0
* @param string $default Default shipping method.
* @param array $rates Shipping rates.
* @param string $chosen_method Chosen method id.
*/
return (string) apply_filters( 'woocommerce_shipping_chosen_method', $default, $package['rates'], $chosen_method );
}
/**
* See if the methods have changed since the last request.
*
* @since 3.2.0
* @param int $key Key of package.
* @param array $package Package data array.
* @return bool
*/
function wc_shipping_methods_have_changed( $key, $package ) {
// Lookup previous methods from session.
$previous_shipping_methods = WC()->session->get( 'previous_shipping_methods' );
// Get new and old rates.
$new_rates = array_keys( $package['rates'] );
$prev_rates = isset( $previous_shipping_methods[ $key ] ) ? $previous_shipping_methods[ $key ] : false;
// Update session.
$previous_shipping_methods[ $key ] = $new_rates;
WC()->session->set( 'previous_shipping_methods', $previous_shipping_methods );
return $new_rates !== $prev_rates;
}
/**
* Gets a hash of important product data that when changed should cause cart items to be invalidated.
*
* The woocommerce_cart_item_data_to_validate filter can be used to add custom properties.
*
* @param WC_Product $product Product object.
* @return string
*/
function wc_get_cart_item_data_hash( $product ) {
return md5(
wp_json_encode(
apply_filters(
'woocommerce_cart_item_data_to_validate',
array(
'type' => $product->get_type(),
'attributes' => 'variation' === $product->get_type() ? $product->get_variation_attributes() : '',
),
$product
)
)
);
}/**
* Template Loader
*
* @package WooCommerce\Classes
*/
defined( 'ABSPATH' ) || exit;
/**
* Template loader class.
*/
class WC_Template_Loader {
/**
* Store the shop page ID.
*
* @var integer
*/
private static $shop_page_id = 0;
/**
* Store whether we're processing a product inside the_content filter.
*
* @var boolean
*/
private static $in_content_filter = false;
/**
* Is WooCommerce support defined?
*
* @var boolean
*/
private static $theme_support = false;
/**
* Hook in methods.
*/
public static function init() {
self::$theme_support = wc_current_theme_supports_woocommerce_or_fse();
self::$shop_page_id = wc_get_page_id( 'shop' );
// Supported themes.
if ( self::$theme_support ) {
add_filter( 'template_include', array( __CLASS__, 'template_loader' ) );
add_filter( 'comments_template', array( __CLASS__, 'comments_template_loader' ) );
// Loads gallery scripts on Product page for FSE themes.
if ( wc_current_theme_is_fse_theme() ) {
self::add_support_for_product_page_gallery();
}
} else {
// Unsupported themes.
add_action( 'template_redirect', array( __CLASS__, 'unsupported_theme_init' ) );
}
}
/**
* Load a template.
*
* Handles template usage so that we can use our own templates instead of the theme's.
*
* Templates are in the 'templates' folder. WooCommerce looks for theme
* overrides in /theme/woocommerce/ by default.
*
* For beginners, it also looks for a woocommerce.php template first. If the user adds
* this to the theme (containing a woocommerce() inside) this will be used for all
* WooCommerce templates.
*
* @param string $template Template to load.
* @return string
*/
public static function template_loader( $template ) {
if ( is_embed() ) {
return $template;
}
$default_file = self::get_template_loader_default_file();
if ( $default_file ) {
/**
* Filter hook to choose which files to find before WooCommerce does it's own logic.
*
* @since 3.0.0
* @var array
*/
$search_files = self::get_template_loader_files( $default_file );
$template = locate_template( $search_files );
if ( ! $template || WC_TEMPLATE_DEBUG_MODE ) {
if ( false !== strpos( $default_file, 'product_cat' ) || false !== strpos( $default_file, 'product_tag' ) ) {
$cs_template = str_replace( '_', '-', $default_file );
$template = WC()->plugin_path() . '/templates/' . $cs_template;
} else {
$template = WC()->plugin_path() . '/templates/' . $default_file;
}
}
}
return $template;
}
/**
* Checks whether a block template for a given taxonomy exists.
*
* **Note:** This checks both the `templates` and `block-templates` directories
* as both conventions should be supported.
*
* @param object $taxonomy Object taxonomy to check.
* @return boolean
*/
private static function taxonomy_has_block_template( $taxonomy ) : bool {
if ( taxonomy_is_product_attribute( $taxonomy->taxonomy ) ) {
$template_name = 'taxonomy-product_attribute';
} else {
$template_name = 'taxonomy-' . $taxonomy->taxonomy;
}
return self::has_block_template( $template_name );
}
/**
* Checks whether a block template with that name exists.
*
* **Note: ** This checks both the `templates` and `block-templates` directories
* as both conventions should be supported.
*
* @since 5.5.0
* @param string $template_name Template to check.
* @return boolean
*/
private static function has_block_template( $template_name ) {
if ( ! $template_name ) {
return false;
}
$has_template = false;
$template_filename = $template_name . '.html';
// Since Gutenberg 12.1.0, the conventions for block templates directories have changed,
// we should check both these possible directories for backwards-compatibility.
$possible_templates_dirs = array( 'templates', 'block-templates' );
// Combine the possible root directory names with either the template directory
// or the stylesheet directory for child themes, getting all possible block templates
// locations combinations.
$filepath = DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template_filename;
$legacy_filepath = DIRECTORY_SEPARATOR . 'block-templates' . DIRECTORY_SEPARATOR . $template_filename;
$possible_paths = array(
get_stylesheet_directory() . $filepath,
get_stylesheet_directory() . $legacy_filepath,
get_template_directory() . $filepath,
get_template_directory() . $legacy_filepath,
);
// Check the first matching one.
foreach ( $possible_paths as $path ) {
if ( is_readable( $path ) ) {
$has_template = true;
break;
}
}
/**
* Filters the value of the result of the block template check.
*
* @since x.x.x
*
* @param boolean $has_template value to be filtered.
* @param string $template_name The name of the template.
*/
return (bool) apply_filters( 'woocommerce_has_block_template', $has_template, $template_name );
}
/**
* Get the default filename for a template except if a block template with
* the same name exists.
*
* @since 3.0.0
* @since 5.5.0 If a block template with the same name exists, return an
* empty string.
* @since 6.3.0 It checks custom product taxonomies
* @return string
*/
private static function get_template_loader_default_file() {
if (
is_singular( 'product' ) &&
! self::has_block_template( 'single-product' )
) {
$default_file = 'single-product.php';
} elseif ( is_product_taxonomy() ) {
$object = get_queried_object();
if ( self::taxonomy_has_block_template( $object ) ) {
$default_file = '';
} else {
if ( taxonomy_is_product_attribute( $object->taxonomy ) ) {
$default_file = 'taxonomy-product-attribute.php';
} elseif ( is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
$default_file = 'taxonomy-' . $object->taxonomy . '.php';
} elseif ( ! self::has_block_template( 'archive-product' ) ) {
$default_file = 'archive-product.php';
} else {
$default_file = '';
}
}
} elseif (
( is_post_type_archive( 'product' ) || is_page( wc_get_page_id( 'shop' ) ) ) &&
! self::has_block_template( 'archive-product' )
) {
$default_file = self::$theme_support ? 'archive-product.php' : '';
} else {
$default_file = '';
}
return $default_file;
}
/**
* Get an array of filenames to search for a given template.
*
* @since 3.0.0
* @param string $default_file The default file name.
* @return string[]
*/
private static function get_template_loader_files( $default_file ) {
$templates = apply_filters( 'woocommerce_template_loader_files', array(), $default_file );
$templates[] = 'woocommerce.php';
if ( is_page_template() ) {
$page_template = get_page_template_slug();
if ( $page_template ) {
$validated_file = validate_file( $page_template );
if ( 0 === $validated_file ) {
$templates[] = $page_template;
} else {
error_log( "WooCommerce: Unable to validate template path: \"$page_template\". Error Code: $validated_file." ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
}
}
}
if ( is_singular( 'product' ) ) {
$object = get_queried_object();
$name_decoded = urldecode( $object->post_name );
if ( $name_decoded !== $object->post_name ) {
$templates[] = "single-product-{$name_decoded}.php";
}
$templates[] = "single-product-{$object->post_name}.php";
}
if ( is_product_taxonomy() ) {
$object = get_queried_object();
$templates[] = 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
$templates[] = 'taxonomy-' . $object->taxonomy . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $object->taxonomy . '.php';
if ( taxonomy_is_product_attribute( $object->taxonomy ) ) {
$templates[] = 'taxonomy-product_attribute.php';
$templates[] = WC()->template_path() . 'taxonomy-product_attribute.php';
$templates[] = $default_file;
}
if ( is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
$cs_taxonomy = str_replace( '_', '-', $object->taxonomy );
$cs_default = str_replace( '_', '-', $default_file );
$templates[] = 'taxonomy-' . $object->taxonomy . '-' . $object->slug . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $cs_taxonomy . '-' . $object->slug . '.php';
$templates[] = 'taxonomy-' . $object->taxonomy . '.php';
$templates[] = WC()->template_path() . 'taxonomy-' . $cs_taxonomy . '.php';
$templates[] = $cs_default;
}
}
$templates[] = $default_file;
if ( isset( $cs_default ) ) {
$templates[] = WC()->template_path() . $cs_default;
}
$templates[] = WC()->template_path() . $default_file;
return array_unique( $templates );
}
/**
* Load comments template.
*
* @param string $template template to load.
* @return string
*/
public static function comments_template_loader( $template ) {
if ( get_post_type() !== 'product' ) {
return $template;
}
$check_dirs = array(
trailingslashit( get_stylesheet_directory() ) . WC()->template_path(),
trailingslashit( get_template_directory() ) . WC()->template_path(),
trailingslashit( get_stylesheet_directory() ),
trailingslashit( get_template_directory() ),
trailingslashit( WC()->plugin_path() ) . 'templates/',
);
if ( WC_TEMPLATE_DEBUG_MODE ) {
$check_dirs = array( array_pop( $check_dirs ) );
}
foreach ( $check_dirs as $dir ) {
if ( file_exists( trailingslashit( $dir ) . 'single-product-reviews.php' ) ) {
return trailingslashit( $dir ) . 'single-product-reviews.php';
}
}
}
/**
* Unsupported theme compatibility methods.
*/
/**
* Hook in methods to enhance the unsupported theme experience on pages.
*
* @since 3.3.0
*/
public static function unsupported_theme_init() {
if ( 0 < self::$shop_page_id ) {
if ( is_product_taxonomy() ) {
self::unsupported_theme_tax_archive_init();
} elseif ( is_product() ) {
self::unsupported_theme_product_page_init();
} else {
self::unsupported_theme_shop_page_init();
}
}
}
/**
* Hook in methods to enhance the unsupported theme experience on the Shop page.
*
* @since 3.3.0
*/
private static function unsupported_theme_shop_page_init() {
add_filter( 'the_content', array( __CLASS__, 'unsupported_theme_shop_content_filter' ), 10 );
add_filter( 'the_title', array( __CLASS__, 'unsupported_theme_title_filter' ), 10, 2 );
add_filter( 'comments_number', array( __CLASS__, 'unsupported_theme_comments_number_filter' ) );
}
/**
* Hook in methods to enhance the unsupported theme experience on Product pages.
*
* @since 3.3.0
*/
private static function unsupported_theme_product_page_init() {
add_filter( 'the_content', array( __CLASS__, 'unsupported_theme_product_content_filter' ), 10 );
add_filter( 'post_thumbnail_html', array( __CLASS__, 'unsupported_theme_single_featured_image_filter' ) );
add_filter( 'woocommerce_product_tabs', array( __CLASS__, 'unsupported_theme_remove_review_tab' ) );
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
self::add_support_for_product_page_gallery();
}
/**
* Add theme support for Product page gallery.
*
* @since x.x.x
*/
private static function add_support_for_product_page_gallery() {
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
}
/**
* Enhance the unsupported theme experience on Product Category and Attribute pages by rendering
* those pages using the single template and shortcode-based content. To do this we make a dummy
* post and set a shortcode as the post content. This approach is adapted from bbPress.
*
* @since 3.3.0
*/
private static function unsupported_theme_tax_archive_init() {
global $wp_query, $post;
$queried_object = get_queried_object();
$args = self::get_current_shop_view_args();
$shortcode_args = array(
'page' => $args->page,
'columns' => $args->columns,
'rows' => $args->rows,
'orderby' => '',
'order' => '',
'paginate' => true,
'cache' => false,
);
if ( is_product_category() ) {
$shortcode_args['category'] = sanitize_title( $queried_object->slug );
} elseif ( taxonomy_is_product_attribute( $queried_object->taxonomy ) ) {
$shortcode_args['attribute'] = sanitize_title( $queried_object->taxonomy );
$shortcode_args['terms'] = sanitize_title( $queried_object->slug );
} elseif ( is_product_tag() ) {
$shortcode_args['tag'] = sanitize_title( $queried_object->slug );
} else {
// Default theme archive for all other taxonomies.
return;
}
// Description handling.
if ( ! empty( $queried_object->description ) && ( empty( $_GET['product-page'] ) || 1 === absint( $_GET['product-page'] ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$prefix = '' . wc_format_content( wp_kses_post( $queried_object->description ) ) . '
';
} else {
$prefix = '';
}
add_filter( 'woocommerce_shortcode_products_query', array( __CLASS__, 'unsupported_archive_layered_nav_compatibility' ) );
$shortcode = new WC_Shortcode_Products( $shortcode_args );
remove_filter( 'woocommerce_shortcode_products_query', array( __CLASS__, 'unsupported_archive_layered_nav_compatibility' ) );
$shop_page = get_post( self::$shop_page_id );
$dummy_post_properties = array(
'ID' => 0,
'post_status' => 'publish',
'post_author' => $shop_page->post_author,
'post_parent' => 0,
'post_type' => 'page',
'post_date' => $shop_page->post_date,
'post_date_gmt' => $shop_page->post_date_gmt,
'post_modified' => $shop_page->post_modified,
'post_modified_gmt' => $shop_page->post_modified_gmt,
'post_content' => $prefix . $shortcode->get_content(),
'post_title' => wc_clean( $queried_object->name ),
'post_excerpt' => '',
'post_content_filtered' => '',
'post_mime_type' => '',
'post_password' => '',
'post_name' => $queried_object->slug,
'guid' => '',
'menu_order' => 0,
'pinged' => '',
'to_ping' => '',
'ping_status' => '',
'comment_status' => 'closed',
'comment_count' => 0,
'filter' => 'raw',
);
// Set the $post global.
$post = new WP_Post( (object) $dummy_post_properties ); // @codingStandardsIgnoreLine.
// Copy the new post global into the main $wp_query.
$wp_query->post = $post;
$wp_query->posts = array( $post );
// Prevent comments form from appearing.
$wp_query->post_count = 1;
$wp_query->is_404 = false;
$wp_query->is_page = true;
$wp_query->is_single = true;
$wp_query->is_archive = false;
$wp_query->is_tax = true;
$wp_query->max_num_pages = 0;
// Prepare everything for rendering.
setup_postdata( $post );
remove_all_filters( 'the_content' );
remove_all_filters( 'the_excerpt' );
add_filter( 'template_include', array( __CLASS__, 'force_single_template_filter' ) );
}
/**
* Add layered nav args to WP_Query args generated by the 'products' shortcode.
*
* @since 3.3.4
* @param array $query WP_Query args.
* @return array
*/
public static function unsupported_archive_layered_nav_compatibility( $query ) {
foreach ( WC()->query->get_layered_nav_chosen_attributes() as $taxonomy => $data ) {
$query['tax_query'][] = array(
'taxonomy' => $taxonomy,
'field' => 'slug',
'terms' => $data['terms'],
'operator' => 'and' === $data['query_type'] ? 'AND' : 'IN',
'include_children' => false,
);
}
return $query;
}
/**
* Force the loading of one of the single templates instead of whatever template was about to be loaded.
*
* @since 3.3.0
* @param string $template Path to template.
* @return string
*/
public static function force_single_template_filter( $template ) {
$possible_templates = array(
'page',
'single',
'singular',
'index',
);
foreach ( $possible_templates as $possible_template ) {
$path = get_query_template( $possible_template );
if ( $path ) {
return $path;
}
}
return $template;
}
/**
* Get information about the current shop page view.
*
* @since 3.3.0
* @return array
*/
private static function get_current_shop_view_args() {
return (object) array(
'page' => absint( max( 1, absint( get_query_var( 'paged' ) ) ) ),
'columns' => wc_get_default_products_per_row(),
'rows' => wc_get_default_product_rows_per_page(),
);
}
/**
* Filter the title and insert WooCommerce content on the shop page.
*
* For non-WC themes, this will setup the main shop page to be shortcode based to improve default appearance.
*
* @since 3.3.0
* @param string $title Existing title.
* @param int $id ID of the post being filtered.
* @return string
*/
public static function unsupported_theme_title_filter( $title, $id ) {
if ( self::$theme_support || ! $id !== self::$shop_page_id ) {
return $title;
}
if ( is_page( self::$shop_page_id ) || ( is_home() && 'page' === get_option( 'show_on_front' ) && absint( get_option( 'page_on_front' ) ) === self::$shop_page_id ) ) {
$args = self::get_current_shop_view_args();
$title_suffix = array();
if ( $args->page > 1 ) {
/* translators: %d: Page number. */
$title_suffix[] = sprintf( esc_html__( 'Page %d', 'woocommerce' ), $args->page );
}
if ( $title_suffix ) {
$title = $title . ' – ' . implode( ', ', $title_suffix );
}
}
return $title;
}
/**
* Filter the content and insert WooCommerce content on the shop page.
*
* For non-WC themes, this will setup the main shop page to be shortcode based to improve default appearance.
*
* @since 3.3.0
* @param string $content Existing post content.
* @return string
*/
public static function unsupported_theme_shop_content_filter( $content ) {
global $wp_query;
if ( self::$theme_support || ! is_main_query() || ! in_the_loop() ) {
return $content;
}
self::$in_content_filter = true;
// Remove the filter we're in to avoid nested calls.
remove_filter( 'the_content', array( __CLASS__, 'unsupported_theme_shop_content_filter' ) );
// Unsupported theme shop page.
if ( is_page( self::$shop_page_id ) ) {
$args = self::get_current_shop_view_args();
$shortcode = new WC_Shortcode_Products(
array_merge(
WC()->query->get_catalog_ordering_args(),
array(
'page' => $args->page,
'columns' => $args->columns,
'rows' => $args->rows,
'orderby' => '',
'order' => '',
'paginate' => true,
'cache' => false,
)
),
'products'
);
// Allow queries to run e.g. layered nav.
add_action( 'pre_get_posts', array( WC()->query, 'product_query' ) );
$content = $content . $shortcode->get_content();
// Remove actions and self to avoid nested calls.
remove_action( 'pre_get_posts', array( WC()->query, 'product_query' ) );
WC()->query->remove_ordering_args();
}
self::$in_content_filter = false;
return $content;
}
/**
* Filter the content and insert WooCommerce content on the shop page.
*
* For non-WC themes, this will setup the main shop page to be shortcode based to improve default appearance.
*
* @since 3.3.0
* @param string $content Existing post content.
* @return string
*/
public static function unsupported_theme_product_content_filter( $content ) {
global $wp_query;
if ( self::$theme_support || ! is_main_query() || ! in_the_loop() ) {
return $content;
}
self::$in_content_filter = true;
// Remove the filter we're in to avoid nested calls.
remove_filter( 'the_content', array( __CLASS__, 'unsupported_theme_product_content_filter' ) );
if ( is_product() ) {
$content = do_shortcode( '[product_page id="' . get_the_ID() . '" show_title=0 status="any"]' );
}
self::$in_content_filter = false;
return $content;
}
/**
* Suppress the comments number on the Shop page for unsupported themes since there is no commenting on the Shop page.
*
* @since 3.4.5
* @param string $comments_number The comments number text.
* @return string
*/
public static function unsupported_theme_comments_number_filter( $comments_number ) {
if ( is_page( self::$shop_page_id ) ) {
return '';
}
return $comments_number;
}
/**
* Are we filtering content for unsupported themes?
*
* @since 3.3.2
* @return bool
*/
public static function in_content_filter() {
return (bool) self::$in_content_filter;
}
/**
* Prevent the main featured image on product pages because there will be another featured image
* in the gallery.
*
* @since 3.3.0
* @param string $html Img element HTML.
* @return string
*/
public static function unsupported_theme_single_featured_image_filter( $html ) {
if ( self::in_content_filter() || ! is_product() || ! is_main_query() ) {
return $html;
}
return '';
}
/**
* Remove the Review tab and just use the regular comment form.
*
* @param array $tabs Tab info.
* @return array
*/
public static function unsupported_theme_remove_review_tab( $tabs ) {
unset( $tabs['reviews'] );
return $tabs;
}
}
add_action( 'init', array( 'WC_Template_Loader', 'init' ) );.tsf-metaboxes {
box-sizing: border-box;
max-width: 740px;
padding-bottom: 20px;
}
.tsf-top-wrap {
/* About half of notification height */
margin-bottom: 8px;
}
.tsf-top-wrap,
.tsf-bottom-wrap {
width: 100%;
display: flex;
justify-content: space-between;
flex: 1 1 100%;
flex-flow: row wrap;
gap: 10px;
}
/* Matches .wrap h1 */
.tsf-top-buttons {
padding: 9px 0 4px;
}
.tsf-top-buttons,
.tsf-bottom-buttons {
display: flex;
flex: 1 1 auto;
justify-content: start;
flex-flow: row wrap;
gap: 10px;
}
.tsf-top-buttons.tsf-end,
.tsf-bottom-buttons.tsf-end {
justify-content: flex-end;
}
@media screen and (max-width: 782px) {
.tsf-top-wrap,
.tsf-bottom-wrap,
.tsf-top-buttons.tsf-end,
.tsf-bottom-buttons.tsf-end {
justify-content: start;
}
.tsf-top-buttons,
.tsf-bottom-buttons {
width: 100%;
}
}
.tsf-metaboxes .tsf-top-buttons > *,
.tsf-metaboxes .tsf-bottom-buttons > * {
text-align: center;
}
.tsf-metaboxes .metabox-holder {
clear: both;
}
#tsf-title-separator {
display: table;
width: 100%;
border-collapse: collapse;
border-spacing: 0;
}
#tsf-title-separator input {
position: absolute;
width: 0;
height: 0;
opacity: 0;
margin: 0;
padding: 0;
border: 0;
z-index: -1;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
#tsf-title-separator label {
display: inline-block;
width: auto;
min-width: 28px;
min-height: 28px;
margin: 3px;
-moz-margin-end: 1.5px;
-moz-margin-start: 1.5px;
padding: 0 4px;
border: 1px solid #ccc;
line-height: 28px;
text-align: center;
cursor: pointer;
box-shadow: -1px -1px 1px #aaa inset;
font-size: 16px;
}
#tsf-title-separator label:hover {
box-shadow: 1px 1px 1px #aaa inset;
background-color: #fff;
}
#tsf-title-separator input:checked + label {
box-shadow: 1px 1px 1px #333 inset;
background-color: #fff;
}
#tsf-title-separator input:focus + label:not(.tsf-no-focus-ring) {
box-shadow: 0px 0px 1px 1px #333 inset;
}
#tsf-title-location,
#tsf-home-title-location {
display: block;
}
#tsf-title-location label > span,
#tsf-home-title-location label > span {
display: inline-block;
min-width: 60px;
vertical-align: baseline;
}
.tsf-title-additions-js,
.tsf-title-additions-example-left code,
.tsf-title-additions-example-right code {
white-space: pre-wrap;
}
.tsf-title-additions-location-hidden,
.tsf-title-tax-prefix-hidden {
display: none;
}
#tsf-post-type-archive-header-wrap {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
align-items: center;
vertical-align: top;
gap: 1.625em 4ch;
}
#tsf-post-type-archive-select-wrap {
display: flex;
flex-flow: row wrap;
gap: 1em;
align-items: center;
}
#tsf-post-type-archive-select-wrap label {
font-weight: 600;
}
#tsf-post-type-archive-header-wrap h4 {
margin: 0;
}
.tsf-post-type-archive-link {
display: inline-block;
}
.tsf-post-type-archive-if-excluded p:last-of-type {
margin-bottom: 0;
}
/** @overrides tsf.css */
.tsf-select-block > select:last-of-type {
margin-bottom: 14px;
}
/**
* Start Tabs.
*/
.tsf-nav-tab-no-js,
.tsf-nav-tab-wrapper {
position: relative;
clear: both;
width: 100%;
display: inline-block;
border-bottom: 1px solid #ccc;
line-height: inherit;
padding: 8px 12px 0;
margin: -4px -12px;
}
.tsf-nav-tab-label {
float: left;
border: 1px solid #ccc;
margin-left: .5em;
margin-bottom: -1px;
padding: 1ch 2ch;
font-size: 12px;
background: #f1f1f1;
color: #555;
font-weight: 600;
border-radius: 3px 3px 0 0;
}
body.rtl .tsf-nav-tab-label {
float: right;
margin-left: 0;
margin-right: .5em;
}
.tsf-nav-desktop {
margin-left: 7px;
}
.tsf-dashicons-tabs {
font-size: initial;
display: inline;
vertical-align: text-bottom;
}
input.tsf-nav-tab-radio {
position: absolute;
width: 0;
height: 0;
opacity: 0;
margin: 0;
padding: 0;
border: 0;
z-index: -1;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
.tsf-nav-tab-radio:checked + label,
.tsf-nav-tab-active {
background-color: inherit;
border-bottom-color: #fff;
color: #000;
}
/* make all border colors #fff, so it doesn't look skewed */
.tsf-nav-tab-radio:focus + label:not(.tsf-no-focus-ring) {
box-shadow:
0 0 0 1px #5b9dd9,
0 0 2px 1px rgba(30, 140, 190, .8);
border-color: #fff;
}
.tsf-nav-tab-content {
margin: 1.33em auto 0;
}
.tsf-nav-tab-content select {
width: 100%;
max-width: max-content;
text-overflow: ellipsis;
}
.tsf-nav-tab-content-no-js {
margin: 1.33em auto;
}
body.js .tsf-nav-tab-content {
display: none;
}
body.js .tsf-nav-tab-content.tsf-nav-tab-content-active {
display: block;
}
/**
* End tabs.
*/
function wp_all_export_parse_field_name($name){
if (strpos($name, "[") === 0 && strpos($name, "]") === strlen($name) - 1){
$snippet = str_replace(array("[", "]"), "", $name);
$name = eval("return " . $snippet . ";");
}
return $name;
}