PDA

View Full Version : [Core Hack] Product List Changes to include MSRP and other fields



BrianM
03-28-2012, 08:14 AM
All:

I have been using osCommerce and other type products for a while now but am now starting to get into customizing the sites I support at the code level.

Right now I would like to change the way the product listing works. I need to have it look like this...


Qnt Avail. Product Name MSRP Price Savings Buy Now
{2} {product name} {$#.##} {$#.##} {%##} [Buy Now]
{product brief description}

As a side question, where do I enter the brief description?

I would also like to remove the hyperlink that take the user from the product listing to product details (this I was able to do with the following change, but not sure if this is the best way).

From this


$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '"><b>' . $listing[$x]['products_name'] . '</b>' . $short /*begin epf*/ . $extra /*end epf*/ . '</a>';
} else {
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '"><b>' . $listing[$x]['products_name'] . '</b>' . $short /*begin epf*/ . $extra /*end epf*/ . '</a>&nbsp;';
}


To this


$lc_align = '';
$lc_text = '<b>' . $listing[$x]['products_name'] . '</b>&nbsp;';

pgmarshall
03-28-2012, 10:32 AM
What do you mean by "product listing" ... in the main listing pages? Or on the product_info page.

It might help to post a screenshot of what you want to achieve.

Regards.

BrianM
03-28-2012, 06:09 PM
Sorry for the incomplete question.

Let me see if I can break this down to just one question.

On the catelog/includes/modules/product_listing.php page, how can I get the query to pull the MSRP values so that they may be shown in the list?

Original output ("." = space)


Quantity.......Item Name.............................................. ........Price................Buy It Now
...[#].........[Some text].................................................. ..[$00.00]..........[Buy It Now Button]


What I want is ("." = space)


Quantity.......Item Name.........................MSRP..........Price.. .......Savings...........Buy It Now
...[#].........[Some text].....................[$00.00].......[$00.00]........[##%]..........[Buy It Now Button]
...............[Brief description]


Thank you for the reply.

pgmarshall
03-29-2012, 11:31 AM
The easiest way to add this would be to add the fields you require to the priceformatter class.

Then they will be available through out the store.

Regards.

BrianM
03-29-2012, 06:33 PM
The easiest way to add this would be to add the fields you require to the priceformatter class.


I am sorry but I don't understand what "priceformatter class" is.

Does this mean I need to add new fields to my product list?

I thought that since this information is already displayed via the product_info.php page when an item is selected from the product_listing.php page that ist would be something as simple as adding the corrrect SQL statement.

EDIT:

I have been some more research and what I have found is that when I turn on the debug option to the product_listing.php page I get the following:

[products_id] => 12329
[products_model] => #######
[products_name] => Item Name Here
[manufacturers_name] => Some Company
[products_quantity] => 2
[products_image] =>
[products_weight] => 0.000
[products_ordered] => 0
[products_short] => Brief note
[manufacturers_id] => ######
[products_msrp] => 200.0000
[products_price] => 80.0000
[products_tax_class_id] => 1
[products_featured] => 0
[specials_new_products_price] =>
[final_price] => 80.0000
[discount_categories_id] =>


Both the MSRP and the brief description are already in the SQL results (as shown above). The question is, how do I get it to show in the listing? Normally I would select the options and order I wanted from the admin screen but these 2 options are not available as choices.

Thoughts?

pgmarshall
03-30-2012, 10:30 AM
Just


echo $currencies->display_price($listing[$x]['products_msrp'], tep_get_tax_rate($listing[$x]['products_id']));

where ever you want it to come out.

Regards.