Total 170 comments

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
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.