Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multiple prices in product view list


claynomi

Recommended Posts

I could do this myself but I figure I'd save time and not reinvent the wheel if there's a already a quick fix for it:

 

Most of the products in my store have multiple options (size, flavor, etc). Only one option changes the price of the item (size), the other one is simply the customer preference (flavor). When I click on the product category and show a list of the products, I'd like the various priced items to show in the price field. I prefer to assign the product price to 0 then set the price of each option in the option. Here's what I'd like to see:

 

 

ITEM PRICE

Apple Sauce 7oz - $1.50

14oz - $3.00

 

Right now, under the price, it simply shows a 0.

 

Hope that's not too confusing.

Link to comment
Share on other sites

:blink:

I am also after how to do this instead of Having a 0.00 price when you have multilpe sizes

Would appreciate how to do this

Please help!!

Sarah

I could do this myself but I figure I'd save time and not reinvent the wheel if there's a already a quick fix for it:

 

Most of the products in my store have multiple options (size, flavor, etc). Only one option changes the price of the item (size), the other one is simply the customer preference (flavor). When I click on the product category and show a list of the products, I'd like the various priced items to show in the price field. I prefer to assign the product price to 0 then set the price of each option in the option. Here's what I'd like to see:

ITEM PRICE

Apple Sauce 7oz - $1.50

14oz - $3.00

 

Right now, under the price, it simply shows a 0.

 

Hope that's not too confusing.

Link to comment
Share on other sites

  • 1 month later...

Well, no one's responding here so I guess I have to reinvent (or invent) the wheel. Here's what I did:

In the file "product_listing.php" in the includes/modules directory, find the line that says "case 'PRODUCT_LIST_PRICE':" (on or near line 107) and delete the code between that line and the one that says "case 'PRODUCT_LIST_QUANTITY':" (leave those two lines there; though). Insert the following code between those lines to make it look like this:

 

case 'PRODUCT_LIST_PRICE':

 

//BEGIN INSERT CODE

 

$lc_align = 'right';

if ( $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) > 0 )

{

if (tep_not_null($listing['specials_new_products_price'])) {

$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

} else {

$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

}

}

else

{

$lc_text = '<table border="0" cellspacing="0" cellpadding="2">';

 

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$listing['products_id'] . "' and patrib.options_id = popt.products_options_id order by popt.products_options_name");

 

while ($products_options_name = tep_db_fetch_array($products_options_name_query))

{

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$listing['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id");

 

while ($products_options = tep_db_fetch_array($products_options_query))

{

if ($products_options['options_values_price'] != '0')

{

$lc_text.='<tr> <td class="main">'.$products_options['products_options_values_name'] . ': </td> <td class="main">'. $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .'</td> </tr>';

}

}

 

}

 

$lc_text.='</table>';

}

break;

 

//END INSERT CODE

 

case 'PRODUCT_LIST_QUANTITY':

Link to comment
Share on other sites

  • 5 months later...
  • 11 months later...

Hello friend, thank you very much for the post.. Well i also need something to update in the admin section so that i can have a same product with different prices.. is there anything we can do for that?? please reply, i am really in need of it..

 

Well, no one's responding here so I guess I have to reinvent (or invent) the wheel. Here's what I did:

In the file "product_listing.php" in the includes/modules directory, find the line that says "case 'PRODUCT_LIST_PRICE':" (on or near line 107) and delete the code between that line and the one that says "case 'PRODUCT_LIST_QUANTITY':" (leave those two lines there; though). Insert the following code between those lines to make it look like this:

 

case 'PRODUCT_LIST_PRICE':

 

//BEGIN INSERT CODE

 

$lc_align = 'right';

if ( $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) > 0 )

{

if (tep_not_null($listing['specials_new_products_price'])) {

$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

} else {

$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

}

}

else

{

$lc_text = '<table border="0" cellspacing="0" cellpadding="2">';

 

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$listing['products_id'] . "' and patrib.options_id = popt.products_options_id order by popt.products_options_name");

 

while ($products_options_name = tep_db_fetch_array($products_options_name_query))

{

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$listing['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id");

 

while ($products_options = tep_db_fetch_array($products_options_query))

{

if ($products_options['options_values_price'] != '0')

{

$lc_text.='<tr> <td class="main">'.$products_options['products_options_values_name'] . ': </td> <td class="main">'. $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .'</td> </tr>';

}

}

 

}

 

$lc_text.='</table>';

}

break;

 

//END INSERT CODE

 

case 'PRODUCT_LIST_QUANTITY':

Link to comment
Share on other sites

  • 11 months later...

First of all, thanks a MILLION to claynomi, for being so kind and posting the solution to his own problem, just to help others who might meet the same problem as well! I did! :)

 

I added your code and what it does is removing the price from the product LISTING. That's cool when that's what you need ;)

What about being able to present ALL 3 PRICES that have been set in the product attributes?

I want to make them appear both in the product listing AND the product description.

 

 

Any ideas anyone?! :)

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