Jump to content
boxtel

2gether Discount

Recommended Posts

Hi,

 

Does this display a coupon box on the shopping cart?

 

Thank you,

Michael


Michael

Share this post


Link to post
Share on other sites
Hi,

 

Does this display a coupon box on the shopping cart?

 

Thank you,

Michael

 

coupon box?


Treasurer MFC

Share this post


Link to post
Share on other sites
coupon box?

 

query in the order total module should read:

 

$together_products_query = tep_db_query("select product_1_id, product_2_id, discount, type from " . TABLE_2GETHER . " where discount > 0 and status = 1");

 

 

not :

 

$together_products_query = tep_db_query("select product_1_id, product_2_id, discount, type from " . TABLE_2GETHER . " where status = 1");

 

 

because we do not want to select recommendations (discount = 0).


Treasurer MFC

Share this post


Link to post
Share on other sites

Hello all,

 

I installed the contri and it works just fine.

But I was wondering, Is there a possibility to make the contri works "one way"?

 

As I have products worth ?90,-- and I like to use the 2gether contri to sell a little thing of just ?9,--

 

As soon as I click on the ?90,-- than the ?9,-- will show with discount (as it supposed to be)

But as soon as I click om the ?9.-- the the ?90,-- will show as well, but I do not like to tell people that if they buy a little thing they get a discount on a much more expencive item.

 

So what I would like is that as soon as you click on the ?9,-- item --> 2gether will not show

As soon as you click on the ?90.-- ---> 2gether will show.

 

I think this is a great contri that might enlarge the conversion on everyones site. Great work Amanda!!!!

 

I hope that someone can answer me....

 

Mark

Share this post


Link to post
Share on other sites
Hello all,

 

I installed the contri and it works just fine.

But I was wondering, Is there a possibility to make the contri works "one way"?

 

As I have products worth ?90,-- and I like to use the 2gether contri to sell a little thing of just ?9,--

 

As soon as I click on the ?90,-- than the ?9,-- will show with discount (as it supposed to be)

But as soon as I click om the ?9.-- the the ?90,-- will show as well, but I do not like to tell people that if they buy a little thing they get a discount on a much more expencive item.

 

So what I would like is that as soon as you click on the ?9,-- item --> 2gether will not show

As soon as you click on the ?90.-- ---> 2gether will show.

 

I think this is a great contri that might enlarge the conversion on everyones site. Great work Amanda!!!!

 

I hope that someone can answer me....

 

Mark

 

 

change in the module :

 

this:

$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where (product_1_id = '" . $together_id . "' or product_2_id = '" . $together_id . "') and status = 1");

 

to this:

 

$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where product_1_id = '" . $together_id . "' and status = 1");


Treasurer MFC

Share this post


Link to post
Share on other sites
change in the module :

 

this:

$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where (product_1_id = '" . $together_id . "' or product_2_id = '" . $together_id . "') and status = 1");

 

to this:

 

$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where product_1_id = '" . $together_id . "' and status = 1");

 

 

You are GOOD!! Thanks a lot Amanda!!! For this contri and your help on the forum!!

 

Mark

Share this post


Link to post
Share on other sites

first off, great contribution .. thank you for your time!

 

second, i'm get the following error when loading up products_info.php

 

1054 - Unknown column 'c.categories_status' in 'where clause'

 

select categories_name from categories_description cd left join categories c on cd.categories_id = c.categories_id where c.categories_status = '1' and cd.categories_id = '1' and cd.language_id = '1'

 

i understand that this is coming from application_top.php. the problem i see is that in my categories table, there is no categories_status field ... but the categories_2gether table has a status field.

 

i am using MS2.2.

 

am i doing something wrong?

Share this post


Link to post
Share on other sites

Hi,

 

This is just what i have been after, after almost getting the desired reults with x-sell/buy two previously.

 

I have installed this a few times now, and everything appears to work fine - i can add 2gether bundles in admin and they look fine - i ahve checked the database and they are being added correctly.

 

however . . .

 

my problem however is when product_info is calling the module i am getting no output, nothing at all - i even enabled display_errors in php.ini to see if there was anything - and no, nothing - i purposley 'broke' the script by removing the first <?php tag and then yes, it gives a syntax error as i would expect (so this shows the module is being called and loaded - but it jsut doesnt display anything at all!)

 

i am just wondering if anyone has any ideas - some of the code for this looks similar-ish to that of x-sell/buy two (which i did install previously) - could this possibly explain the problems im getting?

 

Any help would be greatly appreciated, as tis mod will suit me down to the ground!

 

Thanks in advance.

 

matt

Share this post


Link to post
Share on other sites
my problem however is when product_info is calling the module i am getting no output, nothing at all - i even enabled display_errors in php.ini to see if there was anything - and no, nothing - i purposley 'broke' the script by removing the first <?php tag and then yes, it gives a syntax error as i would expect (so this shows the module is being called and loaded - but it jsut doesnt display anything at all!)

 

Did you do a 'view source' to see if an error message is being thrown up but not displayed? Had that happen with a fatal error on another contribution. Might help pinpoint the issue.

Share this post


Link to post
Share on other sites
first off, great contribution .. thank you for your time!

 

second, i'm get the following error when loading up products_info.php

 

1054 - Unknown column 'c.categories_status' in 'where clause'

 

select categories_name from categories_description cd left join categories c on cd.categories_id = c.categories_id where c.categories_status = '1' and cd.categories_id = '1' and cd.language_id = '1'

 

i understand that this is coming from application_top.php. the problem i see is that in my categories table, there is no categories_status field ... but the categories_2gether table has a status field.

 

i am using MS2.2.

 

am i doing something wrong?

 

Whatever you're doing wrong I'm doing the same thing, LOL. Are you adding it to a totally fresh installation or is it already modified? I'm wondering about adding the sql to a 'clean' install then dropping my 'live' database on top, or even just exporting, deleting, creating a fresh one and importing, sometimes kick-starts things. Really looking forward to using this one though, been after this for ages!

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the idea, but sadly no :(

 

this is the html output:

 

<!-- 2gether bof //-->

<tr><td>2gether</td></tr><!-- 2gether eof //-->

 

(the 'tgether' text i just added to the php to check it was passing the 'if' rquirement (which it is) - i even changed the include to a require just in case - and still nothing from the module file - not even a single character :( if i could get an error i could work withit - but as im getting no output im stumped. If anyone has a quick basic query i could put into 2gether.php to see if i can get an output that would be great!.

 

Regarding the c.categories_status problems, i searched through all the files from the contirbutions and there is no mention of this at all? i tihnk there is a contirbution that lets you enable / disable whole categories - maybe something to do with this?

Share this post


Link to post
Share on other sites

Well i've made some progress :)

 

by modifying the query to:

 

$together_query = tep_db_query("select product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where (product_1_id = '948' or product_2_id = '948') and status = 1");

 

i can get it to work - it looks like the together_id is not being obtained correctly - if i manually add the id (like above, 948 is a valid 2gether id) it works.

 

im looking at:

 

if (!$together_id) $together_id = $_GET['products_id'];

if ($together_id) {

 

which i gather bascailly means:

 

if together_id doesnt exist or has no value then together_id should = the current products_id,

 

Then the second 'if' double checks there is a together_id and of so proceeds - if for wahtever reason there still isnt a together_id then it skips the whole script right until the bottom } - this is waht i'm guessing is happening to me.

 

(as you can no doubt tell i am no programmer!, i have gathered a basic grasp from using the superb osc:))

 

Well at least it's progress!

Share this post


Link to post
Share on other sites

Tried to edit my last post but it wouldnt let me :(

 

Phew, at last I tihnk i've got mine sorted, the problem was :

 

if (!$together_id) $together_id = $_GET['products_id'];

 

I modified it to:

 

if (!$together_id) $together_id = $HTTP_GET_VARS['products_id'];

 

And it is working ok now (apart from the add to cart isnt working, but that's another fix ;))

 

 

Just in case anyone else this problem!

 

Thanks again, great contribution :)

Share this post


Link to post
Share on other sites
Regarding the c.categories_status problems, i searched through all the files from the contirbutions and there is no mention of this at all? i tihnk there is a contirbution that lets you enable / disable whole categories - maybe something to do with this?

 

Yeah it was in the version put together by jenso, I think, with the files to compare as well as the install instructions.

 

I'm getting an offset-type error when I go to admin/2gether.php

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 7

 

select tid, product_1_id as product1_id, product_2_id as product2_id, discount, type, status from products_2gether limit -20, 20

 

Off to look at vger's 1064 thread, but in the meantime if anyone can point me to where I need to go to fix this... :)

Share this post


Link to post
Share on other sites

Dear Amanda

 

First of all: thank you so much for this contrib!

 

One question: I sell kitchen appliances. Also Whip devices (to make whipped cream). We have 4 different models (so 4 products) and gas catridges for those whips, which is one product. Please see the link when my poor explanation is not clear.

http://www.allesvoordekeuken.nl/catalog/pr...roducts_id=1318

 

I want to link the all 4 the whip's to the cartridges (so 4 different specials) but i can choose the cartridges only once. Once the cartridges have been selected for a special they are not available anymore for other specials.

 

How can I change the code to make a product multiple selectable ?

 

Tnx in advance!

Martijn

Share this post


Link to post
Share on other sites
Dear Amanda

 

First of all: thank you so much for this contrib!

 

One question: I sell kitchen appliances. Also Whip devices (to make whipped cream). We have 4 different models (so 4 products) and gas catridges for those whips, which is one product. Please see the link when my poor explanation is not clear.

http://www.allesvoordekeuken.nl/catalog/pr...roducts_id=1318

 

I want to link the all 4 the whip's to the cartridges (so 4 different specials) but i can choose the cartridges only once. Once the cartridges have been selected for a special they are not available anymore for other specials.

 

How can I change the code to make a product multiple selectable ?

 

Tnx in advance!

Martijn

 

1) in admin 2gether.php remove the exclude queries like:

 

$excludes_array1 = array();

// $exclude_query1 = tep_db_query("select product_1_id from " . TABLE_2GETHER);

// while ($excludes1 = tep_db_fetch_array($exclude_query1)) {

// $excludes_array1[] = $excludes1['product_1_id'];

// }

$excludes_array2 = array();

// $exclude_query2 = tep_db_query("select product_2_id from " . TABLE_2GETHER);

// while ($excludes2 = tep_db_fetch_array($exclude_query2)) {

// $excludes_array2[] = $excludes2['product_2_id'];

// }

 

$excludes_array = array_merge($excludes_array1,$excludes_array2);

 

2) would suggest to put an order by into the queries so you can easily see the duplicates

 

3) in the display module change the if into a while like :

 

//$num_together = tep_db_num_rows($together_query);

//if ($num_together > 0) {

// $record = tep_db_fetch_array($together_query);

while ($record = tep_db_fetch_array($together_query)) {

$discount = $record['discount'];

 

that way you can have as many as you want but not connect a product to itself.


Treasurer MFC

Share this post


Link to post
Share on other sites

Another 2 questions:

 

1

I encouter following problem: since I use 2gether the right column has disappeared at products in a together discount

 

2

I tried to change the font ype and size of the prices below the product image. I could change it but then the price moves to the right side of the image in stead of remaining below the image

 

Any suggestions??

Share this post


Link to post
Share on other sites
Another 2 questions:

 

1

I encouter following problem: since I use 2gether the right column has disappeared at products in a together discount

 

2

I tried to change the font ype and size of the prices below the product image. I could change it but then the price moves to the right side of the image in stead of remaining below the image

 

Any suggestions??

 

can you show your module code?


Treasurer MFC

Share this post


Link to post
Share on other sites

Forgot to write: right column only disappears when there are "also purchased products" and 2gether specials on a product

 

see links (first link without right column, second link with right column and no "also purchased products"

http://www.allesvoordekeuken.nl/catalog/pr...products_id=903

http://www.allesvoordekeuken.nl/catalog/pr...roducts_id=1318

 

when I remove the 2gether code from product_info right column is always there

------------------------

<?php

if (!$together_id) $together_id = $_GET['products_id'];

if ($together_id) {

include(DIR_WS_LANGUAGES . $language . '/2gether.php');

$show_money_savings = true; // show money savings

$show_percentage_savings = true; // show percentage savings

$show_original_prices = true; // show origibal prices of the products

?>

<tr>

<td>

<?php

$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where product_1_id = '" . $together_id . "' and status = 1");

 

//$num_together = tep_db_num_rows($together_query);

//if ($num_together > 0) {

while ($record = tep_db_fetch_array($together_query)) {

$discount = $record['discount'];

$discount_type = $record['type'];

if ($record['product_1_id'] == $together_id) {

$aq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";

$bq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";

} else {

$aq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";

$bq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";

}

 

$product_a_query = tep_db_query($aq);

$product_a = tep_db_fetch_array($product_a_query);

$product_b_query = tep_db_query($bq);

$product_b = tep_db_fetch_array($product_b_query);

$product_a_price = $product_a['products_price'];

$product_b_price = $product_b['products_price'];

 

if (DISPLAY_PRICE_WITH_TAX) {

$product_a_price = tep_add_tax($product_a_price,tep_get_tax_rate($product_a['products_tax_class_id']));

$product_b_price = tep_add_tax($product_b_price,tep_get_tax_rate($product_b['products_tax_class_id']));

}

 

if ($discount > 0) {

 

$together_image = '<img src=' . DIR_WS_IMAGES . 'save-icon_blink.gif alt="$" title="$">';

$together_text = TOGETHER_HEADING_TEXT_SPECIAL_OFFER . '<br>';

if (($show_money_savings) or ($show_percentage_savings)) {

$together_savings_string = TOGETHER_TEXT_YOU_SAVE;

} else {

$together_savings_string = '';

}

if ($discount_type == 'p') {

$together_price = tep_round(($product_a_price + $product_b_price) * (1-($discount/100)), 6);

if ($show_money_savings) {

$together_savings = $product_a_price + $product_b_price - $together_price;

$together_savings_string .= $currencies->format($together_savings);

}

if ($show_percentage_savings) {

$together_savings_string .= ' ' . $discount . '%';

}

} else {

$together_price = tep_round($product_a_price + $product_b_price - $discount,6);

if ($show_money_savings) {

$together_savings = $product_a_price + $product_b_price - $together_price;

$together_savings_string .= $currencies->format($together_savings);

}

if ($show_percentage_savings) {

$together_percentage = ($discount /($product_a_price + $product_b_price))*100;

$together_savings_string .= ' ' . $together_percentage . '%';

}

}

} else {

$together_price = tep_round(($product_a_price + $product_b_price), 6);

$together_savings_string = '';

$together_image = '<img src=' . DIR_WS_IMAGES . 'info_blue_small.jpg alt="i" title="i">';

$together_text = '<font color="orange">'.TOGETHER_HEADING_TEXT_SUGGESTION . '</font><br>';

}

$together_string = $currencies->format($together_price);

echo '<table width="80%" class="together" cellpadding="2" align="center">' .

'<tr>

<td valign="top" width="1px" align="left">' . $together_image . '</td>' .

'<td colspan="5" class="pageHeading">' . $together_text . TOGETHER_TEXT_BUY . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_a['products_id']) . '">' . str_replace('\'','`',$product_a['products_name']) . ' ' . tep_image('images/ico_arrow.gif', ICON_ARROW_RIGHT) . '</a> ' . TOGETHER_TEXT_AND . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_b['products_id']) . '">' . str_replace('\'','`',$product_b['products_name']) . ' ' . tep_image('images/ico_arrow.gif', ICON_ARROW_RIGHT) . '</a></td>' .

'</tr>

<tr>

<td></td>' .

'<td width="80px" align="center">' ;?>

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_a['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_a['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>

</noscript>

<?php

if ($show_original_prices) echo $currencies->format($product_a_price);

echo '</td><td class="buybothText" align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .

'<td width="80px" align="center">' ;?>

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_b['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_b['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>

</noscript>

<?php

if ($show_original_prices) echo $currencies->format($product_b_price);

echo '</td><td width="2%"></td>'.

'<td align="middle" nowrap valign="middle" class="buybothText">' . TOGETHER_TEXT_TOGETHER . ' ' . '<br><font color="red">'.$together_string . '</font><br><br>';

echo tep_draw_form('together', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'));

echo tep_draw_hidden_field('products_id', $product_a['products_id']) . tep_draw_hidden_field('buy_tinn_add', $product_b['products_id']) . tep_image_submit('button_buy_now.gif', 'Add Them Together');

echo '</form>';

echo '<table>';

if ($discount > 0) echo '<tr><td class="buybothText" nowrap align="center"><br><font color="red">' . $together_savings_string . '</font></td></tr><tr><td class="vsmalltext" nowrap align="center">' . TOGETHER_TEXT_DISCOUNT_CHECKOUT . '</td></tr>';

echo '</table>';

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

echo '</table>';

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

}

}

?>

Share this post


Link to post
Share on other sites
Forgot to write: right column only disappears when there are "also purchased products" and 2gether specials on a product

 

see links (first link without right column, second link with right column and no "also purchased products"

http://www.allesvoordekeuken.nl/catalog/pr...products_id=903

http://www.allesvoordekeuken.nl/catalog/pr...roducts_id=1318

 

when I remove the 2gether code from product_info right column is always there

------------------------

<?php

if (!$together_id) $together_id = $_GET['products_id'];

if ($together_id) {

include(DIR_WS_LANGUAGES . $language . '/2gether.php');

$show_money_savings = true; // show money savings

$show_percentage_savings = true; // show percentage savings

$show_original_prices = true; // show origibal prices of the products

?>

<tr>

<td>

<?php

$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where product_1_id = '" . $together_id . "' and status = 1");

 

//$num_together = tep_db_num_rows($together_query);

//if ($num_together > 0) {

while ($record = tep_db_fetch_array($together_query)) {

$discount = $record['discount'];

$discount_type = $record['type'];

if ($record['product_1_id'] == $together_id) {

$aq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";

$bq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";

} else {

$aq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_2_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";

$bq ="select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id='". $record['product_1_id'] ."' and p.products_id = pd.products_id and products_status = '1' and pd.language_id ='". $languages_id ."'";

}

 

$product_a_query = tep_db_query($aq);

$product_a = tep_db_fetch_array($product_a_query);

$product_b_query = tep_db_query($bq);

$product_b = tep_db_fetch_array($product_b_query);

$product_a_price = $product_a['products_price'];

$product_b_price = $product_b['products_price'];

 

if (DISPLAY_PRICE_WITH_TAX) {

$product_a_price = tep_add_tax($product_a_price,tep_get_tax_rate($product_a['products_tax_class_id']));

$product_b_price = tep_add_tax($product_b_price,tep_get_tax_rate($product_b['products_tax_class_id']));

}

 

if ($discount > 0) {

 

$together_image = '<img src=' . DIR_WS_IMAGES . 'save-icon_blink.gif alt="$" title="$">';

$together_text = TOGETHER_HEADING_TEXT_SPECIAL_OFFER . '<br>';

if (($show_money_savings) or ($show_percentage_savings)) {

$together_savings_string = TOGETHER_TEXT_YOU_SAVE;

} else {

$together_savings_string = '';

}

if ($discount_type == 'p') {

$together_price = tep_round(($product_a_price + $product_b_price) * (1-($discount/100)), 6);

if ($show_money_savings) {

$together_savings = $product_a_price + $product_b_price - $together_price;

$together_savings_string .= $currencies->format($together_savings);

}

if ($show_percentage_savings) {

$together_savings_string .= ' ' . $discount . '%';

}

} else {

$together_price = tep_round($product_a_price + $product_b_price - $discount,6);

if ($show_money_savings) {

$together_savings = $product_a_price + $product_b_price - $together_price;

$together_savings_string .= $currencies->format($together_savings);

}

if ($show_percentage_savings) {

$together_percentage = ($discount /($product_a_price + $product_b_price))*100;

$together_savings_string .= ' ' . $together_percentage . '%';

}

}

} else {

$together_price = tep_round(($product_a_price + $product_b_price), 6);

$together_savings_string = '';

$together_image = '<img src=' . DIR_WS_IMAGES . 'info_blue_small.jpg alt="i" title="i">';

$together_text = '<font color="orange">'.TOGETHER_HEADING_TEXT_SUGGESTION . '</font><br>';

}

$together_string = $currencies->format($together_price);

echo '<table width="80%" class="together" cellpadding="2" align="center">' .

'<tr>

<td valign="top" width="1px" align="left">' . $together_image . '</td>' .

'<td colspan="5" class="pageHeading">' . $together_text . TOGETHER_TEXT_BUY . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_a['products_id']) . '">' . str_replace('\'','`',$product_a['products_name']) . ' ' . tep_image('images/ico_arrow.gif', ICON_ARROW_RIGHT) . '</a> ' . TOGETHER_TEXT_AND . ' <a href="' . tep_href_link('product_info.php', 'products_id=' . $product_b['products_id']) . '">' . str_replace('\'','`',$product_b['products_name']) . ' ' . tep_image('images/ico_arrow.gif', ICON_ARROW_RIGHT) . '</a></td>' .

'</tr>

<tr>

<td></td>' .

'<td width="80px" align="center">' ;?>

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_a['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_a['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_a['products_image'], str_replace('\'','`',$product_a['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>

</noscript>

<?php

if ($show_original_prices) echo $currencies->format($product_a_price);

echo '</td><td class="buybothText" align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .

'<td width="80px" align="center">' ;?>

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_b['products_id']) . 'ℑ=0\\\')">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_b['products_image']) . '">' . tep_image(DIR_WS_IMAGES . $product_b['products_image'], str_replace('\'','`',$product_b['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; ?>

</noscript>

<?php

if ($show_original_prices) echo $currencies->format($product_b_price);

echo '</td><td width="2%"></td>'.

'<td align="middle" nowrap valign="middle" class="buybothText">' . TOGETHER_TEXT_TOGETHER . ' ' . '<br><font color="red">'.$together_string . '</font><br><br>';

echo tep_draw_form('together', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'));

echo tep_draw_hidden_field('products_id', $product_a['products_id']) . tep_draw_hidden_field('buy_tinn_add', $product_b['products_id']) . tep_image_submit('button_buy_now.gif', 'Add Them Together');

echo '</form>';

echo '<table>';

if ($discount > 0) echo '<tr><td class="buybothText" nowrap align="center"><br><font color="red">' . $together_savings_string . '</font></td></tr><tr><td class="vsmalltext" nowrap align="center">' . TOGETHER_TEXT_DISCOUNT_CHECKOUT . '</td></tr>';

echo '</table>';

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

echo '</table>';

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

}

}

?>

 

 

try putting the last

 

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

 

statement after the following }

 

so it looks like :

 

}

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

}


Treasurer MFC

Share this post


Link to post
Share on other sites

it's solved; I moved up the 2gether code in product_info like this

 

old code

']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td></FORM>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td>

 

<?php

if (MODULE_2GETHER_DISCOUNT_STATUS) {

echo '<tr><td>';

include(DIR_WS_MODULES . '2gether.php');

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

}

?>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

<?php

if ((USE_CACHE == 'true') && empty($SID)) {

echo '<br>' . tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

}

?>

 

 

new code

']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td></FORM>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

if (MODULE_2GETHER_DISCOUNT_STATUS) {

echo '<tr><td>';

include(DIR_WS_MODULES . '2gether.php');

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

}

?>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

<tr>

<td>

<?php

if ((USE_CACHE == 'true') && empty($SID)) {

echo '<br>' . tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

}

?>

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

×