Skip to Content
Menu
This question has been flagged
3 Replies
7900 Views

Hello, I want to put a pre-made Odoo form on another platform, such as Wordpress to maximize lead generation. But when I create an API link on Odoo, put it on another page, and when the user submit, Odoo can't seem to get the answer (due to CORS error). If anyone has tried this before, please help me with it. Thanks

Avatar
Discard
Best Answer

Hi. I've dealt with this before and came to the following conclusions regards the options you have.

  1. Embed the form into your Wordpress site using an Iframe. 
    - First create a dedicated contact form page which has hidden header and footer in Odoo.
    Just create a new contact form then add this custom code after the first line as shown:
    <xpath expr="//header" position="before">
    <t t-set="no_header" t-value="True"/>
    <t t-set="no_footer" t-value="True"/>
    </xpath>
    -Finally, create the iframe embed code for your Wordpress site pointing to the dedicated Odoo contact form URL. You can use something like this to help:  iFrame Generator - Free Online iFrame Code Maker Tool (iframe-generator.com)
    -
    Note: You will likely need to setup your web server (proxy) with correct security header for X-FRAME-OPTIONS to allow external embedding for specific URL.
    If NGINX, use this:  How to Configure X-Frame-Options for NGINX - Fedingo
  2. Alternatively, use a Wordpress forms plugin which you may be doing already such as Gravity Forms, WPForms or Ninja Forms. Use Zapier to connect them together easily without any code.
    Connect your Gravity Forms to Odoo ERP Self Hosted integration in 2 minutes | Zapier
    You can do something like:
    When a form is submitted in Wordpress > Create an Odoo lead and map the relevant data across.
    Zapier is free if used for up to 100 tasks per month.

Hope that helps. Best of luck!

Chris

Avatar
Discard
Author

Hi Chris,
Thank for the detail instruction. I'm currently working with another Front-end Developer to try your way. Really appreciate your help.