I have added a form to cs-cart that captures some user data and emails it back to me.
Now I want to add a button that opens a modal window with the form I created inside. I added the following button, but what goes on the "but_onclick" to open the modal window with my form?
{include file="buttons/button.tpl" but_name="" but_text="Enter Extra Data" but_onclick="" but_role="button" but_meta="cm-process-items btn"}
The form opens up in the modal window, but when I hit submit it redirects to a thank you page. How could I change it to give me the thank you message inside the modal window after form is submitted?
Your reponse helped me isolate the issue. I hope this helps someone having the same issue.
Act is not required since it is not used in the popupbox.tpl template. At least in the default theme
Another question.
The form opens up in the modal window, but when I hit submit it redirects to a thank you page. How could I change it to give me the thank you message inside the modal window after form is submitted?
More complex changes are required in this case. You should post form with ajax and put thank you message to notification
We had the same question and thanks to you it works.
We discovered 2 other problems:
We had to add content='' to the code line
It only works with store-owned forms and they should not be shared with other stores (we run multiple sites). If you create a form shared with other stores, the processing will not work.
I am trying to use this solution to add a button to my product page right underneath or next to the 'add to cart' button that sends people to a form I created, that will let them reserve the item (this is a temporary solution).
In this filepath: design/themes/[YOUR THEME]/templates/common/product_data.tpl I updated the file as following (where 123 is is my page ID for the form):
I am trying to use this solution to add a button to my product page right underneath or next to the 'add to cart' button that sends people to a form I created, that will let them reserve the item (this is a temporary solution).
In this filepath: design/themes/[YOUR THEME]/templates/common/product_data.tpl I updated the file as following (where 123 is is my page ID for the form):
After this line: {include file="buttons/add_to_cart.tpl" but_id="button_cart_`$obj_prefix``$obj_id`" but_name="dispatch[checkout.add..`$obj_id`]" but_role=$but_role block_width=$block_width obj_id=$obj_id product=$product but_meta=$add_to_cart_meta}
I also added two new language variables my_form_button_text and my_form_header.
I manually deleted the cache. Nothing happens.
Any ideas?
I am using MVE 4.12.1
I have it working now, I had to include &come_from=F , by that I mean id="XX&come_from=F''
Also it wasn't pasted in quite the right place.
I have a few additional loose ends still:
1. At the moment I have changed the product_data.tpl core file. I would prefer to make this change in the my_changes add-on but it didn't work when I saved it in the .../app/addons/my_changes folder. Is that the right path?
Thanks eCom. Hooks are not something I'm familiar with so I will leave it in the core files for now.
Also, in case anyone else wants to try this, in the end what I did was add a 'reserve' button next to the 'add to cart' button that went to a 'forms' page, I didn't use the pop-up since I didn't understand the code enough to get it to work. Since I use three languages on the site, I defined 'my_form_button_text' as a language variable so the button changes language depending on which language the user has picked.
This is the final code that I pasted in to my product_data.tpl core file: