Jump to content
boxtel

2gether Discount

Recommended Posts

you have multiple product_1_id with the same id ?

 

Yes, i believe I had. It't seems to work if I change the product from product 1 to product 2.

 

Thank you for your support

Share this post


Link to post
Share on other sites
Here is the beast:

Thanks, Amanda

 

well, you could comment out the 2gether lines starting with :

 

$products_name .=

 

those are the lines which add the 2gether images to the box.

 

if that eleviates the error then the error is somewhere in those lines.


Treasurer MFC

Share this post


Link to post
Share on other sites

Does somebody have a working version of this contrib with all the problems mentioned (and solved) in this topic solved??

Share this post


Link to post
Share on other sites

Most of the problems are solved now. Its almost working but I have one problem left:

 

The 2gether discount works but if I now order the (single) product on the page I get the 2gether products in my cart..... What could be wrong? Where should I look?

Share this post


Link to post
Share on other sites
Most of the problems are solved now. Its almost working but I have one problem left:

 

The 2gether discount works but if I now order the (single) product on the page I get the 2gether products in my cart..... What could be wrong? Where should I look?

 

I am sure you can solve that one as well.


Treasurer MFC

Share this post


Link to post
Share on other sites

Thanks for the trust in my programming skills. ;)

 

I've been looking at it for 4 hours now. I really don't know why this occurs, hoped someone had solved the same problem...

 

I'll go try again tonight.

Share this post


Link to post
Share on other sites

I'm lost :blink: I really don't understand it anymore.....

 

The following 3 pieces of code should contain the problem:

 

product_info.php: buy (single product)

						   <tr><td width="6"></td><td class=ps2 align=right><?php echo $products_price; ?></td><td  align=right width=135><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW); ?></td><td width="10"></td></tr>

 

2gether.php: buy now button (2 gether special)

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', IMAGE_BUTTON_BUY2GETHER);

 

 

application_top.php: add product to cart

	  case 'add_product' :	if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
							if (tep_get_products_stock($_POST['products_id']) > 0) {
							  $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'])) {
							if (tep_get_products_stock($_POST['buy_tinn_add']) > 0) {
							  $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;

 

If I disable or the button in the 2gether.php file or the second if (buy_tinn_add) the add to cart from a single product works.

If I don't disable any of these code then it adds allways the 2gether special offer (2 products) to the cart....

Edited by Ғяαпқ

Share this post


Link to post
Share on other sites
I'm lost :blink: I really don't understand it anymore.....

 

The following 3 pieces of code should contain the problem:

 

product_info.php: buy (single product)

						   <tr><td width="6"></td><td class=ps2 align=right><?php echo $products_price; ?></td><td  align=right width=135><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW); ?></td><td width="10"></td></tr>

 

2gether.php: buy now button (2 gether special)

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', IMAGE_BUTTON_BUY2GETHER);

application_top.php: add product to cart

	  case 'add_product' :	if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
							if (tep_get_products_stock($_POST['products_id']) > 0) {
							  $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'])) {
							if (tep_get_products_stock($_POST['buy_tinn_add']) > 0) {
							  $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;

 

If I disable or the button in the 2gether.php file or the second if (buy_tinn_add) the add to cart from a single product works.

If I don't disable any of these code then it adds allways the 2gether special offer (2 products) to the cart....

 

 

well, it has been discussed earlier in this support forum.

 

the original code of product info puts the start of the form to add to cart high up in the page and the end of that form way down on the page. This means that you are virtually unable to add any other forms on the page without running into problems.

 

to correct that, you move the </form> tag from way down under to just after the normal add to cart button. That ensures that the normal add to cart form is closed before other forms, like 2gether, are opened.


Treasurer MFC

Share this post


Link to post
Share on other sites

Thanks allot Amanda, you saved my weekend!!

 

I hope I can help you (and others on this forum) someday....

Edited by Ғяαпқ

Share this post


Link to post
Share on other sites

Hi,

 

This seems like a very useful contribution. Just wondering if someone is using it together with QTPro 4.2 or 4.25?

 

I have had attributes issues with QTPro and Wishlist earlier, but someone solved this for me with changes in application_top.php. Maybe this could be done for 2gether discount aswell.

Share this post


Link to post
Share on other sites
Hi,

 

This seems like a very useful contribution. Just wondering if someone is using it together with QTPro 4.2 or 4.25?

 

I have had attributes issues with QTPro and Wishlist earlier, but someone solved this for me with changes in application_top.php. Maybe this could be done for 2gether discount aswell.

 

well, if you would explain as to which issues you are refering to, then I could look into them.


Treasurer MFC

Share this post


Link to post
Share on other sites

Hi Amanda,

 

I have not installed 2gether discount yet but I'm a bit concerned if it works at all with QTPro and SPPC. Just wanted to heck if someone else are using these contributions.

Share this post


Link to post
Share on other sites

Hi

I am trying to add this to my website which heavily loaded. I have QTPRO, wishlist and others, however the only install issue that I have run into with a merge problem is application_top.

Here is what we are to add

   //// bof: Added 2gether (contribution 3929)
  // case 'add_product' : if	(isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
if (tep_get_products_stock($HTTP_POST_VARS['products_id']) > 0) $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']);
}
if (isset($HTTP_POST_VARS['buy_tinn_add']) && is_numeric($HTTP_POST_VARS['buy_tinn_add'])) {
if (tep_get_products_stock($HTTP_POST_VARS['buy_tinn_add']) > 0) {
$cart->add_cart($HTTP_POST_VARS['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['buy_tinn_add'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
}
}
////  eof: Added 2gether (contribution 3929)

 

here is what I have in this area:

  // 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']) && ($HTTP_POST_VARS['products_id']==(int)$HTTP_POST_VARS['products_id'])) {
  //++++ QT Pro: Begin Changed code
							$attributes=array();
							if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) {
							  $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']);
							  foreach ($attrlist as $attr) {
								list($oid, $oval)=explode('-',$attr);
								if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
								  $attributes[$oid]=$oval;
							  }
							}
							if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) {
							  foreach ($HTTP_POST_VARS['id'] as $key=>$val) {
								if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val)
								  $attributes=$attributes + $HTTP_POST_VARS['id'];
							  }
							}
						   // $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1,  $attributes);
			//added below to allow for quantity field

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


//++++ QT Pro: End Changed Code
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

so this is what I came up with - will this work or will it interfere?

 // 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']) && ($HTTP_POST_VARS['products_id']==(int)$HTTP_POST_VARS['products_id'])) {
//// bof: Added 2gether (contribution 3929)
  // case 'add_product' : if	(isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
if (tep_get_products_stock($HTTP_POST_VARS['products_id']) > 0) $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']);
}
if (isset($HTTP_POST_VARS['buy_tinn_add']) && is_numeric($HTTP_POST_VARS['buy_tinn_add'])) {
if (tep_get_products_stock($HTTP_POST_VARS['buy_tinn_add']) > 0) {
$cart->add_cart($HTTP_POST_VARS['buy_tinn_add'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['buy_tinn_add'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
}
}
////  eof: Added 2gether (contribution 3929)
//++++ QT Pro: Begin Changed code
							$attributes=array();
							if (isset($HTTP_POST_VARS['attrcomb']) && (preg_match("/^\d{1,10}-\d{1,10}(,\d{1,10}-\d{1,10})*$/",$HTTP_POST_VARS['attrcomb']))) {
							  $attrlist=explode(',',$HTTP_POST_VARS['attrcomb']);
							  foreach ($attrlist as $attr) {
								list($oid, $oval)=explode('-',$attr);
								if (is_numeric($oid) && $oid==(int)$oid && is_numeric($oval) && $oval==(int)$oval)
								  $attributes[$oid]=$oval;
							  }
							}
							if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) {
							  foreach ($HTTP_POST_VARS['id'] as $key=>$val) {
								if (is_numeric($key) && $key==(int)$key && is_numeric($val) && $val==(int)$val)
								  $attributes=$attributes + $HTTP_POST_VARS['id'];
							  }
							}
						   // $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1,  $attributes);
			//added below to allow for quantity field

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


//++++ QT Pro: End Changed Code
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

my biggest concern is the the last "$cart->add_cart......" line in the qtpro. Can someone let me know if this is the best way to merge these two?

Teresa - ttstitches

Share this post


Link to post
Share on other sites
Sorry, but in ceckout_confirmation I can see the 2gether price without tax.

It's wrong!

also in ceckout_confirmation the 2gether price must be with tax, and the amount of tax (italian IVA) must be included with 2gether tax.

Example: (italian tax is 20%)

product price (include tax): €120,00

shipping (include tax): €8,40

tax (IVA): €21,40

 

2gether discount (include):€ 7,80

tax (with 2gether): 22,70 (21,40+1,30)

 

suggestion: all is more simply if your contribution have tax class

 

Hi,

 

Did you get the tax calculation to work?

 

Thank s

Share this post


Link to post
Share on other sites

I installed the last full version but in admin area I recive this error message:

 

Not Found

The requested URL /catalog/admin/FILENAME_2GETHER was not found on this server.

 

I follow all instructions in the file install.txt.

 

Help me please.

 

p.s. sorry for my English

Share this post


Link to post
Share on other sites
I installed the last full version but in admin area I recive this error message:

 

Not Found

The requested URL /catalog/admin/FILENAME_2GETHER was not found on this server.

 

I follow all instructions in the file install.txt.

 

Help me please.

 

p.s. sorry for my English

 

2) add to includes/filenames.php in admin and catalog

 

define('FILENAME_2GETHER', '2gether.php');


Treasurer MFC

Share this post


Link to post
Share on other sites

I add in /includes/filename.php and /include/database.php and now run, but

in 2gether procedure I recive this error:

Fatal error: Call to undefined function: tep_get_products_price() in /web/htdocs/www.arclima.it/home/catalog/admin/2gether.php on line 268

Thanks

Share this post


Link to post
Share on other sites
I add in /includes/filename.php and /include/database.php and now run, but

in 2gether procedure I recive this error:

Fatal error: Call to undefined function: tep_get_products_price() in /web/htdocs/www.arclima.it/home/catalog/admin/2gether.php on line 268

Thanks

SOLVED

 

Now the problem is this

 

Fatal error: Call to undefined function: tep_get_products_image() in /web/htdocs/www.arclima.it/home/catalog/admin/2gether.php on line 272

 

Where is the function?

 

Thanks

Share this post


Link to post
Share on other sites
SOLVED

 

Now the problem is this

 

Fatal error: Call to undefined function: tep_get_products_image() in /web/htdocs/www.arclima.it/home/catalog/admin/2gether.php on line 272

 

Where is the function?

 

Thanks

 

follow the install instructions


Treasurer MFC

Share this post


Link to post
Share on other sites

The function tep_get_products_image() does not exist, has verified in /admin/include/function/general.php.

In the installation rows not there is no reference to this function.

Thanks of the availability and courtesy.

Share this post


Link to post
Share on other sites

i need some help... i'm following the installation process rigourously.. but met into some problem with the installation..

 

according to install.txt, this is the 6th and 7th step

 

6) create the table

 

DROP TABLE IF EXISTS products_2gether;

CREATE TABLE products_2gether (

tid int(11) unsigned NOT NULL auto_increment,

product_1_id int(11) unsigned NOT NULL default '0',

product_2_id int(11) unsigned NOT NULL default '0',

discount float NOT NULL default '5',

type char(1) NOT NULL default 'p',

status int(1) unsigned NOT NULL default '0',

PRIMARY KEY (tid),

KEY producta (product_1_id,product_2_id,status)

) TYPE=MyISAM;

 

7) in product_info.php you add where you want it the display module

 

<?php

if (MODULE_2GETHER_DISCOUNT_STATUS) {

echo '<tr><td>';

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

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

}

?>

 

what on earth is the 6th step? where do i create it?

 

and for the 7th step, where do u recommend i paste it into? what does it do in the first place?

 

if needed, the fifth step is

 

5) in admin/includes/boxes/catalog.php add a line to get the menu option:

 

'<a href="' . tep_href_link(FILENAME_2GETHER, '', 'NONSSL') . '" class="menuBoxContentLink">' . '2gether specials' . '</a><br>' .

Share this post


Link to post
Share on other sites

i think i've figured out where to create the table..... myphpadmin?

help25vm.jpg

and as i show the structure..

help17eh.jpg

 

but no. 7 remains a mystery. yes i see the product_info.php located under admin.. but i need to choose where to paste the code? hm.

 

currently,

 

when i click and product or category, i get this

 

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 = '34' and cd.language_id = '1'

 

[TEP STOP]

 

the main page still displays well though.

 

my admin area works fine though

Share this post


Link to post
Share on other sites
i think i've figured out where to create the table..... myphpadmin?

help25vm.jpg

and as i show the structure..

help17eh.jpg

 

but no. 7 remains a mystery. yes i see the product_info.php located under admin.. but i need to choose where to paste the code? hm.

 

currently,

 

when i click and product or category, i get this

 

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 = '34' and cd.language_id = '1'

 

[TEP STOP]

 

the main page still displays well though.

 

my admin area works fine though

 

there is no

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 = '34' and cd.language_id = '1'

in 2gether discount.

 

if you choose to install the latest version by jenso then I strongly suggest you do not copy the included product_info.php into your site as it contains parts of other contributions you do not have.


Treasurer MFC

Share this post


Link to post
Share on other sites
there is no

 

in 2gether discount.

 

if you choose to install the latest version by jenso then I strongly suggest you do not copy the included product_info.php into your site as it contains parts of other contributions you do not have.

 

ah! too late. oops. n i didn't back up my previous product_info.php

 

which is easier now?

 

1. to install the other contributions

2. switch to ur version

3. or manually edit the product_info.php to remove the unneccessary stuff

 

 

wld also need a little bit of tips.. sorry about this.

 

http://home.pacific.net.sg/~chinngee/product_info.php

Share this post


Link to post
Share on other sites

got desperate just now. dled the original oscommerce for the product_info.php to overwrite, BUT it still does not work. bah. same error message

Edited by qisahn

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

×