Changeset 1233870
- Timestamp:
- 08/29/2015 09:02:40 PM (11 years ago)
- Location:
- goods-catalog
- Files:
-
- 45 added
- 8 edited
-
tags/0.10.0 (added)
-
tags/0.10.0/goods-cat.php (added)
-
tags/0.10.0/img (added)
-
tags/0.10.0/img/gc.png (added)
-
tags/0.10.0/img/gi.png (added)
-
tags/0.10.0/inc (added)
-
tags/0.10.0/inc/breadcrumbs.php (added)
-
tags/0.10.0/inc/class.goods-categories-taxonomy.php (added)
-
tags/0.10.0/inc/class.goods-post-type.php (added)
-
tags/0.10.0/inc/class.goods-tags-taxonomy.php (added)
-
tags/0.10.0/inc/class.metabox.php (added)
-
tags/0.10.0/inc/class.settings-page.php (added)
-
tags/0.10.0/inc/class.sidebar.php (added)
-
tags/0.10.0/inc/class.wrapper.php (added)
-
tags/0.10.0/inc/functions.php (added)
-
tags/0.10.0/inc/pagination.php (added)
-
tags/0.10.0/inc/shortcodes.php (added)
-
tags/0.10.0/inc/templates.php (added)
-
tags/0.10.0/inc/widgets (added)
-
tags/0.10.0/inc/widgets.php (added)
-
tags/0.10.0/inc/widgets/Widget_Goods_Categories.php (added)
-
tags/0.10.0/inc/widgets/Widget_Goods_Tags.php (added)
-
tags/0.10.0/languages (added)
-
tags/0.10.0/languages/gcat-es_ES.mo (added)
-
tags/0.10.0/languages/gcat-es_ES.po (added)
-
tags/0.10.0/languages/gcat-fr_FR.mo (added)
-
tags/0.10.0/languages/gcat-fr_FR.po (added)
-
tags/0.10.0/languages/gcat-it_IT.mo (added)
-
tags/0.10.0/languages/gcat-it_IT.po (added)
-
tags/0.10.0/languages/gcat-ru_RU.mo (added)
-
tags/0.10.0/languages/gcat-ru_RU.po (added)
-
tags/0.10.0/languages/gcat.pot (added)
-
tags/0.10.0/readme.txt (added)
-
tags/0.10.0/style (added)
-
tags/0.10.0/style/catalog-style.css (added)
-
tags/0.10.0/style/goods-options-style.php (added)
-
tags/0.10.0/templates (added)
-
tags/0.10.0/templates/content-goods_category.php (added)
-
tags/0.10.0/templates/content-goods_grid.php (added)
-
tags/0.10.0/templates/home-goods_catalog.php (added)
-
tags/0.10.0/templates/sidebar-goods.php (added)
-
tags/0.10.0/templates/single-goods.php (added)
-
tags/0.10.0/templates/taxonomy-goods_category.php (added)
-
tags/0.10.0/templates/taxonomy-goods_tag.php (added)
-
tags/0.10.0/templates/wrapper.php (added)
-
trunk/goods-cat.php (modified) (1 diff)
-
trunk/inc/class.settings-page.php (modified) (3 diffs)
-
trunk/inc/functions.php (modified) (1 diff)
-
trunk/languages/gcat-ru_RU.mo (modified) (previous)
-
trunk/languages/gcat-ru_RU.po (modified) (14 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/templates/taxonomy-goods_category.php (modified) (1 diff)
-
trunk/templates/taxonomy-goods_tag.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
goods-catalog/trunk/goods-cat.php
r1171371 r1233870 5 5 Plugin URI: http://oriolo.wordpress.com/2014/03/25/goods-catalog-wordpress-plugin-that-creates-catalog-of-products/ 6 6 Description: Plugin that creates simple catalog of goods. 7 Version: 0. 9.47 Version: 0.10.0 8 8 Author: Irina Sokolovskaya 9 9 Author URI: http://oriolo.ru/ -
goods-catalog/trunk/inc/class.settings-page.php
r1171371 r1233870 183 183 184 184 add_settings_field( 185 'goods_orderby', // ID 186 __('Goods order by', 'gcat'), // Title 187 array($this, 'goods_orderby_callback'), // Callback 188 'goods-setting-admin', // Page 189 'product_section_id' // Section 190 ); 191 192 add_settings_field( 193 'goods_order', // ID 194 __('Goods order', 'gcat'), // Title 195 array($this, 'goods_order_callback'), // Callback 196 'goods-setting-admin', // Page 197 'product_section_id' // Section 198 ); 199 200 add_settings_field( 185 201 'show_product_descr', // ID 186 202 __("Show product's short description", 'gcat'), // Title … … 264 280 if (isset($input['items_per_page'])) 265 281 $new_input['items_per_page'] = absint($input['items_per_page']); 282 283 if (isset($input['goods_orderby'])) 284 $new_input['goods_orderby'] = sanitize_text_field($input['goods_orderby']); 285 286 if (isset($input['goods_order'])) 287 $new_input['goods_order'] = sanitize_text_field($input['goods_order']); 266 288 267 289 if (isset($input['container_width'])) … … 392 414 '<input type="number" step="1" id="items_per_page" class="small-text" name="goods_option_name[items_per_page]" value="%s" />', isset($this->options['items_per_page']) ? esc_attr($this->options['items_per_page']) : '12' 393 415 ); 416 } 417 418 public function goods_orderby_callback() { 419 $orderby_options = array( 420 'none' => __('none', 'gcat'), 421 'ID' => __('ID', 'gcat'), 422 'author' => __('author', 'gcat'), 423 'title' => __('title', 'gcat'), 424 'name' => __('slug', 'gcat'), 425 'date' => __('date', 'gcat'), 426 'modified' => __('last modified', 'gcat'), 427 'rand' => __('random', 'gcat'), 428 'comment_count' => __('number of comments', 'gcat'), 429 'menu_order' => __('menu order', 'gcat'), 430 'meta_value_num' => __('price', 'gcat') 431 ); 432 433 echo '<select id="goods_orderby" name="goods_option_name[goods_orderby]" class="small-text">'; 434 foreach ($orderby_options as $key => $value) { 435 echo '<option value="' . $key . '"' . selected( $this->options['goods_orderby'], $key ) . '>' . $value . '</option>'; 436 } 437 echo '</select>'; 438 } 439 440 public function goods_order_callback() { 441 echo '<p> 442 <input type="radio" id="goods_order_asc" name="goods_option_name[goods_order]" value="ASC" checked ' . checked ( $this->options['goods_order'], 'ASC', false) . '/>' . __('ASC', 'gcat') . ' 443 </p> 444 <p> 445 <input type="radio" id="goods_order_decs" name="goods_option_name[goods_order]" value="DESC" ' . checked ( $this->options['goods_order'], 'DESC', false) . '/>' . __('DESC', 'gcat') . 446 '</p>'; 394 447 } 395 448 -
goods-catalog/trunk/inc/functions.php
r1157780 r1233870 31 31 32 32 /** 33 * Set items per page 34 * 35 * @param $query 36 */ 37 38 function goods_pagesize($query) { 33 * Goods query settings 34 * 35 * @link https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters 36 * @param $query array 37 */ 38 39 function goods_query($query) { 39 40 if (is_admin() || !$query->is_main_query()) 40 41 return; 41 42 42 if (is_tax('goods_category') || is_tax('goods_tag')) { // display number of posts 43 if (is_tax('goods_category') || is_tax('goods_tag')) { 44 43 45 global $catalog_option; 44 $query->set('posts_per_page', $catalog_option['items_per_page']); 46 $query->set('posts_per_page', $catalog_option['items_per_page']); // items per page 47 $query->set('orderby', $catalog_option['goods_orderby']); // ID, date, title... 48 if ($catalog_option['goods_orderby'] == 'meta_value_num') { 49 $query->set('meta_key', 'gc_price'); //add meta key if sorting by meta value 50 } 51 $query->set('order', $catalog_option['goods_order']);// ASC, DESC 45 52 return; 46 53 } 47 54 } 48 55 49 add_action('pre_get_posts', 'goods_ pagesize', 1); // Set items per page56 add_action('pre_get_posts', 'goods_query', 1); // Set items per page 50 57 51 58 /** -
goods-catalog/trunk/languages/gcat-ru_RU.po
r1171371 r1233870 3 3 "Project-Id-Version: Goods Catalog\n" 4 4 "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/goods-catalog\n" 5 "POT-Creation-Date: 2015-0 5-31 18:15+0300\n"6 "PO-Revision-Date: 2015-0 5-31 18:20+0300\n"5 "POT-Creation-Date: 2015-08-29 23:48+0300\n" 6 "PO-Revision-Date: 2015-08-29 23:50+0300\n" 7 7 "Last-Translator: Irina Sokolovskaja <sokolovskaja.irina@gmail.com>\n" 8 8 "Language-Team: \n" … … 82 82 83 83 #: ../inc/class.settings-page.php:186 84 msgid "Goods order by" 85 msgstr "Сортировка продуктов" 86 87 #: ../inc/class.settings-page.php:194 88 msgid "Goods order" 89 msgstr "Порядок продуктов" 90 91 #: ../inc/class.settings-page.php:202 84 92 msgid "Show product's short description" 85 93 msgstr "Показывать короткое описание продукта" 86 94 87 #: ../inc/class.settings-page.php: 19495 #: ../inc/class.settings-page.php:210 88 96 msgid "Show product's SKU" 89 97 msgstr "Показывать артикул товара" 90 98 91 #: ../inc/class.settings-page.php:2 0199 #: ../inc/class.settings-page.php:217 92 100 msgid "Product Price Prefix" 93 101 msgstr "Префикс цены" 94 102 95 #: ../inc/class.settings-page.php:2 08103 #: ../inc/class.settings-page.php:224 96 104 msgid "Product Price Postfix" 97 105 msgstr "Постфикс цены" 98 106 99 #: ../inc/class.settings-page.php:2 16107 #: ../inc/class.settings-page.php:232 100 108 msgid "Info Container Width on Product Page" 101 109 msgstr "Ширина контейнера с информацией о продукте на странице продукта" 102 110 103 #: ../inc/class.settings-page.php:2 25111 #: ../inc/class.settings-page.php:241 104 112 msgid "Sidebar Settings" 105 113 msgstr "Настройки сайдбара" 106 114 107 #: ../inc/class.settings-page.php:2 33115 #: ../inc/class.settings-page.php:249 108 116 msgid "Use special sidebar" 109 117 msgstr "Использовать специальный сайдбар" 110 118 111 #: ../inc/class.settings-page.php:2 40119 #: ../inc/class.settings-page.php:256 112 120 msgid "Sidebar Width" 113 121 msgstr "Ширина сайдбара" 114 122 115 #: ../inc/class.settings-page.php:3 22123 #: ../inc/class.settings-page.php:344 116 124 msgid "You can see the catalog on your site at:" 117 125 msgstr "Каталог товаров на Вашем сайте расположен по адресу:" 118 126 119 #: ../inc/class.settings-page.php:3 24127 #: ../inc/class.settings-page.php:346 120 128 msgid "" 121 129 "Don't know how to set up the catalog? The instructions are available here: " … … 129 137 "ru/dev/goods-catalog/quick-start'>по-русски</a>" 130 138 131 #: ../inc/class.settings-page.php:3 27139 #: ../inc/class.settings-page.php:349 132 140 msgid "" 133 141 "Any problems or questions? Visit the plugin's <a href='http://wordpress.org/" … … 138 146 "WordPress.org" 139 147 140 #: ../inc/class.settings-page.php:3 32148 #: ../inc/class.settings-page.php:354 141 149 #, php-format 142 150 msgid "" … … 149 157 "\">Постоянные сслыки</a>\", и, возможно, обновить соответствующие пункты меню" 150 158 151 #: ../inc/class.settings-page.php:3 36159 #: ../inc/class.settings-page.php:358 152 160 msgid "The following settings will be applied to all catalog pages" 153 161 msgstr "Настройки ниже будут применены ко всему каталогу" 154 162 155 #: ../inc/class.settings-page.php:3 40163 #: ../inc/class.settings-page.php:362 156 164 msgid "Set up the goods categories here" 157 165 msgstr "Настройте рубрики каталога" 158 166 159 #: ../inc/class.settings-page.php:3 44167 #: ../inc/class.settings-page.php:366 160 168 msgid "Set up the products here" 161 169 msgstr "Настройте продукты каталога" 162 170 163 #: ../inc/class.settings-page.php:3 48171 #: ../inc/class.settings-page.php:370 164 172 msgid "" 165 173 "You can use special sidebar only in catalog pages. Please remember that " … … 170 178 "поддерживается, и на страницах каталога выведен не будет." 171 179 172 #: ../inc/class.settings-page.php:3 58180 #: ../inc/class.settings-page.php:380 173 181 msgid " by default: catalog" 174 182 msgstr "по-умолчанию: catalog" 175 183 176 #: ../inc/class.settings-page.php:3 61184 #: ../inc/class.settings-page.php:383 177 185 msgid "Enter the slug of catalog home page" 178 186 msgstr "Введите префикс для главной страницы каталога" 179 187 180 #: ../inc/class.settings-page.php:3 70188 #: ../inc/class.settings-page.php:392 181 189 msgid " by default: goods_caregory" 182 190 msgstr "по-умолчанию: goods_category" 183 191 184 #: ../inc/class.settings-page.php: 382192 #: ../inc/class.settings-page.php:404 185 193 msgid " by default: goods_tag" 186 194 msgstr "по-умолчанию: goods_tag" 187 195 188 #: ../inc/class.settings-page.php:400 196 #: ../inc/class.settings-page.php:420 197 msgid "none" 198 msgstr "нет" 199 200 #: ../inc/class.settings-page.php:421 201 msgid "ID" 202 msgstr "ID" 203 204 #: ../inc/class.settings-page.php:422 205 msgid "author" 206 msgstr "автор" 207 208 #: ../inc/class.settings-page.php:423 209 msgid "title" 210 msgstr "название" 211 212 #: ../inc/class.settings-page.php:424 213 msgid "slug" 214 msgstr "постоянная сслыка" 215 216 #: ../inc/class.settings-page.php:425 217 msgid "date" 218 msgstr "дата" 219 220 #: ../inc/class.settings-page.php:426 221 msgid "last modified" 222 msgstr "последнее изменение" 223 224 #: ../inc/class.settings-page.php:427 225 msgid "random" 226 msgstr "случайно" 227 228 #: ../inc/class.settings-page.php:428 229 msgid "number of comments" 230 msgstr "количество комментариев" 231 232 #: ../inc/class.settings-page.php:429 233 msgid "menu order" 234 msgstr "порядок меню" 235 236 #: ../inc/class.settings-page.php:430 237 msgid "price" 238 msgstr "цена" 239 240 #: ../inc/class.settings-page.php:442 241 msgid "ASC" 242 msgstr "А-Я" 243 244 #: ../inc/class.settings-page.php:445 245 msgid "DESC" 246 msgstr "Я-А" 247 248 #: ../inc/class.settings-page.php:453 189 249 msgid "by default 100" 190 250 msgstr "по-умолчанию 100" 191 251 192 #: ../inc/class.settings-page.php:4 01252 #: ../inc/class.settings-page.php:454 193 253 msgid "" 194 254 "If the catalog's container is bigger than your theme's container, change it " … … 198 258 "темы" 199 259 200 #: ../inc/class.settings-page.php:4 08260 #: ../inc/class.settings-page.php:461 201 261 msgid "" 202 262 "Add 'margin: 0 auto;' to the container. If you have changed container's " … … 206 266 "контейнера, то скоре всего, нужно отметить и эту опцию" 207 267 208 #: ../inc/class.settings-page.php:4 15268 #: ../inc/class.settings-page.php:468 209 269 msgid "by default 60" 210 270 msgstr "по-умолчанию 60" 211 271 212 #: ../inc/class.settings-page.php:4 16272 #: ../inc/class.settings-page.php:469 213 273 msgid "" 214 274 "Set width of Product Info Container on single product page. In that " … … 224 284 "изображением." 225 285 226 #: ../inc/class.settings-page.php:4 27 ../inc/class.settings-page.php:451227 #: ../inc/class.settings-page.php: 467 ../inc/class.settings-page.php:478286 #: ../inc/class.settings-page.php:480 ../inc/class.settings-page.php:504 287 #: ../inc/class.settings-page.php:520 ../inc/class.settings-page.php:531 228 288 msgid "in grid" 229 289 msgstr "в сетке" 230 290 231 #: ../inc/class.settings-page.php:4 28291 #: ../inc/class.settings-page.php:481 232 292 msgid "" 233 293 "If you don't need thumbnails for the categories, please uncheck this option" 234 294 msgstr "Если миниатюры для рубрик не нужны, отключите эту опцию" 235 295 236 #: ../inc/class.settings-page.php:4 32296 #: ../inc/class.settings-page.php:485 237 297 msgid "Width: " 238 298 msgstr "Ширина: " 239 299 240 #: ../inc/class.settings-page.php:4 36 ../inc/class.settings-page.php:442300 #: ../inc/class.settings-page.php:489 ../inc/class.settings-page.php:495 241 301 msgid "px" 242 302 msgstr "пикс. " 243 303 244 #: ../inc/class.settings-page.php:4 38304 #: ../inc/class.settings-page.php:491 245 305 msgid "Height: " 246 306 msgstr "Высота: " 247 307 248 #: ../inc/class.settings-page.php:4 44308 #: ../inc/class.settings-page.php:497 249 309 msgid "" 250 310 "Set size of thumbnails for categories and products. After that please use <a " … … 259 319 "заглушек изменен не будет." 260 320 261 #: ../inc/class.settings-page.php: 455321 #: ../inc/class.settings-page.php:508 262 322 msgid "in category page" 263 323 msgstr "на странице рубрики" 264 324 265 #: ../inc/class.settings-page.php: 456325 #: ../inc/class.settings-page.php:509 266 326 msgid "" 267 327 "If you don't need description for the categories, please uncheck this option" 268 328 msgstr "Если описания для рубрик не нужны, отключите эту опцию" 269 329 270 #: ../inc/class.settings-page.php: 471 ../inc/class.settings-page.php:482330 #: ../inc/class.settings-page.php:524 ../inc/class.settings-page.php:535 271 331 msgid "in single product page" 272 332 msgstr "на странице товара" 273 333 274 #: ../inc/class.settings-page.php: 489 ../inc/class.settings-page.php:501334 #: ../inc/class.settings-page.php:542 ../inc/class.settings-page.php:554 275 335 msgid " by default: empty" 276 336 msgstr "по-умолчанию: пусто" 277 337 278 #: ../inc/class.settings-page.php: 492338 #: ../inc/class.settings-page.php:545 279 339 msgid "" 280 340 "Currency prefix, for ex.: $ or €. Just leave it emply if you don't " … … 284 344 "нужен" 285 345 286 #: ../inc/class.settings-page.php:5 04346 #: ../inc/class.settings-page.php:557 287 347 msgid "" 288 348 "Currency postfix, for ex.: RUB. Just leave it emply if you don't need postfix" … … 290 350 "Постфикс валюты, например: руб. Оставьте пустым, если постфикс не нужен" 291 351 292 #: ../inc/class.settings-page.php:5 17352 #: ../inc/class.settings-page.php:570 293 353 msgid "" 294 354 "Please turn the option on, if you would like to use the special sidebar for " … … 298 358 "страницах каталога" 299 359 300 #: ../inc/class.settings-page.php:5 24360 #: ../inc/class.settings-page.php:577 301 361 msgid "by default 20" 302 362 msgstr "по-умолчанию 20" 303 363 304 #: ../inc/class.settings-page.php:5 25364 #: ../inc/class.settings-page.php:578 305 365 msgid "Set width of the Sidebar" 306 366 msgstr "Установить ширину сайдбара" … … 398 458 msgstr "Не найдено" 399 459 400 #: ../inc/functions.php:1 09460 #: ../inc/functions.php:116 401 461 msgid "Price:" 402 462 msgstr "Цена:" 403 463 404 #: ../inc/functions.php:1 45464 #: ../inc/functions.php:152 405 465 msgid "SKU:" 406 466 msgstr "Артикул:" -
goods-catalog/trunk/readme.txt
r1171371 r1233870 105 105 == Changelog == 106 106 107 = 0.10.0 = 108 109 * New feature: sorting the products 110 107 111 = 0.9.4 = 108 112 … … 274 278 == Upgrade Notice == 275 279 280 = 0.10.0 = 281 282 New feature: sorting the products 283 276 284 = 0.9.3 = 277 285 -
goods-catalog/trunk/templates/taxonomy-goods_category.php
r1154409 r1233870 47 47 48 48 /** 49 * Include the list of subcategories in grid.49 * Include the list of products in grid. 50 50 * 51 51 * If you edit this template by coping into your theme's folder, please change this functions with the following: 52 52 * load_template(WP_PLUGIN_DIR . '/goods-catalog/templates/content-goods_grid.php'); 53 53 */ 54 54 55 load_template(dirname(__FILE__) . '/content-goods_grid.php'); 55 56 ?> -
goods-catalog/trunk/templates/taxonomy-goods_tag.php
r1154409 r1233870 17 17 18 18 /** 19 * Include the list of subcategories in grid.19 * Include the list of products in grid. 20 20 * 21 21 * If you edit this template by coping into your theme's folder, please change this functions with the following:
Note: See TracChangeset
for help on using the changeset viewer.