Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Bundled products

Recommended Posts

I tried master products contribution but it's not what I want and it looks like quite a few others have similar issues.


The idea is to update the stock of a number of sub-products in a bundle when a single item is purchased. The cost of the single item does not need to be related to the total cost of the items in the bundle, so deals can be applied. All products in the bundle are normal, only the main product needs an extra field. Sub-products in a bundle may be used in any number of master products (eg bearings on a skateboard)


I'm working on the following concept; my PHP and knowledge of OSC is still young so it will take a few weeks....


A) are there any other contribs that will do this?

B) Shall I try and make it into a contribution module?


Add a field into the products information (eg "bundle_contents")


Insert into this field a string containing the codes/SKUs for the subproducts (eg "23&45&65&111"). I'm not sure what delimiter would be best at this point.


When the product is displayed, PHP checks to see if the product has data in this field. If data exists, it prints a simple list of bundle contents in the product info part.


This list may be extended to include a "saving" figure if I can get it to calculate the total cost of the contents and compare with the product price.


No other changes are made until "callback" after order (I have not found this file yet). This file will check each product for bundle_contents before updating stock.


If bundle_contents contains bundle data (product contains others) then it will expand and update the stock of each subproduct.


If anybody sees any flaws or suggestions please submit here, or email me. If I can get it to work it may be worth a new contribution as it is a different approach to "Master Product"



Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 331
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...

OK, bundles are now live on www.lushlongboards.com


take a look at product



too see the user's view.


bundles are created in admin section, and are all valid stock items which may be visible or not visible to the customer (using active/inactive as comes with OSC)


stock of bundled items is checked before checkout ... ie the bundle is opened before stock check. likewise, after sale, stock of individual items is updated.


1 level of nesting is allowed, ie a bundle may contain another bundle, but not another bundle within that.


would anyone like a contrib?

Link to comment
Share on other sites


I didn't really see what was different with the item.


Is the following text created by OSC??


This product contains the following items:

? Hardware kit and assembly

    Black grip tape

    8mm bearing spacer set

    1 1/2 inch boltset

    Regular 1/2 inch riser

    Assembly charge

? Swiss ABEC 5 bearings

? Kryptonics True 65 wheels

? Lush L175 trucks

? Lush Kuni Deck


Cost of separate parts: ?130.97

You save ?45.98

A contribution would be great!

Edited by safoo
Link to comment
Share on other sites

that is correct. You add the bundle master (the bundle) as you would a normal product, then select it's contents on the admin page.


the stock level of the bundle master is irrelevant and is never checked or updated, only the contents matter. This naturally makes it quite a complicated mod, and while it works well on my heavily hacked site, it will take some time to neaten up for an osC mod. I'll do it as soon as I can.



Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

Works a treat.


Although there are some small bits missing:


define('TEXT_PRODUCTS_BUNDLE', 'Create a Bundle:'); - (In categories language file)

define('TABLE_PRODUCTS_BUNDLES', 'products_bundles'); - (application_top.php or database_tables.php depending on your version)


Think that was about all tho.

Works great even on our heavily modded site, no problems going in at all.


Nice1 ;)

Link to comment
Share on other sites

hi costas -


what part of the install is troubling you?


You need to edit your version of the files given in the instructions then upload them to your server. No extra files are needed. You also need to alter your database using an admin tool that should be provided by your server, such as myPhpAdmin.



Link to comment
Share on other sites

You can use this to run the creation of products_bundles:


CREATE TABLE `products_bundles` (

  `bundle_id` smallint(6) NOT NULL default '0',

  `subproduct_id` smallint(6) NOT NULL default '0',

  `subproduct_qty` tinyint(4) NOT NULL default '0',

  PRIMARY KEY  (`bundle_id`,`subproduct_id`)



And just add this into products table:


`products_bundle` tinytext NOT NULL,


Talking a 30 second job.



Link to comment
Share on other sites

Yes you can do that.


The first can be run from SQL heading in phpmyadmin, just copy paste and go.


The second you need something more like this if you dont know how to manually create the table:


ALTER TABLE `products` ADD `products_bundle` tinytext NOT NULL AFTER `manufacturers_id` ;


If you are going to get into OSC and adding/creating mods, I would suggest you make yourself familiar with phpMyAdmin, it is a major part of OSC if this is your chosen program for mySQL.

Link to comment
Share on other sites

we are running an almost completely custom OSC install - this is one of the last major mods we wanna set up.


i had been working on my own version for a while until i did one last search and came up with this thread. i'm gonna install this sucker and see if it does what we need (and it sounds PERFECT!!!)


will post my impressions later! thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...