Create a simple shopping cart in wordpress?

I have a wordpress website, and I want to create a simple web commerce. When I mean simple, it's really simple: Some posts/pages are going to have a custom field named "price". These pages are going to have a link on it, and clicking on it, the user is going to be sent to a simple shopping cart. From the shopping cart, I'm going to create a checkout page, which is mainly a php page that connects to a payment gateway, showing credit cards and such. I'm going to create php files that validates info about these payments after the response from the gateway.

I'm not going to sell "products". I don't need postal offices, no address to deliver something, nothing. It's just a price and a php that receives confirmation from the payment gateway. Think of selling "courses" or something like that. A receipt of the buy is going to be in the database, so the client can reference it later.

So, I think I need to create:

Am I forgetting something? What else should I be aware of when trying to create this plugin? I heard that wordpress don't use sessions, so I would need to create one in wordpress just for the carts. Does anyone knows about this issue?

(I don't want to use these complete e-commerce plugins that exist since I don't need all their features.)

Upvotes: 0

Views: 9678

Answers (3)

I decided to use a cookie approach using $_COOKIE. The values in that cookie are a json_encoded associative array with product information, that is checked in the server with some validation. That way I don't have to mess up with $_SESSION in wordpress that I read is problematic, and the user can have the same shopping cart even if (s)he closes the browser.

One good example of simple e-commerce application is really simple e-commerce.

Upvotes: 2

Market Theme
Market Theme

Reputation: 11

An easy way to setup an online store is by using the Market theme.

Market is a theme template for Wordpress, that contains a built-in shopping cart system, and product administration tool for easily adding and editing products.

It connects with your Paypal account for processing your customer payments.

If you want to, you can play around with an online demo here:

http://www.markettheme.com/

That way you can try it out before you commit to anything.

Upvotes: 1

Luke Stevenson
Luke Stevenson

Reputation: 10341

Just an option, if you are wanting a simple shopping cart (with PayPal integration) and are not wanting to reinvent the wheel, check out Simplecart JS. A javascript, persistent, shopping cart which allows your users to collect items and then proceed to the PayPal portal to complete the purchase.

Upvotes: 1

Related Questions