Jump to content
boxtel

2gether Discount

Recommended Posts

I have just resolved all problems except one:

 

I can't display the images for the produts in checkout_confirmation.php.

in the properties of the images the link is images/save-icon_sm.gif

 

well, it was never supposed to show the product images in checkout confirmation.

however, you can:

 

just add p.products_image to the where clause of the queries.

 

and add a tep_image to the $together_product_names string.

 

so for the first product this :

 

$together_price_query = tep_db_query("select p.products_price, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = " . $together_products['product_1_id']);

 

would become:

 

$together_price_query = tep_db_query("select p.products_price, p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = " . $together_products['product_1_id']);

 

 

and this:

 

$together_product_names .= '<br>' . $together_qty . ' x (' . $together_price['products_name'] . ' + ';

 

would become

 

$together_product_names .= '<br>' . $together_qty . ' x (' . tep_image(DIR_WS_IMAGES.$together_price['products_image'],$together_price['products_name'],SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ' '.$together_price['products_name'] . ' + ';


Treasurer MFC

Share this post


Link to post
Share on other sites

I've the same problem with cart: I can see only one product, and the price is wrong

I've this on prodct_info page:

<td class="main" align="right"><?php echo TEXT_QUANTITY . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2') . tep_draw_separator('pixel_trans.gif', '5', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
							</form>
							 </tr>
		</table></td>
					</tr>
	</table></td>
				<?php 
if (MODULE_2GETHER_DISCOUNT_STATUS) { 
 echo '<tr><td>';
 include(DIR_WS_MODULES . '2gether.php');
 echo '</td></tr>';
} 
?>
  </tr>
  <tr>
	<td>

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


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
I've the same problem with cart: I can see only one product, and the price is wrong

I've this on prodct_info page:

<td class="main" align="right"><?php echo TEXT_QUANTITY . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2') . tep_draw_separator('pixel_trans.gif', '5', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
							</form>
							 </tr>
		</table></td>
					</tr>
	</table></td>
				<?php 
if (MODULE_2GETHER_DISCOUNT_STATUS) { 
 echo '<tr><td>';
 include(DIR_WS_MODULES . '2gether.php');
 echo '</td></tr>';
} 
?>
  </tr>
  <tr>
	<td>

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

 

 

1) product 1077 has no stock and will not be added to the cart if no stock.

2) what is wrong with the prices?


Treasurer MFC

Share this post


Link to post
Share on other sites
1) product 1077 has no stock and will not be added to the cart if no stock.

2) what is wrong with the prices?

 

 

use this in application top to add regardless of stock :

 

case 'add_product' : if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {

$cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+1, $_POST['id']);

}

if (isset($_POST['buy_tinn_add']) && is_numeric($_POST['buy_tinn_add'])) {

$cart->add_cart($_POST['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($_POST['buy_tinn_add'], $_POST['id']))+1, $_POST['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;


Treasurer MFC

Share this post


Link to post
Share on other sites

It's seem work right!

Where I do put this in application top?

ps: how can I do to change "Your 2gether Discount" in ceckout_confirmation in Italian language?

Edited by 100asa

Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
It's seem work right!

Where I do put this in application top?

ps: how can I do to change "Your 2gether Discount" in ceckout_confirmation in Italian language?

 

that code replaces :

 

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

 

 

here is the english file

includes/languages/english/modules/order_total/2gether.php

 

italian maybe here?

includes/languages/italian/modules/order_total/2gether.php


Treasurer MFC

Share this post


Link to post
Share on other sites

Work fine!

only one: the price under the two small image for offer are without tax; instead I want include tax.

Wonderful Amanda!


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

One general question:

I've tax module installed and working: OK!

But in checkout_confirmation I would disappear tax, without unistall tax module or other, only hide tax, because many more customer think tax adding more.

Thank's


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
One general question:

I've tax module installed and working: OK!

But in checkout_confirmation I would disappear tax, without unistall tax module or other, only hide tax, because many more customer think tax adding more.

Thank's

 

Amanda

 

Thank you so much for creating this for us!!

Sorry I had no clue how much support work this would load on you but again I thank you so much for it.

Off to play with and install this now.

 

-- Mindy

Share this post


Link to post
Share on other sites

Sorry, only another request: in admin, can I have little image while seeing offer?

I've ask this, but I see always great image


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

Sorry, only another request: in admin, can I have little image while seeing offer?

I've ask this, but I see always great image

 

SOLVED:

on admin/2gether.php, line 272 and 276 modify

$contents[] = array('text' => '' . tep_info_image(tep_get_products_image($tInfo->product1_id),SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT));

$contents[] = array('text' => '' . tep_info_image(tep_get_products_image($tInfo->product2_id),SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
Amanda

 

Thank you so much for creating this for us!!

Sorry I had no clue how much support work this would load on you but again I thank you so much for it.

Off to play with and install this now.

 

-- Mindy

 

the only difficulty is to normalize it again so it works on stores who do not have all the other changes I have made over the months.


Treasurer MFC

Share this post


Link to post
Share on other sites
Work fine!

only one: the price under the two small image for offer are without tax; instead I want include tax.

Wonderful Amanda!

 

well, then yoo need to

 

add to the product queries to select the tax class id:

 

p.products_tax_class_id

 

 

to dispay price with tax :

 

$currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']))


Treasurer MFC

Share this post


Link to post
Share on other sites

Sorry Amanda, but I have this in catalog/includes/modules/2gether.php

if ($num_together > 0) {
 $record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 $aq ="select p.products_id, p.products_tax_class_id, p.products_image, p.products_price, 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_tax_class_id, p.products_image, p.products_price, 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 {
  $together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where product_2_id = '" . $_GET['products_id'] . "' and status = 1 ");
  $num_together = tep_db_num_rows($together_query);
  if ($num_together > 0) {
 $record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 $aq ="select p.products_id, p.products_tax_class_id, p.products_image, p.products_price, 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_tax_class_id, p.products_image, p.products_price, 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 ."'";
  }
}

 

It's right?

 

2nd:

where do I put information to display price with tax?

line 83 I've:

<?php echo '<br>'.$currencies->format($product_a['products_price']).'</td><td align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .

 

line 92 I've:

echo '<br>'.$currencies->format($product_b['products_price']).'</td><td width="2%"></td>'.

Thank's


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
yes.

 

change :

 

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

 

to:

 

<?php echo '<br>'.$currencies->format($product_a['products_price']).'</td><td align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .

change:

 

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

to:

 

echo '<br>'.$currencies->format($product_b['products_price']).'</td><td width="2%"></td>'.

 

This price with tax!

 

ps: how can I have the the 2gether box offers, with frame (like in your site?)


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
This price with tax!

 

ps: how can I have the the 2gether box offers, with frame (like in your site?)

 

in css:

 

.borderGray { border-color: #d3d3d3; border-style: solid; border-width: 1px;}

 

 

in module:

 

echo '<table class="borderGray" cellpadding="2" align="center">' .


Treasurer MFC

Share this post


Link to post
Share on other sites

Thank's

The last question is: how can I do to have the price with tax under the products 2gether offer?

I've tryed this in 2gether module:

 

$record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 $aq ="select p.products_id, p.products_tax_class_id, p.products_image, p.products_price, 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_tax_class_id, p.products_image, p.products_price, 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 {
  $together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where product_2_id = '" . $_GET['products_id'] . "' and status = 1 ");
  $num_together = tep_db_num_rows($together_query);
  if ($num_together > 0) {
 $record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 $aq ="select p.products_id, p.products_tax_class_id, p.products_image, p.products_price, 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_tax_class_id, p.products_image, p.products_price, pd.product

 

and then...

<?php echo '<br>'.$currencies->format($product_a['products_price'],tep_get_tax_rate($product_a['products_tax_class_id'])).'</td><td align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .

 

and for product B:

echo '<br>'.$currencies->format($product_b['products_price'],tep_get_tax_rate($product_b['products_tax_class_id'])).'</td><td width="2%"></td>'.

 

It's right?


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

Hi, Amanda.

Thanks for a great mod!

However, I do have one problem. When looking at order total, the discount is not deducted from the Confirmation page.

Is there a certain sort order when activating the module in Order Totals?

(Have installed it with sort order 2)

 

Cheers

Endre

Share this post


Link to post
Share on other sites
Thank's

The last question is: how can I do to have the price with tax under the products 2gether offer?

I've tryed this in 2gether module:

 

$record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 $aq ="select p.products_id, p.products_tax_class_id, p.products_image, p.products_price, 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_tax_class_id, p.products_image, p.products_price, 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 {
  $together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ." where product_2_id = '" . $_GET['products_id'] . "' and status = 1 ");
  $num_together = tep_db_num_rows($together_query);
  if ($num_together > 0) {
 $record = tep_db_fetch_array($together_query);
 $discount = $record['discount'];
 $discount_type = $record['type'];
 $aq ="select p.products_id, p.products_tax_class_id, p.products_image, p.products_price, 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_tax_class_id, p.products_image, p.products_price, pd.product

 

and then...

<?php echo '<br>'.$currencies->format($product_a['products_price'],tep_get_tax_rate($product_a['products_tax_class_id'])).'</td><td align="center" width="100px"><img src="images/icon_plus.gif" border="0" style="vertical-align: middle"></td>' .

 

and for product B:

echo '<br>'.$currencies->format($product_b['products_price'],tep_get_tax_rate($product_b['products_tax_class_id'])).'</td><td width="2%"></td>'.

 

It's right?

 

 

use $currencies->display_price() instead of $currencies->format() because there the tax is added if provided.


Treasurer MFC

Share this post


Link to post
Share on other sites

It's ok.

But also 2gether price and discount are without tax! customers want see all price with tax!

 

 

Sorry, but when this appear?

.....
} else {
  $together_price = tep_round(($product_a['products_price'] + $product_b['products_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>';
}
....


Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites

I've made this change to view price with tax:

change this

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

to this

$together_string = $currencies->display_price(($together_price),tep_get_tax_rate($product_a['products_tax_class_id']));

and this is OK

 

I've also change this

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

on this

$together_savings_string = TOGETHER_TEXT_YOU_SAVE . $currencies->display_price($together_savings,tep_get_tax_rate($together_savings['products_tax_class_id'])). ' !';

 

but it's wrong: saving is always without tax! :(

 

ps: it's possible show percentage discount too?

Edited by 100asa

Skype: centoasa

Skype: remigioruberto

Share this post


Link to post
Share on other sites
Hi, Amanda.

Thanks for a great mod!

However, I do have one problem. When looking at order total, the discount is not deducted from the Confirmation page.

Is there a certain sort order when activating the module in Order Totals?

(Have installed it with sort order 2)

 

Cheers

Endre

 

Any idea anyone?

I see that you have correct discount on your checkout page, 100asa.

What sort order do you have on your order total module?

Seems like a 4 perhaps?

 

Appreciate any help.

 

Cheers

Endre

Share this post


Link to post
Share on other sites
Any idea anyone?

I see that you have correct discount on your checkout page, 100asa.

What sort order do you have on your order total module?

Seems like a 4 perhaps?

 

Appreciate any help.

 

Cheers

Endre

 

I use 2 which works ok


Treasurer MFC

Share this post


Link to post
Share on other sites
I use 2 which works ok

 

I also use a price break discount module.

Do you think this could cause any problems with the 2gether module?

You see, the discount is still not deducted from the checkout page. Both products are added to the shopping cart as intended.

Very frustrating, otherwise the module works just fine.

Have unistalled and reinstalled module, but no help.

 

Endre

Share this post


Link to post
Share on other sites
I also use a price break discount module.

Do you think this could cause any problems with the 2gether module?

You see, the discount is still not deducted from the checkout page. Both products are added to the shopping cart as intended.

Very frustrating, otherwise the module works just fine.

Have unistalled and reinstalled module, but no help.

 

Endre

 

 

not sure but try:

 

1) remove the order total module

 

2)rename the file to ot_together.php

in the file do the same with :

 

class ot_together {

var $title, $output;

 

function ot_together() {

$this->code = 'ot_together';

 

3)rename the module language files the same.

 

4)reinstall the module.


Treasurer MFC

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

×