Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Featured products, show model in pull down menu


petsk

Recommended Posts

Hi everyone,

 

I'm using featured products contribution, http://www.oscommerce.com/community/contributions,651

 

Is there a way to show the product_model in front of the product name in the pull down list?

I can't figure it out, I've tried to add the product_model in various places but nothing shows up.

 

The code for pull down menu:

			<td class="main"><?php echo ($sInfo->products_name) ? $sInfo->products_name : tep_draw_products_pull_down('products_id', 'style="font-size:10px"', $featured_array); echo tep_draw_hidden_field('products_price', $sInfo->products_price); ?></td>

 

Any ideas? :blink: :D

Link to comment
Share on other sites

it would need to be added to the function tep_draw_products_pull_down in admin/includes/functions/general.php

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

  • 9 months later...
Can you possibly help me out with exactly what has to go where?

 

Sure, here comes...

 

Open: admin/includes/functions/general.php

 

Find this at line ~199

	$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>';
  }
}

 

Change to:

	$products_query = tep_db_query("select p.products_id, p.products_model, 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_model'] . ']?' . $products['products_name'] . '?(' . $currencies->format($products['products_price']) . ')</option>';
  }
}

 

You can actually put almost any product information in the pulldown menu, eg stock quantity etc.

 

// Peter

 

EDIT: Note that this "hack" is going to show up in every pull down menu in admin

Edited by petsk
Link to comment
Share on other sites

Thank you so much!

 

Is there a way to have the drop down menu items ordered by the model number (lowest to highest)?

 

Sure, here comes...

 

Open: admin/includes/functions/general.php

 

Find this at line ~199

	$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>';
  }
}

 

Change to:

	$products_query = tep_db_query("select p.products_id, p.products_model, 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_model'] . '] ' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';
  }
}

 

You can actually put almost any product information in the pulldown menu, eg stock quantity etc.

 

// Peter

 

EDIT: Note that this "hack" is going to show up in every pull down menu in admin

Link to comment
Share on other sites

  • 1 year later...

There is a way to use this pull down menu, that lists the products and prices and when whe select a product we can add to the cart, I've tried many contributions but can't get it working, please could some one help me on this matter.

 

Thanks :blush:

Edited by mribeiro
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...