Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Extra Product Fields for 2.31 v1.1 Problem with replacing code


al3ks

Recommended Posts

I tried to find a thread related to this addon but couldn't find one, so I'm posting this here.

I am trying to install the Extra Product Fields for 2.31 v1.1 contribution for Oscommerce 2.3.1

 

The problem is I got to step 15f in the instrcutions where it says to: "

Find around line 298 under case 'copy_to_confirm' in the part underneath elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') the following section of code:"

 

	    $description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
	    while ($description = tep_db_fetch_array($description_query)) {
		  tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
	    }

 

 

and REPLACE it with the following:

 

 

// description copy modified to work with Extra Product Fields
	    $description_query = tep_db_query("select * from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
	    while ($description = tep_db_fetch_array($description_query)) {
		  $description['products_id'] = $dup_products_id;
		  $description['products_viewed'] = 0;
		  tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $description);
	    }
// end Extra Product Fields

 

(That's in admin/categories.php)

 

So the thing is I have the products specifications contibution installed and it conflicts with the code I need to repalce. I tried figuring it out but at the end I got really confused.

 

My code that I should repalce accoring to these instructions looks like this:

 

// Products Specifications
		$description_query = tep_db_query ("select language_id,
												   products_name,
												   products_description,
												   products_tab_1,
												   products_tab_2,
												   products_tab_3,
												   products_tab_4,
												   products_tab_5,
												   products_tab_6
										  from " . TABLE_PRODUCTS_DESCRIPTION . "
										  where products_id = '" . (int) $products_id . "'
										");
		while ($description = tep_db_fetch_array ($description_query) ) {
// Products Specifications
		  tep_db_query ("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (
			products_id,
			language_id,
			products_name,
			products_description,
			products_tab_1,
			products_tab_2,
			products_tab_3,
			products_tab_4,
			products_tab_5,
			products_tab_6,
			products_viewed
		  ) values (
			'" . (int) $dup_products_id . "',
			'" . (int) $description['language_id'] . "',
			'" . tep_db_input($description['products_name']) . "',
			'" . tep_db_input ($description['products_description']) . "',
			'" . tep_db_input ($description['products_tab_1']) . "',
			'" . tep_db_input ($description['products_tab_2']) . "',
			'" . tep_db_input ($description['products_tab_3']) . "',
			'" . tep_db_input ($description['products_tab_4']) . "',
			'" . tep_db_input ($description['products_tab_5']) . "',
			'" . tep_db_input ($description['products_tab_6']) . "',
			'0'
		  )");
		}

 

Would really appreciate any help replacing the code without removing any essential code for the product specification contibution.

Edited by al3ks

Find this post helpful? Click the 'Like this' button. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...