Jump to content

hide/show payment method on individual/company


diondp

Recommended Posts

Hi There, i am running PS 1.4.3 and have modified the bankwire module to be an "invoice" payment instead...

 

however i only want this payment to be visible to companies and not individuals, and i want this done "on-the-fly" not by assigning customer groups manually afterwords...

 

so it should work on-the-fly when customers checkout on the OPC form...

 

i have added and if statement in the TPL for the bankwire module like this:

 

{if $invoice->company != ''}
<p class="payment_module">
<a href="{$this_path_ssl}payment.php" title="{l s='Pay by bank wire' mod='bankwire'}">
 <img src="{$this_path}bankwire.jpg" alt="{l s='Pay by bank wire' mod='bankwire'}" width="86" height="49"/>
 {l s='Pay by bank wire (order process will be longer)' mod='bankwire'}
</a>
</p>
{/if}

 

this works nicely to only show the field when logged in and company invoice address is not empty...

 

however, for new customers which checks out using OPC they will not se this payment right away because OPC is AJAX updated so the smarty variable: $invoice->company isn't recognized before a physical update "F5" is done...

 

any suggestions on how this can be solved ? (and no i will not deactivate AJAX cart)

 

maybe i should look at another solution on customer creation ? on checkout

if company field not empty assign them to customer_group 2 instead of default customer group and then only enable that payment method for group 2...

 

would that work on the fly with checkout ?

 

else, how can i make the first solution work with the ajax update...?

 

i am experienced in PHP, SQL but not so much in AJAX / JQUERY

 

Best Regards

Dion Pedersen

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