Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contribution Suggestion - Multibuy Mod


Dave H

Recommended Posts

Hi all,

 

I had an idea for a "multibuy" mod... and tried to see if one existed like it, but unless i've missed it.. I don't think one has been created.

 

Firstly the theory behind it....

 

You run an online DVD shop.

You have American Pie 1/2/3/4 for sale for ?10 each.

If someone buys any 1, 2 or 3 of them.. .they pay full price.

If they buy all 4, you want to offer a ?5 discount (total price ?35)

You run another offer for the 3 lord of the rings DVD's... ?12 each.. or ?30 for all 3.

 

The theory..

I'm not a programmer... I can script some TCL.. but that is about it.

You have a table in the oscommerce database, called multibuy or something similar.

It has 2 columns in it. multibuy_ids and discount.

You put all the product_id numbers in multibuy_ids comma separated or something similar

And the amount of money to reduce the total cost by in discount.

 

i.e. for American pie....

 

"1,24,46,70" in multibuy_ids and 5 in discount.

 

For LOTR

"3,32,55" in multibuy_ids and 6 in discount.

 

Then.. in the shopping cart php page (and probably the checkout php page) you would add in something like

$discount = 0 (just to reset it each time the page is called)

include('./catalog/mods/multibuy.php') <--- the name of this script

and further down in the checkout/cart page

Multibuy discounts = $discounts (will be workedout from the multibuy.php page called)

Total price = $final_price - $discounts

 

 

In the multibuy.php script, you set up a loop to read each row of the "multibuy" table.

On each loop, you would parse the multibuy_ids in to seperate "items" and if all "items" appear in the shopping cart... set $discounts = $discounts + discount (read from discount row in table).

 

so by the end of the nested loops you would have a total discount fee from all items which satisfied the multibuy query.. which is passed back to the checkout/shopping cart page and applied to the final price.

 

 

 

I hope i've made some sort of sense! Does anyone know of a module out there that does this... or is there a coder willing to work with me to put php code to my suggestion ?

 

Thanks in advance :)

 

Dave H.

Link to comment
Share on other sites

Also as a suggestion to an interface for "adding" these multibuy options.

A scrollable list of all products in shop with "checkboxes" next to them, a field for discount to apply and a submit button..

 

This would then read all the product_ids and put them in to the multibuy_ids in comma separated format.. and then place the discount in the discount field.

Link to comment
Share on other sites

  • 3 weeks later...

I think this mod should serve you well ... http://www.oscommerce.com/community/contri...ity+price+break

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

and this one ...

http://www.oscommerce.com/community/contri...ll/search,break

 

I believe there is also one where you can define discount across categories, not sure about the link though as there I normally use my own.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Hiya,

 

Thanks for the suggestions, unfortunately they don't do exactly what i'm trying to achieve.

 

The first appears to be multiples of the same item.

The second is closer, but I would like it to be on multiple items... not just 2 (i.e. 2/5/10/100 etc).

The third is per category.. where I want mine to be product_id linked, not category specific.

 

But thanks again for the suggestions.. I appreciate the help :)

Link to comment
Share on other sites

David, I considered the suggestions a base for new coding ... no need to completely reinvent the wheel. I guess if I were to code this, I'd use the 2gether module as a base. Information is stored in a table, and just as you suggested (right now one linked product) it could hold a comma separated list.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

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.
Note: Your post will require moderator approval before it will be visible.

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