-
Notifications
You must be signed in to change notification settings - Fork 8
/
readme.txt
executable file
·171 lines (139 loc) · 7.59 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
Демо-сайт MODX Revolution + Shopkeeper 3
==========================================
Описание
--------
Простой интернет-магазин на MODX Revolution + Shopkeeper 3.x.
Что реализовано:
- Есть примеры двух типов товаров: ресурсы MODX и товары, созданные в MIGXDB
- Фильтрация в каталоге
- Корзина товаров
- Мультивалютность
- Регистрация, авторизация, восстановление пароля для пользователей
- Подарочные карты и скидки
- Форма обратной связи
- Блоки "Новинки" и "Лидеры продаж"
- Избранные товары
Что включено
------------
- MODX Revolution 2.5.5-pl
- Shopkeeper 3.2.7pl2
- TagManager 2.3.1pl2
- getProducts 1.4-rc2
- getPage 1.2.4-pl
- Compare 1.1-pl
- Login 1.9.2-pl
- FormIt 2.2.11-pl
- coolcaptchafihook 1.3-pl
- Wayfinder 2.3.3-pl
- menuCaching 1.0-pl
- MIGX 2.9.6-pl
- phpThumbOn 1.3.1-pl
- QuickCrumbs 1.0.1-pl (модифицированный)
- TinyMCE Rich Text Editor 1.1.1-pl
- translit 1.0.0-beta
Инструкци по установке
----------------------
1. Настроить свой веб-сервер.
[Требования к серверу](https://develop.modx.com/develop/revolution/requirements/)
[Пример конфигурации для веб-сервера Nginx](https://rtfm.modx.com/revolution/2.x/getting-started/installation/basic-installation/nginx-server-config)
Для веб-сервера Apache настроить виртуальный хост.
2. Распаковать архив на своем компьютере.
Вложенные файлы:
* shk3_simple_site.zip
* install.php
* readme.txt
3. Загрузить все файлы кроме readme.txt в корневую папку домена вашего сайта на сервере.
4. В браузере в адресной строке набрать адрес:
``http://[адрес вашего сайта]/install.php``
Будет распакован архив с файлами сайта и откроется интерфейс установщика по адресу http://[адрес вашего сайта]/setup/.
5. Завершить установку как обычно устанавливаете MODX.
При установке нужно будет указать параметры подключения к базе данных MySQL, которую нужно создать заранее,
а так же логин и пароль администратора сайта.
6. После установки в браузере открыть адрес:
``http://[адрес вашего сайта]/install.php?import_bd=1``
Будут импортированы данные демо-сайта в вашу базу данных.
7. Удалить следующие папки и файлы на сервере:
* setup
* shk3_simple_site.zip
* install.php
* mysql_dump.sql
8. Очистить содержимое папки /core/cache/.
9. Установите права на запись следующим папкам:
* /core/packages
* /core/cache
* /core/import
* /core/export
* /assets/files
10. Если сервер Apache, переименовать файл в корне сайта ht.access в .htaccess.
Если сайт устанавливается в папку домена, открыть этот файл в текстовом редакторе
и заменить строку
~~~
RewriteBase /
~~~
на такую:
~~~
RewriteBase /my_site
~~~
где "my_site" - имя папки сайта на сервере.
10.2
Если сервер Nginx и демо-сайт установлен в папку домена, добавить в конфиг такой код:
~~~
location /my_site/ {
if (!-e $request_filename) {
rewrite ^/my_site/(.*)$ /my_site/index.php?q=$1 last;
}
}
~~~
где "my_site" - имя папки сайта на сервере.
11. Готово. Войти в админку по адресу:
``http://[адрес вашего сайта]/manager/``
Очистить кэш сайта. "Управление" -> "Очистить кэш".
Часто задаваемые воросы
-----------------------
1. Я изменил имя папки /core/ на другое и сайт перестал работать.
**Ответ:**
Кроме изменения **core_path** нужно изменить путь в Источнике файлов "Компоненты".
Открыть в админке **"Медиа" -> "Источники файлов" -> "Компоненты - Редактировать"**.
Изменить параметры "basePath" и "baseUrl".
2. Как добавить поля в таблицу товаров?
**Ответ:**
В админке перейти "Приложения" -> "MIGX".
В разделе "Package Manager" открыть вкладку "XML Schema". В поле "Package Name" ввести имя пакета - "shop".
Нажать кнопку "Load schema". будет загружена XML схема таблицы "shop_content". Нужно добавить в эту схему новые поля и нажать кнопку "Save schema".
Перейти на вкладку "Add fields" и нажать кнопку "Add fields". Теперь в разделе "MIGX" в конфигурации "shop" можно добавить новые поля в интерфейс создания/редактирования товара.
3. Как обновить JS и CSS сайта?
**Ответ:**
Все JavaScript-файлы объеденены в одном: "assets/template/dist/js/scripts_all.min.js"
CSS-фалы в "assets/template/dist/css/styles_all.min.css"
Эти файлы созданы через [Grunt](http://gruntjs.com/)
Файл конфигурации **Gruntfile.js** находится в папке **"assets/template/"**.
В этой же папке находится файл "package.json" для установки всех необходимых пакетов.
Установить NodeJS:
[https://nodejs.org/en/download/](https://nodejs.org/en/download/)
Для Windows будет установлен менеджер пакетов - [NPM](https://www.npmjs.com/).
В командной строке перейти в папку
~~~
cd [ваш сайт]/assets/template
~~~
Установить пакеты:
~~~
npm install
~~~
Собрать JavaScript и CSS:
~~~
grunt
~~~
Будет запущена команда "deault".
Собрать JavaScript:
~~~
grunt uglify
~~~
Собрать CSS:
~~~
Grunt cssmin
~~~
4. Я не хочу заморачиваться с Grunt`ом. Как отредактировать скрипты?
**Ответ:**
Откройте чанк "head" и замените путь к статичному файлу "assets/template/head.html"
на "assets/template/head_dev.html". В этом чанке можно найти список всех скриптов, которые используются
на сайте.