Jump to content

Widget on payment method


Eutanasio

Recommended Posts

Hi,

 

I need to make the widget of this payment method to launch when a customer clics on this payment method. Right now, when a customer chooses the method, it takes him to the confirmation page where he need to clock in the confirmation button for the widget to appear.

this is the code of the payment method button that takes the customer to the confirmation page:

<div class="row">
  <div class="col-xs-12">
        <p class="payment_module">
            <a 
            class="amanpay" 
            href="{$this_link|escape:'html':'UTF-8'}" 
            title="{l s='Pay by Amanpay' mod='amanpay'}">
              {l s='Pay by Amanpay' mod='amanpay'} 
            </a>
        </p>
    </div>
</div> 

I need it to launch the widget as the confirmation button does on the confirmation page:

{capture name=path}
    {l s='Amanpay payment.' mod='amanpay'}
{/capture}

<h1 class="page-heading">
    {l s='Order summary' mod='amanpay'}
</h1>

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

{if $nbProducts <= 0}
	<p class="alert alert-warning">
        {l s='Your shopping cart is empty.' mod='amanpay'}
    </p>
{else}
        <div class="box cheque-box">
            <h3 class="page-subheading">
                {l s='Amanpay payment.' mod='amanpay'}
            </h3>
            <p class="cheque-indent">
                <strong class="dark">
                    {l s='You have chosen to pay by Amanpay.' mod='amanpay'}
                    {l s='Here is a short summary of your order:' mod='amanpay'}
                </strong>
            </p>
            <p>
                - {l s='The total amount of your order is' mod='amanpay'}
                <span id="amount" class="price">{displayPrice price=$total}</span>
                {if $use_taxes == 1}
                    {l s='(tax incl.)' mod='amanpay'}
                {/if}
            </p>
            <p>
                - {l s='Please confirm your order by clicking "I confirm my order."' mod='amanpay'}.
            </p>
        </div>

        <p class="cart_navigation clearfix" id="cart_navigation">
            {*
        	<a 
            class="button-exclusive btn btn-default" 
            href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}">
                <i class="icon-chevron-left"></i>{l s='Other payment methods' mod='amanpay'}
            </a>
            *}
            <a  class="button btn btn-default button-medium" href="#" onclick="return confirm(event)">
                <span>{l s='I confirm my order' mod='amanpay'}
                	<i class="icon-chevron-right right"></i>
                </span>
            </a>
            {*<div style="float: right;margin-top: -38px;">*}
                {$amanpay_widget}
            {*</div>*}
       </p>
        
        <script type="text/javascript">
        	function confirm (e)
        	{
        		e.preventDefault();
                AmnPy.loadModal();
        	}
        </script>
{/if}

Does anybody know how to implement this second code on the first one?

 

Thanks!

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