Buy Now
Sign in

Execute chronoform after K2

ByBus , November 28 2017
B
ByBus

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.

admin

Hi ByBus,

What kind of variables you are trying to access ?

Best regards

Max
If your main question got answered then please mark the answer using the button!

B
ByBus

I want to get variables from extrafields:

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.'руб';

admin

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

Max
If your main question got answered then please mark the answer using the button!

B
ByBus

I've placed echo $art; in CF

				
$session = JFactory::getSession();
$art = $session->get("articul");
$dostoin = $session->get("nametxt");
$ts = $session->get("tsena");
$this->data['prjname'] = $art.' - '.$dostoin.' - '.$ts.'руб';
echo $art;


result:
https://cdn1.savepice.ru/uploads/2017/11/29/ecdd3a2ef32013715cd0393cbc891a3c-full.jpg
https://cdn1.savepice.ru/uploads/2017/11/29/b0c001cf0db556ad3674e08f50e5af20-full.jpg

After pressing F5 all is ok:
https://cdn1.savepice.ru/uploads/2017/11/29/6a7e732b76b57b5d557713d409879223-full.jpg
https://cdn1.savepice.ru/uploads/2017/11/29/fcd2bcd3ffd222c931ec1bb325a5874b-full.jpg

B
ByBus

M100 is $art
Could you explain how to do this with POST
Trying to make like this:
in k2

				JFactory::getApplication()->input->set('vari', 'value');
				


in CF
				echo JFactory::getApplication()->input->get('vari');
				


But vari is empty