Customers Who Bought This…

I was approached by a new client who uses osCommerce both as a shop and as a sort of “community”. What this client wanted was a way to show who had bought each product…

Step 1, was to add the ability for clients to add an “avatar” as part of the create_account process.

Step 2, was to code up a module to show on each product page, showing each person (who bought the item) avatar.

Easy as 123 to get something quite basic up and running.

Step 3, is to code up a way for the customer to change/delete their avatar. The best place for this is in the account_edit.php page – but this is something for the future as the client is quite happy with the code as is (at the moment).

Shipping Prices per product (for two regions) UPDATE

The project I started on for a client (read a bit here), worked well. The client came back to me with some extra requirements, namely;

1. Give each product an “extra cost” per region. To be used when people order more than 1 item, thus a widget costing $5 for postage with an extra fee of $2, would charge $7 for postage if the buyer ordered 2. And so on.

2. This to be done per product, per region.

3. Postage only to charge the HIGHEST postage cost + any extras.

Well, I have to say this complicated matters and took some thinking about!

Step 1 was to add the extra inputs in the admin – category – product (adding/editing) page, along with the relevant database changes;

Step 2 was to recode the shipping module I built to get the MAX value of an array. This array created by the costs of the postage (in the above image “HOME Shipping Cost” / “ROW Shipping Cost”).

Step 3 was to recode the cart class to enable the cart to keep track of the “extras” cost.

Now I have all the info needed to make sure that the shipping charges correctly. I’ve tested this to destruction and cannot break the calculations, so I am happy to make this live on the clients site – whilst also advising him to keep an eye on the shipping costs charged and let me know of any problems.

Example

In the example above, the cart holds 1 hoodie (charged at $5 + $2.50 for extras) and 3 tshirts (charged at $2.99 + $1.25 for extras). So the total postage charge is;

1 Hoodie @ 5.00
No extra charge for Hoodies as only 1 purchased.
No postage charge for T-shirts, as the Hoodie postage charge is higher.
3 extra postage charges for the tshirt @ 1.25 * 3

$5 + $1.25 + $1.25 + $1.25 = $8.75

Conclusion

Hope that anyone reading can see that pretty much anything is possible with osCommerce. The 2.2 and 2.3.1 versions of osCommerce are loosely coded, so it is easy to make the changes to enable whatever it is that you need to do. The v3 osCommerce will be harder to code for, but only because the code is so much more structured.

How To Install osCommerce v3

Pre Pre Step 1

Set up an empty database, ready for use.
Download osCommerce v3.

Pre Step 1

Click the “New Install” button.

Step 1

Insert the values for the Database connection.

Press “> Continue” button.

Step 2

Insert the values for the Store.

Press “> Continue” button.

Step 3

There is no step 3, the shop and admin are installed! You can press the “Online Shop” button to visit the shop;

And/or the “Administration Tool” to visit the admin;

osCommerce 3 (aka oscom3) – not for public consumption

I’ve had more than a handful of requests to update existing shops to the upcoming osCommerce v3. I’ve turned them all away on the basis that 3 needs time to grow before it is used on a real shop.

Let me say that again in more clear english;

osCommerce v3 is NOT suitable for use in a live shop.

Manager, Harald Ponce de Leon, says;

…v3.0 does not contain a full user feature set to be able to run an online store on…

Developer Group Manager, Mark Evans, says;

…anyone that jumps into something which isn’t even proven is asking for trouble […] we will learn a lot before I would use it for “end users”, I’m hoping the community will help shape what it becomes…