Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying product attribute prices only


StirlingScott

Recommended Posts

Hi Folks,

 

im in the process of setting up a second oscommerce site, but for this site the specific goods i will be selling will have product attributes attached .

eg - i want to sell photographs, so what i want to do is display throughout the shop the image of the photo only without any prices and then when a customer clicks on the photo they go to that specific product and then get a product attribute drop down list with the different prices for different sizes of photos. I can do this bit, but it seems i have to set the price of the original product at ?0.00 to allow the correct total when you click on a size.

 

Is there a way to have a product displayed on all menu pages without prices and then when you click on, the customer can pick the correct size and price, without a price of 0.00 showing againt the original item.

 

i hope that makes sense

 

thanks

Link to comment
Share on other sites

I think I understand...

 

what I have done on my store is to put the price of the cheapest item as the product price. Then, via PHP if a product has attributes, to show "price from:" instead of just "price:".

 

Does this help?

Link to comment
Share on other sites

I think I understand...

 

what I have done on my store is to put the price of the cheapest item as the product price. Then, via PHP if a product has attributes, to show "price from:" instead of just "price:".

 

Does this help?

 

thanks for your reply, i have already added products as you stated - eg lowest price first - how and where do i do the second part of your solution - eg change to' Price from '

 

thanks

Link to comment
Share on other sites

thanks for your reply, i have already added products as you stated - eg lowest price first - how and where do i do the second part of your solution - eg change to' Price from '

 

thanks

 

I'll give you the exact code as I have it:

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, pd.products_spec, pd.products_musthave, pd.products_extraimage, pd.products_manual, pd.products_extra1, pd.products_moreinfo, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
				$product_info = tep_db_fetch_array($product_info_query);

				tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

				$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
				$products_attributes = tep_db_fetch_array($products_attributes_query);
				if ($products_attributes['total'] > 0) {

					if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
					  $products_price = '<span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span> (was ' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')';
					} else {
					  $products_price = '<em>From</em> ' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
					}

				} else {

				if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
					  $products_price = '<span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span> (was ' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')';
					} else {
					  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
					}

				}

 

try it and see. basically, its saying that if the product has an attribute then show "from ?20" (for example), else show "?20". This is the code for the product_info.php page.

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...
Can you tell me where exactly to put this piece of code? or do I replace the whole code in product_info.php?

 

Does this allow the use of an attribute pricing scheme, or does it add the attribute price to the base, lowest one?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...