Total 180 comments

Fabian Christen
13 june 2019, 11:14
0
Thank you Vasily,

All 3 points are solved.
Point 3: I took the frontend javascript solution.

All the best
Fabian
Василий Наумкин
04 june 2019, 22:30
0
I don't think that store all values in one JSON TV is good idea for filtering resource.

Maybe it would better to split it to 3 separate TVs or miniShop2 options.
Jevon Boyce
04 june 2019, 21:33
0
Is there any docs that shows all of the possible operators for the where clause?
Jevon Boyce
04 june 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"}]
Василий Наумкин
04 june 2019, 07:44
0
You need to understand how MIGX stores data in database before you could filter it by &where.
Jevon Boyce
03 june 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;
Василий Наумкин
03 june 2019, 14:30
0
1. Office extra requires only email for registration, all other info you can add after it in the private office. But you can change it by custom system plugin, see an example here.

2. Just as any other field in the form. After it you need to specify new field in the &userFields property of msOrder:
[[!msOrder?
    &userFields=`{"gender":"gender"}`
    &...
]]
It will bind form field gender to profile of user in MODX.

3. I believe you could manage it with javascript on frontend, or with custom system plugin for msOnBeforeCreateOrder event that will check this new field on backend.
Василий Наумкин
28 may 2019, 22:15
0
mFilter2 have special option &paginator.

So
[[!mFilter2?
    &paginator=`pdoPageWrapper`
    &...
]]

How can I get this to work with mFilter2 Ajax mode?
Please, send all questions about paid extras to the modstore.pro support.
Jevon Boyce
28 may 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?
Василий Наумкин
26 may 2019, 07:20
0
You could just wrap your call with another snippet:
[[!pdoPageWrapper?
    &parents=`0`
    &limit=`5`
]]
[[!+page.nav]]

pdoPageWrapper:
<?php

$output = $modx->runSnippet('pdoPage', $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;
}

return $output . "<p>Showing $from to $to of $total ($pages pages)</p>";
Evgeniy
25 march 2019, 13:48
0
Incorrect link to minishop2.com in penultimate paragraph
Антон Тарасов
18 march 2019, 12:22
+1
Hi Ivan,

Thanks for this digest and your errorts!
Small issue:

SiteDashCpent 1.1.0-pl — backup archiving to reduce space and other fixes.
It seems this link and caption are wrong, here is proper variant: SiteDashClient 1.1.0-pl
Fabian Christen
22 january 2019, 11:06
+1
Thank you Vasily,
works like a charm.

best
Fabian
Василий Наумкин
21 january 2019, 16:29
0
Yes, you can use system event msOnSubmitOrder and return an error if something not good.

switch ($modx->event->name) {
    case 'msOnSubmitOrder':
        $cart = $order->ms2->cart->status();
        if ($cart['total_cost'] < 1000) { // Your amount
            return $modx->event->output([
                'success' => false,
                'message' => 'You need to add more products',
            ]);
        }
    }
}
Russian docs
Claudiu Ro
16 january 2019, 13:52
+1
OK. Good Idea! Thank you! I'll try.
Василий Наумкин
16 january 2019, 13:01
0
Then read docs of pdoField and use it with &topLevel or &top inside &parents.

Or write your custom snippet to get id of resources from its title.
Claudiu Ro
16 january 2019, 12:13
0
I'll use pdoResources at template level, and I want to apply this template to multiple categories. So I cannot access individual IDs