PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

set action="" Magento integration/Wordpress Page Template

  1. Hi, first of, great contribution guys, really excellent work well done !

    But I am having a bit of a problem ? I made a Wordpress Page Template, http://www.3am.co.za/blog/wp-submit/ and the form works, now I am using curl to get content from Wordpress into Magento and now my form does not submit http://www.3am.co.za/parties/submit-your-party ? If I can set the action, I'm almost sure it will work, perhaps you have a better suggestion ?

    Hope you can help me, I'm itching to see it work :)
    Thanks in advance,
    Riaan

    Posted 14 years ago on Thursday September 9, 2010 | Permalink
  2. lol, seem to have solved it,

    in wordpress, wp-content/themes/default/functions.php

    add:

    //Gravit Forms .. replace Action="" for Event submissions page
    add_filter("gform_form_tag", "form_tag", 1, 2);
    function form_tag($form_tag, $form){
    $form_tag = preg_replace("|action='(.*?)'|", "action='/blog/wp-submit/'", $form_tag);
    return $form_tag;
    }
    

    1 is your form ID

    Posted 14 years ago on Thursday September 9, 2010 | Permalink
  3. I'm not familiar with the Magento/WordPress integration so I can't guarantee this will work... but you can use a filter to set the form action. It uses the gform_form_tag filter.

    Here is an example:

    <?php
    add_filter("gform_form_tag", "form_tag", 10, 2);
    function form_tag($form_tag, $form){
    $form_tag = preg_replace("|action='(.*?)'|", "action='custom_handler.php'", $form_tag);
    return $form_tag;
    }
    ?>

    The above code changes the form action to custom_handler.php. In your case you would change the action to point to the page where it should be able to process.

    No guarantees will this work, the Magento integration seems kinda cumbersome in it's implementation using curl like that.

    Posted 14 years ago on Thursday September 9, 2010 | Permalink
  4. Carl, thank you for your reply, and your time

    That is exactly the solution I used and it works albeit a bit w0nKy

    If the user enters all the fields correctly, it submits the post and adds the data to a new post, however if there is a filed missing, they get directed to the un-styled template page, I have submitted a more detailed report here, can you merge the threads if that is easier for you ?

    http://forum.gravityhelp.com/topic/gravity-form-embed-in-post-or-page-template-submit-not-working#post-9843

    Thanks again, Carl

    Riaan

    Posted 14 years ago on Tuesday September 14, 2010 | Permalink
  5. @carl, @administrator

    Would you consider setting the action="" as a Feature request ? I don't know if it would fit in with your development road plan or even if you think it would be useful, but I would gladly test it for you

    Riaan

    Posted 14 years ago on Tuesday September 14, 2010 | Permalink