viger Posted October 3, 2013 Share Posted October 3, 2013 Hi! Please find here my last work Prestashop 1.5.0.17, but it should work an all 1.5 The module of payment by bank wire in prestashop is totally wrong, in my opinion. The bank wire is very useful and cheap, not fast, but often convenient. The problem that comes from the module of PS is that the bank wire is proposed only if the customer selects in the front office the currency we have agreed to receive. So, if we only accept Euros (my case) and we emit invoices in Euros only, and the customer displays the shop in dollars, the payment with the bank wire will not even proposed! For me it works in a quite crazy way... Let me explain why: - as customer, i can visit the whole shop in dollars, currency more familiar to me, but then I can easily send a bank wire in Euros (exactly as it happens automatically with PayPal) - as seller, I decided to only accept Euros and make invoices in Euros only, but an Euros bank wire can be received from anywhere, even from countries with different currency So, with great effort (I'm not a developer!) I modified the .tpl of the bankwire module, slightly modifying the operation and the contents. To install it, first create a bakup copy of the file: /modules/bankwire/views/templates/front/payment_execution.tpl Then open the file payment_execution.tpl and replace the code inside it with this: {* * 2007-2012 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-2012 PrestaShop SA * @version Release: $Revision: 7465 $ * @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')}" method="post"> <p> <img src="{$this_path}bankwire.jpg" alt="{l s='bank wire' mod='bankwire'}" width="86" height="49" style="float:left; margin: 0px 10px 5px 0px;" /> <br/> {l s='You have chosen to pay by bank wire.' mod='bankwire'} <br/><br /> </p> <p> <!-- if customer currency is that one I want --> {if ($cart->id_currency) == 1} {l s='The total amount of your order is' mod='bankwire'} <span id="amount" class="price" style="font-weight: bold">{displayPrice price=$total}</span>{if $use_taxes == 1} {l s='(tax incl.)' mod='bankwire'} {/if} </p> <p> {l s='Bank wire account information will be displayed on the next page.' mod='bankwire'} </p> <p> <b>{l s='Please confirm your order by clicking \'I confirm my order\'' mod='bankwire'}.</b> </p> <p class="cart_navigation"> <input type="submit" name="submit" value="{l s='I confirm my order' mod='bankwire'}" class="exclusive_large" /> <a href="{$link->getPageLink('order', true, NULL, "step=3")}" class="button_large">{l s='Other payment methods' mod='bankwire'}</a> </p> </form> <!-- if customer currency is different from what I want --> {else} {l s='We only accept payments in' mod='bankwire'} <b>{l s='Euros' mod='bankwire'}</b>. {l s='Your current currency is' mod='bankwire'} <b>{if ($cart->id_currency) == 2}{l s='Dollar' mod='bankwire'}{/if}</b><b>{if ($cart->id_currency) == 3}{l s='Pound' mod='bankwire'}{/if}</b>.<br /><br /> {l s='The total amount of your order is' mod='bankwire'} <span id="amount" class="price"><b>{displayPrice price=$total}</b></span>{if $use_taxes == 1} {l s='(tax incl.)' mod='bankwire'} {/if}<br /><br /> <b>{l s='Please note' mod='bankwire'}</b>:<br /> {l s='The reference prices of entire shop are in' mod='bankwire'} {l s='Euros' mod='bankwire'}. {l s='The conversion in' mod='bankwire'} {if ($cart->id_currency) == 2}{l s='Dollar' mod='bankwire'}{/if}{if ($cart->id_currency) == 3}{l s='Pound' mod='bankwire'}{/if} {l s='is automatically made using daily updated exchange rates, but keep in mind that exchange rates of your bank may be slightly different' mod='bankwire'}.<br /><br /> {l s='By clicking' mod='bankwire'} <b>OK</b> {l s='your order will be converted in' mod='bankwire'} {l s='Euros' mod='bankwire'} {l s='and you will be able to conclude the check out paying with bank wire' mod='bankwire'}.<br /><br /> {l s='Otherwise click' mod='bankwire'} <b>{l s='Other payment methods' mod='bankwire'}</b> {l s='and choose another kind of payment' mod='bankwire'}. </p> <p class="cart_navigation"> <input type="button" id="currency_payement" name="currency_payement" value="OK" onclick="setCurrency(1);" class="exclusive_large" /> <a href="{$link->getPageLink('order', true, NULL, "step=3")}" class="button_large">{l s='Other payment methods' mod='bankwire'}</a> </p> {/if} {/if} Now the module works in this way: - from BO the bank wire is activated for all currencies enabled (modules ==> Payments ==> Payment module restrictions) - to the customer, independently from the currency that he has set in the front office, is now given the option to pay with bank transfer - the module then checks the currency chosen by the customer: - if it is the default one it goes on - if it is different, the module gives an extra partial step in which it explains that the shop only accept payments in Euros (or currency selected by the seller), that the order will be converted into the currency selected by the seller and it will be shown again before being sent by the customer. The setting of the various currencies is manual and directly on the template code. It use the ID of the currencies that can be easily identified in the BO "Localization ==> Currencies". The currency that we want as default is on line 49 (here represented by the number 1 - Euros): {if ($cart->id_currency) == 1} We must also enter at lines 67 and 72 the IDs of the other currencies activated in shop with their names in English (here 2 is Dollar and 3 is Pound): {if ($cart->id_currency) == 2}{l s='Dollar' mod='bankwire'}{/if}</b><b>{if ($cart->id_currency) == 3}{l s='Pound' mod='bankwire'}{/if} Still on lines 67, 72 and 73 declare in what currency you want to be paid (here just "Euros"): {l s='Euros' mod='bankwire'} The last parameter on line 77 where we write again the ID of the default currency (here 1 to represent the Euros): onclick="setCurrency(1);" Obviously there are new parts to be translated in BO: good job! I've tested it and I use it in my shop, it works great. I think it would be nice that some developer who is part of the development of PS propose to use this modification in an official way, developing it with an easier setup directly from BO instead of this one directly in the code. Otherwise the bank wire is very little usable! But you will see this, at the moment it works like a charme for me! Let me know if you like it and if anyone finds any problem! (and I hope my English is good enough...) Bye! 2 Link to comment Share on other sites More sharing options...
domorodecmezilidmi Posted December 9, 2014 Share Posted December 9, 2014 Hey man, great job. I use only one currency but I was just wandering how to set up more currencies for just this payment module - bank wire. :-) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now