Post by swguy » Sun Aug 03, 2014 9:08 pm

My free Better Together module is now available for OpenCart. Over 25,000 downloads have been done for the Zen Cart version of this module, and now I'm releasing it for OpenCart.

This mod permits you to offer this type of discounted cross selling in your OpenCart.

You may specify

* Buy item <x>, get item <y> at a discount
* Buy item <x>, get an item from category <c> at a discount
* Buy an item from category <a>, get an item from category <c> at a discount
* Buy an item from category <a>, get item <x> at a discount

Discounts may be specified as percentages of the latter item's price or as
absolute values in the currency you cart uses.

Detailed documentation is provided in the README file and on my home page, at
http://www.thatsoftwareguy.com/opencart ... ether.html

At the moment, linking must be done in code by default. The Better Together Admin Panel is coming soon.

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by marijan100 » Sun Sep 14, 2014 6:37 pm

How i can add rule:

If buy 2 product from category 3 from category will be free?

Tnx.

Newbie

Posts

Joined
Wed Sep 10, 2014 5:35 pm

Post by jrfcomputing » Tue Oct 07, 2014 5:55 pm

Hi I have installed on to my cart version 1.5.6.4 and it just crashes my site when I try to add any rules

This is the rule I have tried to use

Code: Select all

$this->add_prod_to_prod(4584, 4621, "%", 50);
Response from my logs

Code: Select all

2014-10-07 9:42:02 - PHP Warning:  Missing argument 4 for ModelTotalBetterTogether::add_prod_to_cat(), called in /var/www/vhosts/aotf.co.uk/httpdocs/catalog/model/total/better_together.php on line 412 and defined in /var/www/vhosts/aotf.co.uk/httpdocs/catalog/model/total/better_together.php on line 255
2014-10-07 9:42:02 - PHP Notice:  Undefined variable: amt in /var/www/vhosts/aotf.co.uk/httpdocs/catalog/model/total/better_together.php on line 258

Opencart sites I am currently working on:
http://www.cablecafe.co.uk
http://www.exclusivelygorgeous.co.uk/


User avatar
Active Member

Posts

Joined
Mon May 09, 2011 11:29 pm

Post by CanadaPleco » Fri Oct 24, 2014 2:18 am

Okay I am having a couple issues.

I want to do a buy something from category 83 or 79, get something from category, 80,81,82 or 107 for 40% off.

So I added this:

Code: Select all

    	$this->add_cat_to_cat(83,80,"%", 40); 
    	$this->add_cat_to_cat(79,80,"%", 40); 
    	$this->add_cat_to_cat(83,81,"%", 40); 
    	$this->add_cat_to_cat(79,81,"%", 40); 
    	$this->add_cat_to_cat(83,82,"%", 40); 
    	$this->add_cat_to_cat(79,82,"%", 40); 
    	$this->add_cat_to_cat(83,107,"%", 40); 
    	$this->add_cat_to_cat(79,107,"%", 40);  
It discounted the 40% for the first item, but then I added another item from category 79, and another of the discount items and it did not include a discount for the second one :(

New member

Posts

Joined
Sat Aug 20, 2011 1:06 am

Post by swguy » Wed Nov 12, 2014 10:45 pm

marijan100 wrote:How i can add rule:

If buy 2 product from category 3 from category will be free?

Tnx.
If you mean "Buy 1 product from category 3, get the second one free" you do

Code: Select all

   private function setup() { 
      $this->add_cat_to_cat(3,3,"%", 100); 
   }

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by swguy » Wed Nov 12, 2014 10:47 pm

jrfcomputing wrote:Hi I have installed on to my cart version 1.5.6.4 and it just crashes my site when I try to add any rules

This is the rule I have tried to use

Code: Select all

$this->add_prod_to_prod(4584, 4621, "%", 50);
Response from my logs

Code: Select all

2014-10-07 9:42:02 - PHP Warning:  Missing argument 4 for ModelTotalBetterTogether::add_prod_to_cat() ...
The error message and the code you posted don't line up. (The error shows add_prod_to_cat, and your code shows add_prod_to_prod.)

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by swguy » Wed Nov 12, 2014 10:49 pm

CanadaPleco wrote:Okay I am having a couple issues.

I want to do a buy something from category 83 or 79, get something from category, 80,81,82 or 107 for 40% off.

So I added this:

...

It discounted the 40% for the first item, but then I added another item from category 79, and another of the discount items and it did not include a discount for the second one :(
As each condition is matched with a discount item, that condition is not available for further discounting. There is a switch in the Zen Cart version of Better Together that allows you to override that; I will add it next time I update this module.

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by swguy » Thu Nov 13, 2014 7:08 pm

@CanadaPleco Try this: go to model/total/better_together.php, and change line 355 from

$bt_one_to_many = false;

to

$bt_one_to_many = true;

and see if that works.

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by trenchmeister » Sun Dec 28, 2014 2:08 am

We are running our SECOND sale using Better Together. This one has a Buy one basic starter kit, get e-juice 50% off (working flawlessly) AND the all e-juice is Buy Two Get One Free! Every combination I could think of worked in my initial tests. Only one combination is failing, and it's painful. Our Custom Juice (which has to be specified by category with the 50% off in addition to the master category) will work if it is the SAME custom juice in a QTY 3. If someone makes 3 different custom mixes, no discount is applied. Oddly enough, if they throw in a fourth it gives the discount.

Cat 63 is E-juice
Cat 68 is Custom Juice (sub of 63)
Prod 50 is the Basic Starter Kit

$this->add_twoforone_cat(68);
$this->add_twoforone_cat(63);
// $this->add_twoforone_prod(154);
$this->add_prod_to_cat(50, 63, "%", 50);
$this->add_prod_to_cat(50, 68, "%", 50);

I left the remarked line, just to demonstrate one thing I've tried. Prod 154 is the actual Custom Juice product. If the cat 68 line is left out, it doesn't work at all on this product, but seems to work fine with every other product!

***Follow-up**** I have figured out why the redundant category listing was necessary. It did not have the master cat listed on the product page. I changed that and still get the same effect, though I've now remarked out the redundant lines.

Help!

Newbie

Posts

Joined
Thu Jul 10, 2014 11:51 pm

Post by swguy » Sun Dec 28, 2014 7:22 am

Two for one products have to be the same product (same attributes and everything - it will show up as one line item in the cart, in other words). If you want two for one on product 154, use

$this->add_prod_to_prod(154,154,"%", 100);

Also buy 2 get one free is not supported by Better Together; it only works with item pairs.

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by trenchmeister » Sun Dec 28, 2014 8:13 pm

Oddly enough, this has worked well with all the other products. We have different options on all of them (PG/VG and Nic levels, Flavor intensity and size.) The custom option just goes off the scale with the options and seems to throw it. Bear in mind, we are focused primarily on category vs. product discount. One would think that would not take into account different options as long as the final product is in the right cat.

Do you have any recommendations for making this work properly (even another extension?) The BOGO function is superb and was an easy sell with our customer-base. Our current deal only runs another week, but we are afraid this could have chased off potential buyers.

Newbie

Posts

Joined
Thu Jul 10, 2014 11:51 pm

Post by swguy » Sun Dec 28, 2014 8:45 pm

trenchmeister wrote:Oddly enough, this has worked well with all the other products. We have different options on all of them (PG/VG and Nic levels, Flavor intensity and size.)
Please show me a screenshot of this working and give links to the two products.

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by trenchmeister » Mon Dec 29, 2014 11:48 am

Crap. It doesn't work if all three have varying options, customized or not. Not good. It only seems to work when they're paired, as you said. My testing obviously wasn't concise.

The products, just in case you still want to make recommendations:
Customized:
http://www.higgycigs.com/hccart/index.p ... uct_id=154

All other Juices:
http://www.higgycigs.com/hccart/index.p ... ry&path=63

If you have recommendations, please let me know.

Newbie

Posts

Joined
Thu Jul 10, 2014 11:51 pm

Post by swguy » Mon Dec 29, 2014 7:26 pm

Change your setup function in upload/catalog/model/total/better_together.php to the following:

Code: Select all

private function setup() { 
        $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_category WHERE category_id = 63");

        if ($query->num_rows) {
            foreach ($query->rows as $result) {
                $prod = $result['product_id'];
                $this->add_prod_to_prod($prod, $prod,"%", 100);
            }
        }
}
PLEASE TEST THIS CAREFULLY.

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by trenchmeister » Tue Dec 30, 2014 9:31 pm

Oddly enough, it does precisely the same thing. In pairs, it works. It also works when there are 4 products vs 3.

Newbie

Posts

Joined
Thu Jul 10, 2014 11:51 pm

Post by swguy » Tue Dec 30, 2014 10:51 pm

Four is two pairs. It doesn't work in three's.

This was intended to fix the issue where two product 154's (or any other product in category 63) with different attributes were purchased together, but no discount was given. I thought this was what you wanted. (Note that even though you also wanted Buy 2 get one free, this is not a feature of Better Together.)

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by trenchmeister » Tue Dec 30, 2014 11:02 pm

Fair enough. Do you have a recommendation? Another extension perhaps? I thought that was what we had, but alas it is working as you stated.

Newbie

Posts

Joined
Thu Jul 10, 2014 11:51 pm

Post by trenchmeister » Sat Jan 03, 2015 2:28 am

We love love love this extension!!

Any way to filter out specific customer groups? I'm on the verge of just opening a separate shop for resellers, etc. Still, if I can keep them together without BOGO perks and other deals, that would be fantastic.

Thanks and Happy New Year!

Newbie

Posts

Joined
Thu Jul 10, 2014 11:51 pm

Post by swguy » Sat Jan 03, 2015 5:43 am

Good suggestion - will look at it for the next release.

Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.


User avatar
New member

Posts

Joined
Mon Apr 15, 2013 4:13 am

Post by trenchmeister » Sat Jan 03, 2015 5:57 am

swguy wrote:Good suggestion - will look at it for the next release.
I like that response! :joker:

Newbie

Posts

Joined
Thu Jul 10, 2014 11:51 pm
Who is online

Users browsing this forum: No registered users and 10 guests