X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Payment Options based on Country (https://forum.x-cart.com/showthread.php?t=65671)

drheath 12-17-2012 03:09 PM

Payment Options based on Country
 
I have been looking around the forum and have not found a good answer to this yet. in X-cart 4.5.x I want use our Aut.net payment gateway to process orders for all US and CA customers. Any other country we want to use a "Phone" method so we can do in-house verification before sending out orders.

It sounds easy enough since I have done something similar with shipping on older versions. If anyone can get me pointed in the right direction I would appreciate it. I would like to use data in the Billing and Shipping address as the standard for what rates are available.

totaltec 12-17-2012 07:53 PM

Re: Payment Options based on Country
 
This is possible, but can be very tricky. I have accomplished this for one of my clients, and it required me to include reloading the payment methods via Ajax. I think the burning question here is: are you using OPC or Fast lane checkout?

drheath 12-17-2012 07:59 PM

Re: Payment Options based on Country
 
We are using OPC. I initially thought this would be a simple IF/Then function but the AJAX does present a complication to the whole matter that I hadn't really considered.

cflsystems 12-17-2012 08:06 PM

Re: Payment Options based on Country
 
The easiest way would be to use membership. It will require you to modify some code but I think at the end is the best way to do this. This will only work if you do not use memberships though. You can create 2 membership groups - say North America and World. Assign payment method CC to North America membership and payment method phone to World memberhsip. Now you need to modify register.php to auto assign membership to every customer when creating profile based on billing address (or shipping, whichever you want to use). XC should pick it up from there showing correct payment method(s).

This is untested, just an idea, but it should work

drheath 12-17-2012 08:17 PM

Re: Payment Options based on Country
 
Thanks for the idea Steve, I hadn't considered using memberships that way. We were considering bringing in line pricing for regular customers in the coming year and I had originally thought about using memberships that way. But if there is another way to get around that it may be worth looking into.

cflsystems 12-17-2012 08:22 PM

Re: Payment Options based on Country
 
If you are planning to use membership for pricing levels or discounts or anything like that then this won't work as you cannot assign more than one membership to customer.

Another way would be to custom code this and allow to assign payment methods based on country - similar to membership, which should not be that hard considering XC is open source

drheath 12-17-2012 08:42 PM

Re: Payment Options based on Country
 
Where would I start looking for that? I've been toying with payment_methods.tpl from another thread I found, but when I start futzing with the IF statements the payment the results have been un-promising. Possibly because I have not considered the AJAX element as referenced above. While it is probably easy enough to learn, AJAX is something I'm just unfamiliar with.

cflsystems 12-17-2012 09:11 PM

Re: Payment Options based on Country
 
It has to be done in php file not template file

drheath 01-18-2013 08:32 AM

Re: Payment Options based on Country
 
I was able to eventually get this accomplished with some help from a programmer. We ended up having to modify a dozen php files to get it to work correctly.

d4web 06-22-2015 07:35 AM

Re: Payment Options based on Country
 
Quote:

Originally Posted by cflsystems
It has to be done in php file not template file


Steve, I need this functionality on a website. Can you help with it?


All times are GMT -8. The time now is 03:41 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.