Jump to content
Latest News: (loading..)
swguy

[Contribution] Better Together Discounting Module

Recommended Posts

Better Together for osCommerce is now available for download. It allows you to perform the following discounts:

 

- Two for one on a specific product (BOGOF)

- Two for one for all products in a specific category

- Buy one specific product, get another specific product at a discount

- Buy one specific category, get another specific category at a discount

- Buy one specific product, get a product from a specific category at a discount

- Buy an item from a specific category, get a specific product at a discount.

 

Discounts may be expressed in dollars (i.e. currency units) off or in % off.

 

Better Together is here: http://addons.oscommerce.com/info/6733

Edited by Jan Zonjee

Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Firstly I must thank you for this add-on, it's by far the best product "package discount" module I've found; great work :)

 

However I would like to make one suggestion, it would be great to be able to associate one "parent" item with multiple discount/package rules. In the current Better Together Discounting Module for each package there must be one "parent" for each corresponding "child" product. Please take the following as an example:

 

Rule 1) $this->add_prod_to_prod(A, B, "%", 10);

Rule 2) $this->add_prod_to_prod(A, C, "%", 15);

Rule 3) $this->add_prod_to_prod(A, D, "$", 50);

Rule 4) $this->add_prod_to_prod(A, E, "%", 2);

 

Assume that 1 of each 'A' - 'E' is in the active cart.

 

As you can see I desire that with the purchase of product 'A' (in any quantity) that a customer be entitled all/any of 10% off 'B', 15% off 'C', $50 off 'D' and 2% off 'E'. As it stands this works only if there are as many of product 'A' in the cart as there are associated rules e.g. if there is a quantity of 2 then only rules 1 - 2 are applied and items 'D' & 'E' have their discounts ignored.

Top Job :thumbsup:

Share this post


Link to post
Share on other sites

Thank you for your kind words.

 

The scope of Better Together is really just "buy A get B at a discount," so I never extended it the way you describe. I did write a more complex discounting algorithm for Zen Cart which allowed what you're asking for ("buy A, get all of B, C, D, E at a discount"), but since it also allowed every possible permutation of that (e.g. "get 2|3 of B,C,D,E", "get B,C,D,E if all are purchased", "get C,D,E if A, B purchased," etc.), the specification mechanism is much more complex.

 

Good luck with your online venture!

Scott


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Hi Scott

 

Thanks for a great contribution, very easy install, and working perfectly.

 

Is there any way this can be amended for three, four or even more different items together?

buy A and B and C to get D at a discount.

Or is there another contribution that can do this?

 

You may wish to change the link in the post above because it is linking to the wrong contribution

The correct link is

 

http://addons.oscommerce.com/info/6733

 

 

Also there is a missing > in the instructions

 

Line 223 should be ?>

 

Regards

 

Ken.

Share this post


Link to post
Share on other sites
You may wish to change the link in the post above because it is linking to the wrong contribution

The correct link is

 

http://addons.oscommerce.com/info/6733

 

Ack! Moderator, please fix if possible - don't know how this got messed up.

 

Ken, I've beefed up the readme and fixed this typo in the next release.

The answer to your other question is that Better Together is only for pairing items. I have some more complex discounting software that I will adopt to osCommerce later on.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Scott, trying to find which products on your test site have better together setup, all I can see is the quantity discount.

Share this post


Link to post
Share on other sites

On the front page of my shop, click "Better Together" then scroll down to "See it live." What I've done is documented there.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites
On the front page of my shop, click "Better Together" then scroll down to "See it live." What I've done is documented there.

 

 

Thanks Scott, I read through that before but didn't catch that the example about the marketing was how it alerted customers to the available discount. Going to have a long look at it this weekend, thanks so much for the speedy reply earlier.

 

Eirik.

Share this post


Link to post
Share on other sites

I just adjusted the marketing text on my test site to give it a yellow background - this makes it a bit more visible when you're trying to see the effect.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites
I have some more complex discounting software that I will adapt to osCommerce later on.

 

Great. I will look forward to this. :thumbsup:

 

Regards

 

Ken.

Share this post


Link to post
Share on other sites

I'd love for images to show

 

Ex: Buy (image) and (image) and save $x

 

Can that be done with this contribution?


Nancy

Share this post


Link to post
Share on other sites
I'd love for images to show

 

Ex: Buy (image) and (image) and save $x

 

Can that be done with this contribution?

 

You'd have to write software; nothing is built in at the moment. But this is on my big fun list of things to do.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites
You'd have to write software; nothing is built in at the moment. But this is on my big fun list of things to do.

 

 

Looking forward to it. How can I adjust the font type?


Nancy

Share this post


Link to post
Share on other sites

Better Together 1.0.1 has been released; this version is compatible with the Order Editor contribution.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Hi Scott,

I have tried your 'Better Together' on an (almost) stock osC 2.2 and it works perfectly.

But once I proceed and install the OT module on a osC 2.2 with CCGV (Coupon Code / Gift Voucher) contrib installed (the live shop), the checkout procedure stalls on the checkout_payment page, just below the payment selection, where the CCGV box is.

 

Your addons (checkout candy and the discount preview) look promising also but this is a showstopper.

 

I don't have a clue why this happens, tried in on two installs (MS2 and RC2a, both with CCGV) with the same result.

 

Any ideas?

 

Thanks!

Erwin

Share this post


Link to post
Share on other sites

Please post a link to the CCGV contribution you're using.


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Erwin, I just did this and it worked fine on a stock cart + CCGV + Better Together. I used the latest CCGV from 14 Apr 09. You have made another change which is breaking things, or perhaps it's the version of CCGV you're using.

Edited by swguy

Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Hi Scott,

Thank you for your prompt reply.

I must admit CCGV has given me headaches in the past.

 

Sure my osC install was changed/modded over time. When time passes it's difficult not to change or add anything. There are always these nice goodies waiting to be implemeted.

I will first see if I can upgrade CCGV and not break anything else.

 

Thank you so much for testing. It gives me a start in the right direction.

 

Kind regards,

Erwin

Share this post


Link to post
Share on other sites

Please forgive my programming skills but I am still trying to figure out how to modify the marketing text. How do I modify this code:

 

<?php 
require(DIR_FS_CATALOG. 'better_together_marketing.php');
if (sizeof($bt_strings) > 0) { 
  for ($i = 0, $n = sizeof($bt_strings); $i < $n; $i++) { 
   echo '<tr><td>' . $bt_strings[$i]  . '</td></tr>'; 
  }
}
?>

 

to include

 

<tr style="margin-left:25px; border: 1px solid #000000; width: 600px; padding: 5px; background: #ffffcc;">

 

 

Im not sure where it belongs. Thanks in advance.

Share this post


Link to post
Share on other sites

Change

	   echo '<tr><td>' . $bt_strings[$i]  . '</td></tr>';

 

to

 

	   echo '<tr style="margin-left:25px; border: 1px solid #000000; width: 600px; padding: 5px; background: #ffffcc;"><td>' . $bt_strings[$i]  . '</td></tr>';


Contributions: Better Together and Quantity Discounts, for osCommerce 2.2, 2.3.x and 3.0. See my profile for more details.

Share this post


Link to post
Share on other sites

Hi,

 

Just installed Better Together on (a heavily modded) osc 2.2.

 

The order_total module works fine, displays and deducts the discount but for the life of me I can't get the marketing code to work in product_info.php, no error message, it simply doesn't display anything.

 

A quick check of the source code in the final page shows that the the code is being processed since

" <!-- bof Better Together Marketing -->

<!-- eof Better Together Marketing -->"

appears, but nothing else.

 

I tried replacing some of the code in the expression just to test where the problem is,

 

First I tried;

 

require(DIR_FS_CATALOG. 'better_together_marketing.php');

if (sizeof($bt_strings) > 0) {

echo '<tr><td>Test</td></tr>';

}

 

Still nothing, but I had a hunch that it wasn't obtaining the correct value for sizeof($bt_strings) and tried;

 

require(DIR_FS_CATALOG. 'better_together_marketing.php');

if (sizeof($bt_strings) == 0) {

echo '<tr><td>Test</td></tr>';

}

 

Sure enough the "Test" text appeared when I reloaded the ammended product_info.php.

 

Really scratching my head on this, I'm no PHP expert but neither am I a complete novice and this seems to be about the simplest mod I've ever installed for OSC!

 

I know it's a tall order but anything at all anyone can suggest would be great.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×