Jump to content

[SOLVED] Bankwire functional but impossible to place order


Niltz

Recommended Posts

Hi everybody,

 

I have the Bankwire module fully functional but once I try to place the order and get access to the bank account details nothing happens. I inspected the submit button with Chrome's element inspector and I do get an error after clicking the button but I don't know what's causing it nor if it's the cause of the problem. I've attached a printscreen of Chrome's console.

 

The configuration is right, I even changed the country restriction to see if it would hide the bankwire module and everything went fine. So yeah, the configurations are alright.

 

So that's it: I click the submit button, and nothing happens.

 

By the way, I'm using Prestashop 1.5.6.0.

 

Hope anyone can help me here!

post-731453-0-23265100-1416785376_thumb.jpg

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

I've been trying some fixes and I've found out that it's definitely something with payment_execution.tpl. I had created an override wich had a new structure with some extra divs to follow the site custom theme. So, I decided to put the original payment_execution.tpl inside the folder to test it and it worked fine again.

 

I've been analysing the payment_execution.tpl override I created but I don't see anything's wrong with it.

 

But I do ask myself if having divs inside the form action can disable the button function. Can this be it?

 

Here is the original code:

{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2013 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

{capture name=path}{l s='Bank-wire payment.' mod='bankwire'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}

<h2>{l s='Order summary' mod='bankwire'}</h2>

{assign var='current_step' value='payment'}
{include file="$tpl_dir./order-steps.tpl"}

{if $nbProducts <= 0}
	<p class="warning">{l s='Your shopping cart is empty.' mod='bankwire'}</p>
{else}

<h3>{l s='Bank-wire payment.' mod='bankwire'}</h3>
<form action="{$link->getModuleLink('bankwire', 'validation', [], true)|escape:'html'}" method="post">
<p>
	<img src="{$this_path_bw}bankwire.jpg" alt="{l s='Bank wire' mod='bankwire'}" width="86" height="49" style="float:left; margin: 0px 10px 5px 0px;" />
	{l s='You have chosen to pay by bank wire.' mod='bankwire'}
	<br/><br />
	{l s='Here is a short summary of your order:' mod='bankwire'}
</p>
<p style="margin-top:20px;">
	- {l s='The total amount of your order is' mod='bankwire'}
	<span id="amount" class="price">{displayPrice price=$total}</span>
	{if $use_taxes == 1}
    	{l s='(tax incl.)' mod='bankwire'}
    {/if}
</p>
<p>
	-
	{if $currencies|@count > 1}
		{l s='We allow several currencies to be sent via bank wire.' mod='bankwire'}
		<br /><br />
		{l s='Choose one of the following:' mod='bankwire'}
		<select id="currency_payement" name="currency_payement" onchange="setCurrency($('#currency_payement').val());">
			{foreach from=$currencies item=currency}
				<option value="{$currency.id_currency}" {if $currency.id_currency == $cust_currency}selected="selected"{/if}>{$currency.name}</option>
			{/foreach}
		</select>
	{else}
		{l s='We allow the following currency to be sent via bank wire:' mod='bankwire'} <b>{$currencies.0.name}</b>
		<input type="hidden" name="currency_payement" value="{$currencies.0.id_currency}" />
	{/if}
</p>
<p>
	{l s='Bank wire account information will be displayed on the next page.' mod='bankwire'}
	<br /><br />
	<b>{l s='Please confirm your order by clicking "Place my order."' mod='bankwire'}.</b>
</p>
<p class="cart_navigation" id="cart_navigation">
	<input type="submit" value="{l s='Place my order' mod='bankwire'}" class="exclusive_large" />
	<a href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html'}" class="button_large">{l s='Other payment methods' mod='bankwire'}</a>
</p>
</form>
{/if}

And here is my custom code:
 

{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2013 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

{capture name=path}{l s='Bank-wire payment.' mod='bankwire'}{/capture}
{include file="$tpl_dir./breadcrumb.tpl"}

{*
*<h2>{l s='Order summary' mod='bankwire'}</h2>
*}

{assign var='current_step' value='payment'}
{include file="$tpl_dir./order-steps.tpl"}

{if $nbProducts <= 0}
<p class="warning">{l s='Your shopping cart is empty.' mod='bankwire'}</p>
{else}
<div id="bankwire">

<h3>{l s='Bank-wire payment.' mod='bankwire'}</h3>
<form action="{$link->getModuleLink('bankwire', 'validation', [], true)|escape:'html'}" method="post">

  <div id="bankwire_description">
    <p> <img src="{$this_path_bw}bankwire.jpg" alt="{l s='Bank wire' mod='bankwire'}" width="86" height="49" style="float:left; margin: 0px 10px 5px 0px;" /> {l s='You have chosen to pay by bank wire.' mod='bankwire'} <br/>
      <br />
      {l s='Here is a short summary of your order:' mod='bankwire'} </p>
  </div>
  
  <div id="bankwire_summary">
    <p style="margin-top:20px;"> - {l s='The total amount of your order is' mod='bankwire'} <span id="amount" class="price">{displayPrice price=$total}</span> {if $use_taxes == 1}
      {l s='(tax incl.)' mod='bankwire'}
      {/if} </p>
    <p> -
      {if $currencies|@count > 1}
      {l s='We allow several currencies to be sent via bank wire.' mod='bankwire'} <br />
      <br />
      {l s='Choose one of the following:' mod='bankwire'}
      <select id="currency_payement" name="currency_payement" onchange="setCurrency($('#currency_payement').val());">
        
			{foreach from=$currencies item=currency}
				
        <option value="{$currency.id_currency}" {if $currency.id_currency == $cust_currency}selected="selected"{/if}>{$currency.name}</option>
        
			{/foreach}
		
      </select>
      {else}
      {l s='We allow the following currency to be sent via bank wire:' mod='bankwire'} <b>{$currencies.0.name}</b>
      <input type="hidden" name="currency_payement" value="{$currencies.0.id_currency}" />
      {/if} </p>
  </div>

  <div id="bankwire_info">
    <p> {l s='Bank wire account information will be displayed on the next page.' mod='bankwire'} <br />
      <br />
      <b>{l s='Please confirm your order by clicking "Place my order."' mod='bankwire'}.</b> </p>
  </div>
  
  </div>
  <p class="cart_navigation" id="cart_navigation">
    <input type="submit" value="{l s='Place my order' mod='bankwire'}" class="exclusive_large" />
    <a href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html'}" class="button_large">{l s='Other payment methods' mod='bankwire'}</a> </p>
</form>
{/if} 
Link to comment
Share on other sites

That button should not be triggered with javascript, by default. Can you check if it works with the default template?

Sorry Nemo1, didn't see your reply there. Yes, I just tried the default template and it worked since it uses the unaltered payment_execution.tpl file.

 

So yeah, the problem is the custom file. I just don't understand why.

Link to comment
Share on other sites

Man, I had a problem with the order of the div and the form action: basically I had this:
 

<div id="bankwire">
<form action="{$link->getModuleLink('bankwire', 'validation', [], true)|escape:'html'}" method="post">
</div>
</form>

It's working again. Guess I need to get myself a lot more sleep :D

 

Thanks anyway!

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...