Total 166 comments

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
Claudiu Ro
16 january 2019, 12:10
0
Thanks, but I need to reuse the solution. So the ID is not to good for me. I need at least a part of the Resource title. Thatțs why I need to use WHERE.
Василий Наумкин
16 january 2019, 11:40
0
You can specify any parent by id:
[[!pdoResources?
    &parents=`10`
]]
or
[[!pdoResources?
    &parents=`10,12`
]]
to get children from multiple parents
Fabian Christen
29 june 2018, 16:24
0
Fast and precise as always!
Thank you very much.
Василий Наумкин
29 june 2018, 16:21
0
Yes, you can extend this class and change any method — see russian example.

Also you can improve this validator and send PR to miniShop2 repository =)
Василий Наумкин
14 march 2018, 22:12
+2
Great!

But I suggest you to check the state of your users:
case 'OnBeforeUserFormSave':
	if ($mode != 'new') {
		return;
	}
	// ...
break;
Otherwise you could override their «extended» field on usual profile editing.

And if you would like to update «extended», it is very easy too:
if (...) {
	$extended = $user->Profile->get('extended');
	$extended['key'] = 'value';
	$user->Profile->set('extended', $extended);
}

Now you know how to control any data of your users. With Office, or without it.
Fabian Christen
14 march 2018, 22:04
+2
Thank you Василий Наумкин!

It worked with:
<?php

$groups = array(
    'extendedcompany' => 'Company'
);

if ($modx->context->key != 'mgr') {
    switch ($modx->event->name) {
        
        case 'OnBeforeUserFormSave':
            if (!empty($_POST['extendedcompany'])  || array_key_exists($_POST['extendedcompany'], $groups)) {
            // etwas dem profil hinzufügen    
            $fields['company'] = $_POST['extendedcompany'];
            $user->Profile->set('extended',$fields);
            break;
            }

    }
    
}
Василий Наумкин
14 march 2018, 20:28
+1
Hello, Fabian! If you are talking about filling fields on registration, you need to create plugin for it, because Office do not require anything but email.

You can try to read it here. It is an example of selecting of user group, but requiring of extended field is very similar.
dfXie
12 june 2017, 12:52
+1
Thanks a lot for your kind reply.
Василий Наумкин
11 june 2017, 08:00
0
Sorry, didn`t see your question.

Yes, files permissions is the first thing to check in such cases =)
dfXie
10 june 2017, 13:46
0
This problem is solved.
I have checked permission of formit/tmp. It was 0755. So I could not moved file to destination.
Trying
09 march 2016, 13:39
0
And this also works:
return $this->pdoTools->getChunk($tpl, $row, $this->pdoTools->config['fastMode']) . "\n";
Trying
09 march 2016, 12:42
0
Ok, so looking at how it was implemented in Wayfinder, I have just changed this line in pdomenu.class:

return $this->pdoTools->getChunk($tpl, $row, $this->pdoTools->config['fastMode']);
to this bit of code:
$tploutput = $this->pdoTools->getChunk($tpl, $row, $this->pdoTools->config['fastMode']);
$newline = "\n";
return $tploutput . $newline;
Ant it works. Probably it is possible to make it more elegant and simple, but since I know nothing in these things so can only mimic what is done elsewhere.

Василий Наумкин
08 march 2016, 21:34
0
Nope.

pdoMenu has its own class that extends pdoFetch. Menu generation is complicate so it has its own logic, without &outputSeparator.
Алексей
08 march 2016, 21:08
0
it use in every snippet from «pdoTools» package, because it get data from mysql Data Base by dint of class pdoFetch. In class pdoFetch it setting place this: github.com/bezumkin/pdoTools/blob/master/core/components/pdotools/model/pdotools/pdofetch.class.php#L163