Виталий

Виталий

С нами с 06 декабря 2015; Место в рейтинге пользователей: #426
Виталий
17 декабря 2021, 17:14
0
Подскажите, как сделать чтобы только у определенных групп пользователей было такое ограничение по сумме корзины?
<?php
class myOrderHandler extends msOrderHandler
{
	public function submit($data = array())
	{
		$min_price_order = $this->modx->getOption('ms2_minimum_price_order');
		$cart_status = $this->ms2->cart->status();
		$currency = $this->modx->lexicon('ms2_frontend_currency');

		$userid = $modx->user->get('id');
		$user = $modx->getObject('modUser',array('active' => true, 'id' => $userid ));

	
		if($user->isMember(array('Administrator','Manager')) && $cart_status['total_cost'] < $min_price_order)
		{

			return $this->error( 'ms2_order_err_total_price', array(), array('price'=>$min_price_order, 'currency'=>$currency) );
		
		}
		
		return parent::submit($data);
	}
	
}
Виталий
08 июня 2021, 12:59
0
да, работает, нужно еще было подключить Робочеки в ЛК робокассы
Виталий
08 июня 2021, 12:49
0
Подскажите, что нужно указать в системных настройках чтобы передавалась корзина в чек в параметре ms2_payment_rbks_fiskal, поставить 1?
Виталий
04 февраля 2021, 10:25
0
Павел, добрый день. подскажите, можно ли выводить сумму бонусов при покупке товара еще не авторизованному пользователю? примерно так. в документации не нашел информации. спасибо
Виталий
18 января 2021, 15:09
0
Николай, спасибо, за обновление! подскажите, а вебхуки работают? делал, как понимаю, по старой инструкции, но если менять статус в амо, то в админке сайта не меняется.
Еще почему-то после обновления перестала поступать информация о купленных товарах, поля пустые, в настройках вроде все указано по дефолту
буду благодарен за ответ, в техподдержку написать не могу, потому что дополнение куплено больше года назад
Виталий
15 октября 2019, 15:15
0
Спасибо большое! Разобрался с вашей помощью в чем дело. сразу не сообразил, что они по ajax меняются
Виталий
23 февраля 2019, 13:06
0
Всем привет.
Появилась такая же проблема. я имею в виду ошибку в логах. раньше этого не было замечено, возможно связано с обновлением дополнений или фреймворка. Лог ошибок разрастается с неимоверной скоростью.
Вполне возможно что очень давно был установлен msoptionsprice первой версии, но сейчас его нет.
Пробовал поочередно отключать сниппеты и чанки, но единственное что удалось выяснить — ошибка пропадает если на странице не выводятся товары каким-либо сниппетом (looked, mfilter, msproducts)
[2019-02-23 11:39:26] (ERROR @ /var/www/vitaliy/data/www/site.ru/core/xpdo/xpdo.class.php : 644) Could not load class: msoptionsprice from msoptionsprice.msoptionsprice.
[2019-02-23 11:39:26] (ERROR @ /var/www/vitaliy/data/www/site.ru/core/xpdo/xpdo.class.php : 1247) Problem getting service msoptionsprice.msoptionsprice, instance of class msoptionsprice.msoptionsprice, from path /var/www/vitaliy/data/www/krasnodar-diskont.ru/core/components/msoptionsprice/model/
Подскажите, где искать причину появления ошибки и как ее устранить?
Виталий
25 июня 2018, 10:17
0
Всем привет!
Купил дополнение, настроил всё что нужно, кроме отправки текста сообщения из formit. Почему-то оно не добавляется в amoCRM.

вызов formit
&hooks=`email,amoCRMAddContact`	
&amoCRMNameField=`name==name||phone==phone||email==email||comment==comment`
&validate=`name:required:minLength=`2`,phone:required, email:email:required, comment:stripTags, agree:required, site_message:blank`
но я так понимаю что name==name||phone==phone||email==email|| не нужно указывать, оно и так добавляется в amoCRM, а вот комментарий добавить не получается.
в системных настройках сделал так.
Шаблон формы:
<form id="contactform" class="form" name="contactform" action="[[~[[*id]]]]" method="post">
<input type="hidden" name="nospam:blank" value="" />
  <div class="form-group">
<input type="text" name="site_message" class="site_message" value="" />
	<input type="text" name="name" id="name" class="form-control" placeholder="Введите Ваше имя (Обязательное поле)">
	   <div class="invalid-feedback error_name">
        [[+fi.error.name]]
      </div>
  </div>
  <div class="form-group">
	<input type="text" name="email" id="email" class="form-control" placeholder="Введите адрес электронной почты (Обязательное поле)">
	   <div class="invalid-feedback error_email">
        [[+fi.error.email]]
      </div>
  </div>
  <div class="form-group">
	<input type="text" name="phone" id="phone" class="form-control " placeholder="Введите номер телефона (Обязательное поле)">
	   <div class="invalid-feedback error_phone">
        [[+fi.error.phone]]
      </div>
  </div>
  <div class="form-group">
	<textarea type="text" name="comment" id="comment" class="form-control" rows="3" placeholder="Сообщение"></textarea>
  </div>
  <div class="form-check d-flex">

	<input type="hidden" name="agree[]" value="">
	<input type="checkbox" name="agree[]" id="agree" class="form-check-input" checked>
	<label class="form-check-label">Я согласен с <a href="[[~3]]" class="aPerson">условиями обработки персональных данных</a></label>
	<div class="invalid-feedback error_agree">
       [[+fi.error.agree]]
    </div>

  </div>
  <button type="submit" class="btn btn-priceForm mt-2">Отправить</button>
</form>
Подскажите, кто уже это настраивал – автор дополнения не отвечает уже неделю…
Виталий
29 апреля 2018, 15:34
0
Добрый день! Подскажите, как выводить в списке городов модального окна не все загруженные, а только те города, которые я добавил на вкладке «Данные»?

Здесь нужно указать другой класс?
<ul class="gl-change-list">
                [[!gl.location?
                &class=`[[+class]]`
                &where=`{"default":0}`
				&limit=`30`
                ]]
            </ul>
Виталий
30 ноября 2017, 22:10
0
Да, спасибо, то что нужно! нашел еще доступ к админке, все попробовал.) в ближайшее время приобрету
Виталий
29 ноября 2017, 21:54
0
Степан, привет! пока посмотрел только второе видео, но не нашел для себя ответа. Меня интересует диапазон. Из видео я понял что в товаре можно указать только одно значение? т.е. у меня есть необходимость в товарах указывать диапазон значений, например, цена(или любое ддругое поле) от 13 до 18 рублей, в другом товаре от 10 до 17 и т.д., а потом фильтровать в каталоге, выбрав, к примеру, диапазон от 13 до 15. Соответственно, оба этих товара должны быть показаны. это можно реализовать с msExtraFields?
Виталий
14 ноября 2017, 21:28
0
Подскажите пожалуйста, как выводить больше 10 городов в модальном окне?
Виталий
11 января 2017, 16:55
+1
Проблема решилась обновлением минишоп и пересозданием опций. Спасибо!
Виталий
11 января 2017, 11:33
0
Не помогло – обновил minishop на локалхосте

Строка Added where condition стала такой же как в вашем примере, но по-прежнему не выводит товар, точнее, товар с указанными опциями из нужной категории.
0.0156672: pdoTools loaded.
0.0020339: Conditions prepared
0.0001001: xPDO query object created
0.0005281: leftJoined msProductData as Data
0.0003650: leftJoined msVendor as Vendor
0.0022731: leftJoined msProductFile as 235x235
0.0015390: leftJoined msProductOption as HDsizeTV
0.0000081: Grouped by msProduct.id, `235x235`.url
0.0000911: Added selection of msProduct: SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
0.0000501: Added selection of msProductData: `article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`, `availability`
0.0001042: Added selection of msVendor: `name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`
0.0000348: Added selection of msProductFile: url as `235x235`
0.0033131: Processed additional conditions
0.0040870: Added where condition: class_key=msProduct, HDsizeTV.value=720p HD, msProduct.parent:IN(27,140,189,245,255,256,353,354,355,356,357,374,375,376,382,383,416,420,438,439,440,450,486,504,510,511,576,598,599,623,624,649,670,688,692,693,694,750,751,752,778,780,783,800,811,824,842,843,845,852,910,913,914,925,926,935,940,1052,1054,1093,1057,1107,1108,1109,1120,1121,1126), msProduct.published=1, msProduct.deleted=0
0.0001769: Sorted by msProduct.id, ASC
0.0000081: Limited to 10, offset 0
0.0010231: SQL prepared "SELECT SQL_CALC_FOUND_ROWS `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`article`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Data`.`availability`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties`, `235x235`.url as `235x235` FROM `modx_site_content` AS `msProduct` LEFT JOIN `modx_ms2_products` `Data` ON `msProduct`.`id` =  `Data`.`id` LEFT JOIN `modx_ms2_vendors` `Vendor` ON Data.vendor=Vendor.id LEFT JOIN `modx_ms2_product_files` `235x235` ON `235x235`.product_id = msProduct.id AND `235x235`.rank = 0 AND `235x235`.path LIKE '%/235x235/%' LEFT JOIN `modx_ms2_product_options` `HDsizeTV` ON `HDsizeTV`.product_id = Data.id AND `HDsizeTV`.key = 'HDsizeTV' WHERE  ( `msProduct`.`class_key` = 'msProduct' AND `HDsizeTV`.`value` = '720p HD' AND `msProduct`.`parent` IN (27,140,189,245,255,256,353,354,355,356,357,374,375,376,382,383,416,420,438,439,440,450,486,504,510,511,576,598,599,623,624,649,670,688,692,693,694,750,751,752,778,780,783,800,811,824,842,843,845,852,910,913,914,925,926,935,940,1052,1054,1093,1057,1107,1108,1109,1120,1121,1126) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 )  GROUP BY msProduct.id, `235x235`.url ORDER BY msProduct.id ASC LIMIT 10 "
0.0132489: SQL executed
0.0003381: Total rows: 0
0.0000310: Rows fetched
0.0000319: Returning raw data
0.4491699: Total time
15 728 640: Memory usage
Виталий
10 января 2017, 17:47
0
версия была 2.7.5, обновил.
если указываю &parents=`0` выводит товар, но из абсолютно других разделов каталога, где я еще не устанавливал опции. Причем, я пробую задавать другие опции, а эти товары в большинстве своем повторяются.

строка в логе не изменилась

0.0000432: xPDO query object created
0.0002759: leftJoined msProductData as Data
0.0001831: leftJoined msVendor as Vendor
0.0015111: leftJoined msProductFile as 235x235
0.0004840: leftJoined msProductOption as HDsizeTV
0.0000029: Grouped by msProduct.id
0.0001309: Added selection of msProduct: SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
0.0000472: Added selection of msProductData: `sku_id`, `article`, `sku_name`, `default`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`, `availability`
0.0000231: Added selection of msVendor: `name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`
0.0000141: Added selection of msProductFile: `url` as `235x235`
0.0000470: Processed additional conditions
0.0004928: Added where condition: class_key=msProduct, 0(Array), msProduct.published=1, msProduct.deleted=0
0.0000648: Sorted by msProduct.id, ASC
0.0000019: Limited to 10, offset 0
0.0003810: SQL prepared "SELECT SQL_CALC_FOUND_ROWS `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`sku_id`, `Data`.`article`, `Data`.`sku_name`, `Data`.`default`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Data`.`availability`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties`, `235x235`.`url` as `235x235` FROM `modx_site_content` AS `msProduct` LEFT JOIN `modx_ms2_products` `Data` ON `msProduct`.`id`=`Data`.`id` LEFT JOIN `modx_ms2_vendors` `Vendor` ON `Data`.`vendor`=`Vendor`.`id` LEFT JOIN `modx_ms2_product_files` `235x235` ON `235x235`.`product_id` = `Data`.`sku_id` AND `235x235`.`parent` != 0 AND `235x235`.`path` LIKE '%/235x235/' LEFT JOIN `modx_ms2_product_options` `HDsizeTV` ON `HDsizeTV`.`product_id`=`Data`.`id` AND `HDsizeTV`.`key`='HDsizeTV' WHERE  ( `msProduct`.`class_key` = 'msProduct' AND `HDsizeTV`.`value` = '720p HD' AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 )  GROUP BY msProduct.id ORDER BY msProduct.id ASC LIMIT 10 "
0.0096250: SQL executed
0.0002019: Total rows: 32
0.0002129: Rows fetched
0.0003281: Returning raw data
0.0010099: Checked the active modifiers
0.0037611: Loaded "modChunk" with name "tpl.msProducts.row"
0.0097723: Loaded options for products
0.0000191: Returning processed chunks
0.0680981: Total time
16 515 072: Memory usage
у меня minishop версии 2.3, может в этом дело?
Виталий
10 января 2017, 13:58
0
Привет!
Чтобы не создавать новую тему пишу здесь, вопрос тот же
Пробую фильтровать по опциям товара, которые создаются в настройках minishop2. Не плагинам!
Создал характеристику множественный список HDsizeTV с одним из вариантов 720p HD
и хочу фильтровать по этой характеристике
[[!msProducts?
    &parents=`27` 
	&includeThumbs=`235x235`
    &showLog=`1`
	&optionFilters=`{"HDsizeTV":"720p HD"}`
]]
но ничего не выводит
0.0000648: xPDO query object created
0.0001709: leftJoined msProductData as Data
0.0001340: leftJoined msVendor as Vendor
0.0013409: leftJoined msProductFile as 235x235
0.0008750: leftJoined msProductOption as HDsizeTV
0.0000050: Grouped by msProduct.id
0.0001221: Added selection of msProduct: SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
0.0000441: Added selection of msProductData: `sku_id`, `article`, `sku_name`, `default`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`, `availability`
0.0000360: Added selection of msVendor: `name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`
0.0000279: Added selection of msProductFile: `url` as `235x235`
0.0015800: Processed additional conditions
0.0023448: Added where condition: class_key=msProduct, 0(Array), msProduct.parent:IN(27,140,189,245,255,256,353,354,355,356,357,374,375,376,382,383,416,420,438,439,440,450,486,504,510,511,576,598,599,623,624,649,670,688,692,693,694,750,751,752,778,780,783,800,811,824,842,843,845,852,910,913,914,925,926,935,940,1052,1054,1093,1057,1107,1108,1109,1120,1121,1126), msProduct.published=1, msProduct.deleted=0
0.0001099: Sorted by msProduct.id, ASC
0.0000050: Limited to 10, offset 0
0.0005281: SQL prepared "SELECT SQL_CALC_FOUND_ROWS `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`sku_id`, `Data`.`article`, `Data`.`sku_name`, `Data`.`default`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Data`.`availability`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties`, `235x235`.`url` as `235x235` FROM `modx_site_content` AS `msProduct` LEFT JOIN `modx_ms2_products` `Data` ON `msProduct`.`id`=`Data`.`id` LEFT JOIN `modx_ms2_vendors` `Vendor` ON `Data`.`vendor`=`Vendor`.`id` LEFT JOIN `modx_ms2_product_files` `235x235` ON `235x235`.`product_id` = `Data`.`sku_id` AND `235x235`.`parent` != 0 AND `235x235`.`path` LIKE '%/235x235/' LEFT JOIN `modx_ms2_product_options` `HDsizeTV` ON `HDsizeTV`.`product_id`=`Data`.`id` AND `HDsizeTV`.`key`='HDsizeTV' WHERE  ( `msProduct`.`class_key` = 'msProduct' AND `HDsizeTV`.`value` = '720p HD' AND `msProduct`.`parent` IN (27,140,189,245,255,256,353,354,355,356,357,374,375,376,382,383,416,420,438,439,440,450,486,504,510,511,576,598,599,623,624,649,670,688,692,693,694,750,751,752,778,780,783,800,811,824,842,843,845,852,910,913,914,925,926,935,940,1052,1054,1093,1057,1107,1108,1109,1120,1121,1126) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 )  GROUP BY msProduct.id ORDER BY msProduct.id ASC LIMIT 10 "
0.0029981: SQL executed
0.0001061: Total rows: 0
0.0000129: Rows fetched
0.0000141: Returning raw data
0.0115149: Total time
15 204 352: Memory usage
Виталий
22 декабря 2016, 09:41
2
+1
Спасибо, Евгений!

тоже думал в этом направлении

Павел подсказал такое решение:
[[!pdoPage?
		&element=`msProducts`
		 &select=`["ROUND(((old_price - price) / old_price) * 100) as price_percentage"]`
		&sortby=`price_percentage`
		&sortdir=`DESC`
	]]
Виталий
13 декабря 2016, 09:56
0
Вопрос не решен. По-прежнему есть необходимость это сделать. Неужели это ненужная функция? Готов в разумных пределах профинансировать написание плагина!
Виталий
10 декабря 2016, 13:07
0
Да, я тоже понимаю, что эти вычисления нужно писать в базу данных, но как это сделать не знаю… А как быть с уже добавленными товарами? Пересохранять?