Zen Cart Logo
Forums / Addon Order Total Modules / Better Together Contribution Support Thread

Better Together Contribution Support Thread

Views: 203,784

Results 361 to 380 of 696
13 Jul 2010, 03:52
#361
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,566
Plugin Contributions:
58

Better Together Contribution Support Thread

Try this for cat to cat discounts:

function get_discount($discount_item, &$all_items) {
        $discount = 0; 
        for ($dis=0, $n=count($this->discountlist); $dis<$n; $dis++) {
           $found_match = false; 
           $li = $this->discountlist[$dis]; 
           // Based on type, check ident1
           if ( ($li->flavor == PROD_TO_PROD) || 
                ($li->flavor == PROD_TO_CAT) ) {
              if ($li->ident1 == $discount_item['id']) {
                 continue;
              } else {
                $found_match = true;
              }
           } else { // CAT_TO_CAT, CAT_TO_PROD
           // check to make sure a discount product has been added
              if (zen_product_in_category((int)$discount_item['id'], $li->ident1)) { // modified to support linked products and top level categories 
                 $found_match = true;
              } else {
                continue;
              }
           }
           if ($found_match) {
             for ($i=sizeof($all_items) - 1; $i>= 0; $i--) {
                 if ($all_items[$i]['quantity'] == 0) 
                    continue;
                 $match = 0; 
                 if ( ($li->flavor == PROD_TO_PROD) || 
                      ($li->flavor == CAT_TO_PROD) ) {
                    if ($all_items[$i]['id'] == $li->ident2) {
                       $match = 1;
                    }
                 } else { // CAT_TO_CAT, PROD_TO_CAT
                    // check that a product in the other category exists
                    if (zen_product_in_category((int)$all_items[$i]['id'], $li->ident2)) { // modified to support linked products and top level categories
                       $match = 1;
                    }
                 }

                 if ($match == 1) { 
                     $all_items[$i]['quantity'] -= 1;
                     if ($li->type == "$") {
                        $discount = $li->amt;
                     } else { // %
                        $discount = $all_items[$i]['final_price'] *  
                                    $li->amt / 100;
                     }
                     return $discount;
                 }
             }
           }
        }

        return 0;
    }

You'll have to apply this to the other methods, but it's all I needed.

23 Jul 2010, 21:24
#362
rbchase avatar

rbchase

New Zenner

Join Date:
Aug 2009
Location:
Beaverton, OR
Posts:
3
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

I'm on Zen-Cart 1.3.9d with Better Together Marketing 2.3 and thought I should share a small HTML tag compliance issue I found today in the following files:

includes\templates\CUSTOM_TEMPLATE\templates\tpl_better_together_marketing.php

includes\templates\CUSTOM_TEMPLATE\templates\tpl_better_together_marketing_images.php

Inside the **for **loop, the php echo that generates the span tag has a double quote ( " ) in the closing span tag. See below:

tpl_better_together_marketing.php:

        
for ($i=0, $n=count($marketing_data); $i<$n; $i++) {
	echo '<div class="discountText">'; 
	echo $marketing_data[$i]['data'];
	echo '<span class="bbn_button_noimg">' . $marketing_data[$i]['bbn_string'] . '</span">';
	echo '</div>'; 
}

tpl_better_together_marketing_images.php:

      
for ($i=0, $n=count($marketing_data); $i<$n; $i++) {
	echo '<hr />';
	echo '<div class="discountText">'; 
	echo $marketing_data[$i]['data'];
	echo '</div>'; 
	echo '<div class="discountImages">'; 
	echo  
		$marketing_data[$i]['first_href'] .
		$marketing_data[$i]['first_image'] . '</a>' . 
		'<span class="product_plus">+</span>' .
		$marketing_data[$i]['disc_href'] .
		$marketing_data[$i]['second_image'] . '</a>'; 
		if (isset($marketing_data[$i]['bbn_string'])) { 
			echo '<span class="bbn_button">' . $marketing_data[$i]['bbn_string'] . '</span">';
		}
	echo '</div>'; 
}

The double quote needs to be removed as it causes formatting issues in the final DOM display that permeates through the balance of the page. Basically, it prevents the echo of the two closing div tags. Found this using the developer tools in IE8, viewed the source for the Page DOM and spotted the missing closing div tags.

Search for: php '</span">'; and replace it with: ```php
'</span>';


BTW: Thanks to Software Guy for this great add-on.
23 Jul 2010, 23:39
#363
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Better Together Contribution Support Thread

Thank you very much for reporting this; I will fix it shortly.

That Software Guy

01 Aug 2010, 03:16
#364
skybluepunk avatar

skybluepunk

New Zenner

Join Date:
Oct 2008
Posts:
28
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

I have a product which I need to offer free ONLY when any item from a certain Manufacturer is purchased.

Ideally, the free product should be visible in my store, but not purchasable. Customers should be advised that the only way to get it is to buy something from manufacturer X.

Could you tell me if this is possible to set up using Better Together?

Thanks!

01 Aug 2010, 10:32
#365
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Better Together Contribution Support Thread

Better Together will not do this.

02 Aug 2010, 04:53
#366
skybluepunk avatar

skybluepunk

New Zenner

Join Date:
Oct 2008
Posts:
28
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

swguy:

Better Together will not do this.

Oh, that's disappointing!

But thanks for you prompt reply :-)

08 Aug 2010, 04:49
#367
artezan avatar

artezan

New Zenner

Join Date:
May 2010
Posts:
13
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

I've installed this but have a feeling it's not going to work for me but after hours of work I thought i'd ask.

Two things I'm trying to do.
First issue:
I want to offer a discount off category B (stitch markers) if any product in category A (hand dyed yarn) is purchased.

The problems: The products in category A are in 7 sub categories. So I have to do the 7 separate discounts - this is fine but when you use the marketing tool it list all 7 discounts which doesn't look very good.

Second issue the products in Category B (stitch markers) are populated from products put straight into this category and also linked from a hidden master category (that of a different manufacturer so that sales etc could be done just for that manufacturer) So therefore I have to do the discounts for both of these categories. Also not a problem but in the marketing it then shows up as Buy Item A Get 20% off Item B (with both of item B's titles showing up including the hidden category.

Really I'd just like to do a simple Buy from category A (and any of it's sub categories) get 20% off Category B (and any linked items in it) but I believe i can't do that (and it didn't work when I tried, lol).

I did do the changes in tpl_better_together_marketing.php from this page http://www.thatsoftwareguy.com/zencart_category_issues.html (adding the bit of code and changing to $category) but this didn't make any differences.

So is there any way of doing this so the marketing doesn't show up all the different sub categories?
I'm thinking it would just be neater to offer a discount code on the home page.

Also second issue.
It appears that only one product is discounted??
If I put in one lot of category A (yarn) and 2 lots of category B (stitch markers) then only one of the category B products were discounted. Is this correct?

My URL is http://www.artezan.com.au though I have taken the Best together links off.

Thank you so much for any help.

08 Aug 2010, 10:44
#368
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Better Together Contribution Support Thread

Only one B is discounted if it's Buy A get B at a discount. To discount 2 B's you must buy 2 A's.
"Category" in Better Together means "parent category" (master category id).

Further response by PM.

10 Aug 2010, 16:14
#370
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Better Together Contribution Support Thread

This has nothing to do with Better Together. You probably have an issue with your configure.php files if this is what's happening.

10 Aug 2010, 18:07
#371
lanpartyjoe avatar

lanpartyjoe

New Zenner

Join Date:
Jan 2010
Posts:
11
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

lanpartyjoe:

I'm using 1.3.9d

The problem:
When I go to the checkout the items in there point to an invalid url if I want to click back to the product I'm purchasing. They show like

http://www.mysite.com/index.php?main_page=product_info&products_id=355:cea2f59ff0dcf8e8e0c6de9b089488b6

It was a problem with SEO URLs not being updated

16 Aug 2010, 07:00
#372
yvonnek avatar

yvonnek

New Zenner

Join Date:
Aug 2009
Location:
Australia
Posts:
6
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

Hi, I am sorry if this is covered elsewhere but I can't seem to find the answer.
I have a wholesale website that I'm about to launch (zen cart 1.3.8a) and while all the products are already discounted I love the idea of being able to cross sell or have a 'candy bar' at the checkout to upsell our wholesalers with related items to what they have already put into their shopping cart.
ie if they are purchasing corsets to upsell fishnets, buying a racer costume then they may want to add the checkered long socks or a cap etc
However I don't want to create further discounts all the time. Can Better together & candy bar work without creating addtional discounts? Simply as a way to recommend related products at the checkout?

Any help or advice is greatly appreciated!!
:smile:

16 Aug 2010, 10:36
#373
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Better Together Contribution Support Thread

Instead of using "$" or "%" when you create your discounts, you can create cross sells using "X". Review the readme and the help file on my home page to get the details.

31 Aug 2010, 16:14
#374
robwuk avatar

robwuk

Zen Follower

Join Date:
Aug 2005
Location:
United Kingdom
Posts:
458
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

What im after doing is, offering item X free of charge when you purchase any product from any catagory

is this possible?

Ta

Rob

31 Aug 2010, 17:29
#375
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Better Together Contribution Support Thread

Not easily. It might be better to create a coupon just for this item and attach a minimum order dollar amount to it.

31 Aug 2010, 22:40
#376
robwuk avatar

robwuk

Zen Follower

Join Date:
Aug 2005
Location:
United Kingdom
Posts:
458
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

thankyou, i never thought of doing it that way

Rob

18 Sep 2010, 00:27
#377
twins225 avatar

twins225

New Zenner

Join Date:
Apr 2010
Posts:
53
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

i just had the mod installed today and i am just now getting around to playing with it.
here is the scenario i am going for:
spend $X in store (any product, any category) and get SPECIFIC product FREE.
i was hoping to use this set ip:
■add_cat_to_prod()
cat = category includes anything from my shop
prod = specific item i want to give free.
is there a way to add a minimum dollar amount from the category to allow this to work?
or is there another mod i should be looking for to achieve this???
thanks in advance!

18 Sep 2010, 10:23
#378
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Better Together Contribution Support Thread

Response by email.

18 Sep 2010, 15:14
#379
stevelucky avatar

stevelucky

New Zenner

Join Date:
Jun 2010
Posts:
44
Plugin Contributions:
0

Re: Better Together Contribution Support Thread

Would there be a way to set this up so that you could offer "buy two products and get one item of equal or lesser value for free", where if there were 3 items in the cart, it would give the lowest valued item for free. It would obviously need to work in multiples. If 6 items were in the cart, it would give the 2 lowest valued items for free. Is this capable of that? Or is there any way of making it do that?

18 Sep 2010, 15:28
#380
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Better Together Contribution Support Thread

No. Better Together works on single items. See PM.