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!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
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
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
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
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:



After pressing F5 all is ok:

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