X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Linking "Place Order" with customized payment methods? (https://forum.x-cart.com/showthread.php?t=70183)

klsmith007@yahoo.com 10-08-2014 03:42 AM

Linking "Place Order" with customized payment methods?
 
1 Attachment(s)
I've modified my "Checkout" page to also include the "Pay with Amazon" option under the payment methods. I didn't change anything in the popup mini cart, nor the main cart. I just felt that once I got into the "Checkout" process that I still wanted the Amazon option available for checkout.

What I'm having trouble doing is getting the Pay With Amazon popup to come up when I click the "Place Order" button.

By placing the Pay With Amazon code inside the list item and making the img part of the label object, the image has lost its special capability to bring up the popup when the image or radio button are selected. This is a good thing, since I DON'T want the button to bring the Amazon popup up in this case. Now there seems to be some validation step that gets done when the image or radio are selected. I used 115 for the methodID per the database.

doActionPayment in ./classes/XLite/Controller/Customer/Checkout.php does the validation of the change in payment method, but where is the code for "Place Order"? I enabled the Paypal payment method so that I could track down how that is done, thinking that the Amazon option would be similar, but I haven't had any luck with it yet.

If someone could point me to the right place to look and an idea of the code I would need to implement, that would be great. I'm thinking that an HTMLElement.click() might work, but there might be a better PHP option. I'm not a PHP developer, but I do have a fair amount of software development experience, so a pointer to the X-cart code and a link to a PHP primative would probably do the trick.

Thanks.

Kevin

tony_sologubov 10-14-2014 06:31 AM

Re: Linking "Place Order" with customized payment methods?
 
Hi Kevin!

Just to make sure, are you using free Pay with Amazon module (http://www.x-cart.com/extensions/addons/pay-with-amazon-payment-module.html) or did you create your own payment method?

If you are not sure about how to create payment method module, please refer to our previous webinar record here: http://kb.x-cart.com/display/XDD/Webinar+3+-+21+Aug+2014+-+Payment+gateway+creation

Tony.

klsmith007@yahoo.com 10-14-2014 10:56 AM

Re: Linking "Place Order" with customized payment methods?
 
Hi Tony,

Yes, I'm using the "free" "Pay with Amazon" module. I'd just like to have the option of selecting that payment option when on the checkout page in addition to the other options instead of having to only do it on the mini popup or view cart option.

I have not checked out the webinar. I have been intensely looking at the code, but haven't quite figured it out. Since the Paypal payment module also brings up a popup in which to log in and pay, I figured that was a good starting point, but as of yet, I just haven't been able to figure it out.

At this point, I'm ready to pay you guys to do it for me "if" it's within my limited budget.

Thanks for the reply.

Kevin

tony_sologubov 10-14-2014 12:43 PM

Re: Linking "Place Order" with customized payment methods?
 
I see now.

Well, Amazon's module does not consider an option of adding it to the checkout page (probably because of legal or marketing concerns) that is why all payment logic is located in the classes/XLite/Module/Amazon/PayWithAmazon/Controller/Customer/AmazonCheckout.php file.

If you want to put Amazon payment method onto checkout page, you have to basically create your own payment method. This process is described in aforementioned webinar and it is not that complicated to be honest.

Surely, you can order a customization from us. Just drop us a message at sales@x-cart.com and receive a free quote, so you could at least estimate the expenses.

Unfortunately, considering current implementation of Pay With Amazon, there is no effortless option of putting Amazon payment to checkout page.

Tony.

klsmith007@yahoo.com 10-15-2014 01:37 AM

Re: Linking "Place Order" with customized payment methods?
 
Hi Tony,

I spent an hour viewing webinar 3 on creating a custom payment module and found it most helpful. Thank you for that. I also appreciated the code snippets. However, I did find it difficult to create a new payment module following the knowledgebase write-up. I think because the write-up lacked the specific directories where most of the files reside that I had to go through the video a second time to see where to place the files that it's making it more of a challenge. This was time well spent, since after viewing the video a second time, the information was easier to follow. Just a couple of handwritten notes and now everything is clear.

I happily did this since I value everything that you and the team have provided, but you may wish to augment the write-up with that information for others like myself that are new to the whole directory/layout structure. You might also consider a zip(tar) file with just the files that you worked on as a support tool so that we can be sure we have everything we need for our own payment modules.

Take care.

Kevin

tony_sologubov 10-15-2014 04:49 AM

Re: Linking "Place Order" with customized payment methods?
 
Hi Kevin!

Thank you so much for feedback! I am writing Knowledge Base articles right now, so the amount of useful info will grow.

Anyway, could you please let me know what confused you in the webinar write-up? I mean, what are parts where you could not realize where to place a file, etc? I will be great to adjust the text.

Tony.

klsmith007@yahoo.com 10-22-2014 01:37 AM

Re: Linking "Place Order" with customized payment methods?
 
Sorry Tony,

I've been super busy lately. I've got some notes and will post as soon as I can free up some time. Thanks for all of your help in getting started.

Kevin

tony_sologubov 10-23-2014 04:02 AM

Re: Linking "Place Order" with customized payment methods?
 
Sure! Thanks for that in advance!


All times are GMT -8. The time now is 05:24 PM.

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