Bundle Products 2.3.1

In response to an idea from a long-standing customer, I’ve been working on a system that allows the Shop Owner to make a product that is made out of other products.

Imagine for example, a shop that sells plates, knives, forks, spoons, cups, glasses – and they want to sell a “bundle” of those as a “Dinner Service”. Or perhaps a surfing shop who wants to put together a “beginners bundle” of wetsuit, rash vest, surfboard, leash – these items would be “slaves” of the beginners bundle.

So, I set about making it. It was actually fairly straightforward up to a point. In the following, I’ll take the “surfing” idea;

Firstly, the Shop Owner needs to add the slave products (board, wetsuit, leash, vest) – this is done in the usual way via the admin section.

Step 1: add the master product AND the ability to add slaves (and their quantity) to that product. This is done in the usual way, via the admin area. However, there is a new addition on the product adding/editing page, as so;

The ID input box is the product ID of the slave. The quantity input box is how many of that ID are included in the “bundle”. More slaves can be added by pressing the +Add Slave link;

Once the product is ready, press “save”. The bundle is now available for sale in the shop. At this point, the Shop Owner is expected to have made a good description for the bundle as I have not coded an automatic way for the bundle to show it’s slaves. Would that be needed?

Step 2: Buying the Bundle. This is done in the usual way by the customer, using the usual checkout process. Once the bundle is purchased, the quantities of all the slaves are reduced appropriately. In this way, stock control can be maintained.

Have a look at this video which I made, which shows a different example. In this one the “Test Product” is a slave of the “Graphics Card”.

To Do:

1. Show Slave Products on the Master product_info.php page.

2. Check stock of all slave products before allowing checkout (by this I mean that if a master needs 4 of a particular slave, yet only 3 slaves are in stock, pop up the out of stock message).

Let me know what you think of it so far?

Home Delivery Shipping Module 2.3.1

One of my good clients contacted me to see about having coded a shipping module that;

– available for DK clients only 1
– available only to certain postcodes within Denmark (those near the customers real shop, to be delivered by car) 2
– ability to add further away postcodes at a higher price 3

Within a couple of hours I had the basis of the code in place, it has now been tested and seems to work well;

1. Hardcoded, but can easily be changed to react with the STORE_COUNTRY.

2. Insert the Zipcodes as a comma separated list.

3. You need more zones, just increase the number of zones in the module.

which gives extra inputs in the Admin area.

In real use;

A. A Zip that is not configured as a deliverable zip;

B. A Zip that is close to the Store (Zone 1);

C. A Zip that is further away (Zone 2);

Sorting Options and Attributes in 2.3.1

Yesterday, a new client approached me to ask if I could provide a way (in 2.3.1) to sort Product Options, and the Attributes of those Options. Well, it’s not rocket science to do this, so came up with a solution.

Needed;

1. An easy way to sort Product Options
2. An easy way to sort the Attributes of those Options
3. An easy way to set an Pre-Selected Attribute.

How it works right now;

In standard 2.3.1 the Options are listed in alphabetical order, so in the example below, Memory comes above Model;

Then the attributes are listed with the lowest cost first, in the image below, you can plainly see that -$10 comes before $0 (blank). The already selected attribute is always the lowest cost (which may be undesirable);

Changes made

1. Recode the admin/product_attributes screen to allow the shop owner to give a Sort Order to the Options;

2. Further recode the admin/product_attributes screen to allow the shop owner to give a Sort Order to the Attributes of each Option, per product (basically the same idea as the previous image, but for Attributes).

3. Recode the product_info.php to ensure that both the Options and their Attributes are sorted by the relevant sort_orders. Also make it so that any sort of zero will be the selected attribute…

Now, the Shop Owner can mix up his options and attributes as he pleases. In the example below, I set 3 versions: VHS (-$10), DVD, Blu Ray (+10). Previously, the -$10 VHS option would have been pre-selected. Now the DVD option is pre-selected, even though it is not first in the dropdown list.

and here is how I set it up in the admin screen;

Once I get this delivered to the client, he might want to contribute it to the osCommerce site, I do not know.