Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

attributes prices from


dee19802000

Recommended Posts

Posted

Hey I wonder if anybody could point me in the right direction, I have qt pro installed and it works grand but i want to be able to change the standard price to the lowest attributes price by saying something like 'prices tarting from:' and then display the lowest price instead of the standard price. Any ideas on how I can go about this?

 

Dee

Posted

this is what i have so far:

 

<?php

$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);

 

$products_attributes_price = tep_db_query("select patrib.products_id, patrib.price_prefix, MIN(patrib.options_values_price) from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and popt.language_id = '" . (int)$languages_id . "' GROUP BY patrib.products_id");

$products_pp = tep_db_fetch_array($products_attributes_price);

 

if ($products_attributes['total'] > 0) {

$products_priceatti = $products_pp['MIN(patrib.options_values_price)'];

$products_price = $product_info['products_price'];

$sumItems = $products_price - $products_priceatti;

$totalItems = $currencies->display_price($sumItems, tep_get_tax_rate($product_info['products_tax_class_id']));

 

echo 'Price From: ' . $totalItems;

}else{

echo 'Price: ' . $products_price;

}

?>

 

$products_priceatti is giving the lowest value in the attributes list as 0.00000 but in reality it is 0.60 any ideas on what i need to do?

 

Dee

Archived

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

×
×
  • Create New...