I use sessions to transfer parameters from K2 to Chronoforms 6. But K2 is executed later than Chronoforms and therefore the variables are passed empty. (plugins ordering - Chronoforms is the last plugin - doesn't help). At first visit the page, CFs textfields are empty. And they are fills after refresh of the page. I think it's becouse of order. How to make chronoform's execution after k2?
I use shortcode {chronoforms6}myform{/chronoforms6} in K2 item.
I use shortcode {chronoforms6}myform{/chronoforms6} in K2 item.
Hi ByBus,
What kind of variables you are trying to access ?
Best regards
What kind of variables you are trying to access ?
Best regards
I want to get variables from extrafields:
in item.php:
in chronoforms php block:
in item.php:
<?php
$session = JFactory::getSession();
$session->set("articul", $this->item->extraFields->articul->value);
$session->set("nametxt", $this->item->extraFields->dostoinstva->value);
$session->set("tsena", $this->item->extraFields->tsena->value);
?>
in chronoforms php block:
$session = JFactory::getSession();
$art = $session->get("articul");
$dostoin = $session->get("nametxt");
$ts = $session->get("tsena");
$this->data['prjname'] = $art.' - '.$dostoin.' - '.$ts.'руб';
What happens when you use
After the code ? does it return the art value inside the form ?
You could also set the values in the $_POST
Best regards
echo $art;
After the code ? does it return the art value inside the form ?
You could also set the values in the $_POST
Best regards
I've placed echo $art; in CF
result:
[IMG]https://cdn1.savepice.ru/uploads/2017/11/29/ecdd3a2ef32013715cd0393cbc891a3c-full.jpg[/IMG]
[IMG]https://cdn1.savepice.ru/uploads/2017/11/29/b0c001cf0db556ad3674e08f50e5af20-full.jpg[/IMG]
After pressing F5 all is ok:
[IMG]https://cdn1.savepice.ru/uploads/2017/11/29/6a7e732b76b57b5d557713d409879223-full.jpg[/IMG]
[IMG]https://cdn1.savepice.ru/uploads/2017/11/29/fcd2bcd3ffd222c931ec1bb325a5874b-full.jpg[/IMG]
$session = JFactory::getSession();
$art = $session->get("articul");
$dostoin = $session->get("nametxt");
$ts = $session->get("tsena");
$this->data['prjname'] = $art.' - '.$dostoin.' - '.$ts.'руб';
echo $art;
result:
[IMG]https://cdn1.savepice.ru/uploads/2017/11/29/ecdd3a2ef32013715cd0393cbc891a3c-full.jpg[/IMG]
[IMG]https://cdn1.savepice.ru/uploads/2017/11/29/b0c001cf0db556ad3674e08f50e5af20-full.jpg[/IMG]
After pressing F5 all is ok:
[IMG]https://cdn1.savepice.ru/uploads/2017/11/29/6a7e732b76b57b5d557713d409879223-full.jpg[/IMG]
[IMG]https://cdn1.savepice.ru/uploads/2017/11/29/fcd2bcd3ffd222c931ec1bb325a5874b-full.jpg[/IMG]
This topic is locked and no more replies can be posted.