Answer the question
In order to leave comments, you need to log in
How to create plugin with shopkeeper3 method call in modx Revo?
Hi people.
Full question:
I have shopkeeper3, modx REVO. For products, the price depends on the option chosen. (1l - 100 r, 2l - 200 r, 3l - 300 r..). I found the answer like this, but I don’t have enough experience to understand what exactly, how and where to do it:
Создаем плагин itemPrice
текст:
<?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 '';
Выбираем для плагина системное событие "OnSHKgetProductPrice"
Answer the question
In order to leave comments, you need to log in
in your admin panel, go to /manager/?a=element/plugin/create&category=0
, give an arbitrary name, in the "system events" tab, look for and mark "OnSHKgetProductPrice".
Paste your code into the text of the plugin and save it.
Your plugin should work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question