Jevon Boyce

Jevon Boyce

С нами с 23 ноября 2016; Место в рейтинге пользователей: #1455
Jevon Boyce
31 декабря 2019, 18:55
0
I used Google translate to replaced most of its lexicons. I tried using it but it didn't fit what I wanted. It also uses a Russian map I believe and that isn't necessary for me either.

This is why I want to write my own handler.
Jevon Boyce
04 июня 2019, 21:33
0
Is there any docs that shows all of the possible operators for the where clause?
Jevon Boyce
04 июня 2019, 21:31
0
It is stored in JSON format. Here is an example from the database

[{"MIGX_id":"1","store_countries":"bb","dealstartdate":"2019-05-01 00:00:00","dealenddate":"2019-05-31 23:45:00","published":"1"}]
Jevon Boyce
03 июня 2019, 22:38
0
I'm sorry but I'm not getting the Ajax pagination to work. Can you explain to me where I'm going wrong?
[[!mFilter2?
    &parents=`[[*id]]`
    &paginator=`pdoPageWrapper@pagepagination`
    &element=`msProducts`
    &class=`msProduct`
    &sortold=`ms|price:desc`
    &sort=`resource|menuindex:asc`
    &limit=`3`
    &tplOuter=`nd.tpl.mFilter2.outer`
    &tpl=`nd.tpl.msProducts.row`
    &tplFirst=`nd.Firsttpl.msProducts.row` 
    &tpl_n3=`nd.Thirdtpl.msProducts.row` 
    &tplLast=`nd.Lasttpl.msProducts.row`
    &includeThumbs=`246x246`
]]
Snippet
<?php
$snippet = $modx->getOption('snippet', $scriptProperties, 'pdoPage');
$output = $modx->runSnippet($snippet, $scriptProperties);

$total = $modx->getPlaceholder('page.total');
$pages = $modx->getPlaceholder('pageCount');
$page = $modx->getPlaceholder('page');

$from = (($page - 1) * $limit) + 1;
$to = (($page - 1) * $limit) + $limit;
if ($to > $total) {
    $to = $total;
}

$modx->setPlaceholder('page.from',$from);
$modx->setPlaceholder('page.to',$to);

return $output;
Jevon Boyce
28 мая 2019, 19:18
0
Thank you, this works.

I'm using the pdoPageWrapper with the mFilter2 snippet. I have created to placeholders with the snippet that you wrote.
<?php

$snippet = $modx->getOption('snippet', $scriptProperties, 'pdoPage');
$output = $modx->runSnippet($snippet, $scriptProperties);

$total = $modx->getPlaceholder('page.total');
$pages = $modx->getPlaceholder('pageCount');
$page = $modx->getPlaceholder('page');

$from = (($page - 1) * $limit) + 1;
$to = (($page - 1) * $limit) + $limit;
if ($to > $total) {
    $to = $total;
}

$modx->setPlaceholder('page.from',$from);
$modx->setPlaceholder('page.to',$to);

return $output;
But now the placeholders doesn't work with the ajax mode. How can I get this to work with mFilter2 Ajax mode?