- Posts: 5
- Thank you received: 0
Contact form in product page - checkFields is not defined
9 years 9 months ago #258532
by thdev
Contact form in product page - checkFields is not defined was created by thdev
Hi,
I try to include a contact form (quote) inside my product page because I don't want a step with a button but directly my form on the product page.
I proceed, in my template override like this to include contact.php overrided to:
But I got that error
The function contact() from ProductViewProduct doesn't seems to be loaded and I can't load it with $this->contact() (all $this data are erased).
Can you help me integrate the contact form inside my product page please. Thank You.
I try to include a contact form (quote) inside my product page because I don't want a step with a button but directly my form on the product page.
I proceed, in my template override like this to include contact.php overrided to:
Code:
$this->setLayout('contact');
echo $this->loadTemplate();
But I got that error
Uncaught ReferenceError: checkFields is not defined
at HTMLButtonElement.onclick (circuit-voyage-test:734)
The function contact() from ProductViewProduct doesn't seems to be loaded and I can't load it with $this->contact() (all $this data are erased).
Can you help me integrate the contact form inside my product page please. Thank You.
Please Log in or Create an account to join the conversation.
9 years 9 months ago #258534
by nicolas
Replied by nicolas on topic Contact form in product page - checkFields is not defined
Hi,
Instead of doing
which requires $this->contact() to be called before, you should rather use:
Note however that you can't have a form instead a form in HTML, that's not valid and it won't work.
So make sure that you load the contact form outside of the product page form.
Instead of doing
Code:
$this->setLayout('contact');
echo $this->loadTemplate();
Code:
js = '';
echo hikashop_getLayout('product', 'contact', $this->params, $js);
So make sure that you load the contact form outside of the product page form.
Please Log in or Create an account to join the conversation.
9 years 9 months ago #258733
by thdev
Replied by thdev on topic Contact form in product page - checkFields is not defined
Thank you,
Indeed the both solutions are working outside the product page form.
Indeed the both solutions are working outside the product page form.
Please Log in or Create an account to join the conversation.
Time to create page: 0.173 seconds