V3.0.4: Submit Form To An External Site From The Admin Panel


I have Cs-Cart Professional 3.0.4 with an admin panel template modification “payment_info.override.tpl”. This will show some additional information on the selected order detail page, in the payment info section, which is working nicely. In that section I am also trying to submit a form to a new browser tab (form attribute target=“_blank” does not work here for some reason) to an external webpage to gather some additional information about the payment. However, clicking the submit button just opens a blank admin panel page with the admin panel base url. Only to “home icon” is visible. See the attached screenshot for more.

The problem is somewhere here:

<br />
	 <form name="check_payment" action="https://some.external.address.com" method="post" target="_blank"><br />
	 <input name="MERCHANT_ID" type="hidden" value="{$processor_data.params.svm_merchant_id}" /><br />
	 <input name="ORDER_NUMBER" type="hidden" value="{$order_info.order_id}" /><br />
	 <input name="AUTHCODE" type="hidden" value="{$order_info.payment_info.check_payment_authcode}" /><br />
	 <input name="VERSION" type="hidden" value="2" /><br />
	 <input name="CULTURE" type="hidden" value="fi_FI" /><br />
	 <input name="submit_payment_check" type="submit" value="Check payment" /><br />
	 </form><br />

```<br />
<br />
How should I implement the submit button if the type="submit" does not work here?<br />
<br />
Thanks in advance.<br />
<br />
Br,<br />
Simo<p><a href="">Capture_admin_panel_after_submitting_form.PNG</a></p>

Not clear what you're trying to do with a separate tab. If all you want to do is collect the info and send it somewhere, just add the elements in their own container like name=“my_stuff[merchant_id]” and then use an orders.pre.php controller in my_changes to capture the $_REQUEST['my_stuff'] and send it where ever you want.

Yes, that is exactly what I want. I dont fully understand all the controllers and templates yet and how they work together, so I totally forgot that the .tpl does not actually send the data I have in the form. The controller is needed for that…right. Hmm…but should it be post controller rather than pre controller?

Thanks for the tip, much appreciated! I will give it a “trial and error” type of approach. :)

In most controllers that deal with POST data, the controller redirects to itself after it completes (I.e. before the post controller operation). So I always use a 'pre' when dealing with POSTed data I want to capture or work with that is not handled by other PHP hooks.