Contact form in product page - checkFields is not defined

  • Posts: 5
  • Thank you received: 0
7 years 10 months ago #258532

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:

$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.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 10 months ago #258534

Hi,

Instead of doing

$this->setLayout('contact');
                echo $this->loadTemplate();
which requires $this->contact() to be called before, you should rather use:
js = '';
echo hikashop_getLayout('product', 'contact', $this->params, $js);
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.

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
7 years 10 months ago #258733

Thank you,
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.053 seconds
Powered by Kunena Forum