Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I know the problem is in the code that has to be added to the /catalog/admin/includes/functions/html_output.php

 

this is the code I added to it:

//draw products multiselect box
 function tep_draw_products_mselect($name, $parameters = '', $selected_vals) {
global $currencies, $languages_id;

if ($exclude == '') {
  $exclude = array();
}

$select_string = '<select name="' . $name . '"';
if ($parameters) $select_string .= ' ' . $parameters;
$select_string .= ' multiple>';


  if (!in_array($products['products_id'], $exclude)) {
	$select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';
  }
		 if (!in_array((int)$products['products_id'].":".(int)$sdek, $exclude)) {
  }


$select_string .= '</select>';

return $select_string;
 }

//draw products multiselect delete box
 function tep_draw_products_delete_mselect($name, $parameters = '', $selected_vals) {
global $currencies, $languages_id;

if ($exclude == '') {
  $exclude = array();
}

$select_string = '<select name="' . $name . '"';
if ($parameters) $select_string .= ' ' . $parameters;
$select_string .= ' multiple>';

$products_query = tep_db_query("select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name");
while ($products = tep_db_fetch_array($products_query)) {
$select_string .= '<option value="' . $products['featured_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'].'</option>\n';
}

$select_string .= '</select>';

return $select_string;
}

 

and this is the result when I try to add a product:

 

http://www.rooneysmerkkleding.nl/featuredprob.jpg

 

 

The product list should be filled with all the products in the catalogus..

 

 

help mehhh

Posted

please help me to fix the query ? anyone ?

 

(there is really a lack of feedback on the oscommerce contributions unfortunatly)

Posted
please help me to fix the query ? anyone ?

 

(there is really a lack of feedback on the oscommerce contributions unfortunatly)

 

Fixed the problem myself:

 

this is the proper piece of code for this modification in the html_output.php

 

//draw products multiselect box
 function tep_draw_products_mselect($name, $parameters = '', $selected_vals) {
global $currencies, $languages_id;

if ($exclude == '') {
  $exclude = array();
}

$select_string = '<select name="' . $name . '"';
if ($parameters) $select_string .= ' ' . $parameters;
$select_string .= ' multiple>';

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . 		TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
while ($products = tep_db_fetch_array($products_query)) {


  if (!in_array($products['products_id'], $exclude)) {
	$select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';
  }

}

$select_string .= '</select>';

return $select_string;
 }

//draw products multiselect delete box
 function tep_draw_products_delete_mselect($name, $parameters = '', $selected_vals) {
global $currencies, $languages_id;

if ($exclude == '') {
  $exclude = array();
}

$select_string = '<select name="' . $name . '"';
if ($parameters) $select_string .= ' ' . $parameters;
$select_string .= ' multiple>';

$products_query = tep_db_query("select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name");
while ($products = tep_db_fetch_array($products_query)) {
$select_string .= '<option value="' . $products['featured_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'].'</option>\n';
}

$select_string .= '</select>';

return $select_string;
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...