Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
petsk

Featured products, show model in pull down menu

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Thank you very much Steve! The general-file really did the trick :D

 

I am trying to get the model numbers to appear in the drop down too.

 

Can you possibly help me out with exactly what has to go where?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

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
Sign in to follow this  

×