Jump to content

Avoid checkout process and create an order out of a product instantly


tazan

Recommended Posts

Hi All,

I'm building this webshop based on credit/virtual coins the customers can purchase and then use.

When theybuy credit, they will go through the normal checkout process, but when they buy some products with the credit, I need the purchase to happen automatically, without checkout process.

I'm sure it can't be much of a pickle to achieve that. But perhaps there are already made modules for something similar?

Any advice is appreciated. :)

Best Regards,

hendrik

Link to comment
Share on other sites

Well I am not sure about existing modules, but the process per se is not terribly complex. What you need to create is
- a controller/script to be called by the "buy" button
- a dummy payment module that can be the script itself (aka the script can be a dummy payment module)
In your code:
- create a new cart object
- add the product to the cart
- copy what PaymentModule::validateOrder does to create a new order

- make sure the user has at least one address, and use it in your code (grabbing its id)

More or less just this

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

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