Jump to content

[solved] How to change input type="submit" function on product page


Arkataev

Recommended Posts

Hi!

 

I input a piece of code in Product.tpl:

 

<form  id=f1 name=f1 method="POST" action="http://www.oplata.info/asp/pay.asp">
...
<table cellpadding="3" cellspacing="1" border="0"><tr>
<!--<td><input type=text name=in size=7 value="0.5" readonly></td> -->
<td>
<select size=1 style="width:130px;" name="type_curr">
 <option value="WMZ">WMZ</option>
 <option value="QSR">QIWI</option>
 <option value="WMR">WMR</option>
 <option value="WME">WME</option>
 <option value="WMU">WMU</option>
<option value="PCR"></option>
</select>
</td>
<td>
<input type="submit" class="buybutton" value="Buy">
</td>
</tr><tr>
<input type="hidden" name="id_goods" value={$product->reference|escape:'htmlall':'UTF-8'}>
<input type="hidden" name="id_agent" value=0>
<input type="hidden" name="fail_page" value="#">

instead of the original "add to cart" button. This should redirect user to a side resource to continue payment. But on clicking "submit" (Buy) button it redirects to a "cart" page.

 

Please, could anyone give me a hint where I can fix this?

 

[sOLVED]

Edited by vekia (see edit history)
Link to comment
Share on other sites

Hi! I managed to find out that any other form that has input type ="submit" button does exactly the same - forwards to cart page. I uninstalled cart block completely, the store is in the catalog mode, all cart functionality disabled.

But "submit" keeps doing all the same.

I suppose there has to be something somewhere in a controller or maybe in js.

Edited by vega17 (see edit history)
Link to comment
Share on other sites

I have disabled cart functionality completely, there is now "Add to cart" at all on product page. Instead of it I want to put my own form this type:

<form method="post" action="productcontroller.php">
  <input type="text" name="aid" value="Enter your ID" size="30">
  <input name="Submit" type=submit value="OK">
</form>

I want this form to send information to productcontroller. php where it will be processed with the proper php. But when I click OK ("submit") It still forwards to www.myshop/cart page as If I was clicking "add to cart" buttton

Edited by vega17 (see edit history)
Link to comment
Share on other sites

actually that was my mistake:) I missed <form id="buy_block"> on line 299 in product.tpl. that included a link to a cart page. That thing had been spoiling all my attempts. :) To make my form work properly I just needed to change the corresponding link in that line..

The example is here (russian language)

Edited by vega17 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...