Jump to content
Sign in to follow this  
claynomi

Multiple prices in product view list

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.

Share this post


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

Share this post


Link to post
Share on other sites

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':

Share this post


Link to post
Share on other sites

Thank you for this!

I'm totally new with this, so I wanted to ask you one thing. When your code has been added, where can you set the price options? Would that be in admin- new product?

 

Thanks in advance :blush:

Share this post


Link to post
Share on other sites

Hello,

 

any news for this?

 

I need also to modify my store in order to have 3 prices for a product? :huh:

 

How can this be done?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

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':

Share this post


Link to post
Share on other sites

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?! :)

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  

×