How to create a plugin with the method call shopkeeper3 in modx Revo?

Hello, people.

Full question:
I shopkeeper3, modx REVO. The price depends on the option selected. (1l - 100 R, 2n - 200 R, 3l - R 300..). Found the answer, but not enough experience to understand what exactly how and where you need to do:

Create plugin itemPrice
text:
<?php
$output = 0;
if(!empty($_POST['itemPrice']) && is_numeric($_POST['itemPrice'])){
$output = $_POST['itemPrice'];
}else{
$output = $modx->getOption('price',$scriptProperties,0);
}
$modx->event->_output = ";
$modx->event->output($output);
return ";

Select for a plugin system event "OnSHKgetProductPrice"


How and where to create a plugin and how to call the method "OnSHKgetProductPrice". As I understand this plugin will change the product price depending on options and send it to the trash. Just what I need. On the product page to price changes dynamically in the field [[*price]] in js when you select the corresponding checkbox. But the price is not transmitted in the basket, there is always $ 0.
March 23rd 20 at 19:17
1 answer
March 23rd 20 at 19:19
Solution
in the admin go to the address /manager/?a=element/plugin/create&category=0
give an arbitrary name, in the tab "system events" seek and mark "OnSHKgetProductPrice".
The text plugin to insert your code, save.
Your plugin should work.
Thank you, my good man. Helped. - Isabelle commented on March 23rd 20 at 19:22

Find more questions by tags ShopkeeperMODX