PDA

View Full Version : No pricing or buy buttons



disciple
09-08-2003, 01:36 PM
Hi,

I am trying to modify osc to use it as a catalog only. The customer does not want anyone to purchase from the website but only be able to print out a catalog.

I have been trying to modify the product_listing_col.php file. I am able to get rid of the buy me now button and the price but now instead of the product name, price and buy me now button I have 3 linkable product names. I can't seem to figure out how to get around this.

Here is what the original photo looks like:

http://www.discipleshipresourcecenter.com/junk/original.jpg

Here it is with the changes I made to the file.
http://www.discipleshipresourcecenter.com/junk/after_changes.jpg

I know next to nothing about php so that is part of my problem I am sure.

Here is what I have done to the original code. Basically I just took out alot of code.


<?php
/*
$Id: product_listing.php,v 1.44 2003/06/09 22:49:43 hpdl Exp $
*/

$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}

$list_box_contents = array();

if ($listing_split->number_of_rows > 0) {
$listing_query = tep_db_query($listing_split->sql_query);

$row = 0;
$column = 0;
while ($listing = tep_db_fetch_array($listing_query)) {

$product_contents = array();

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';

switch ($column_list[$col]) {
case 'PRODUCT_LIST_NAME':
$lc_align = '';
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';
break;

case 'PRODUCT_LIST_IMAGE':
$lc_align = 'center';
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';


}
$product_contents[] = $lc_text;

}
$lc_text = implode('<br>', $product_contents);
$list_box_contents[$row][$column] = array('align' => 'center',
'params' => 'class="productListing-data"',
'text' => $lc_text);
$column ++;
if ($column >= 3) {
$row ++;
$column = 0;
}
}

new productListingBox($list_box_contents);
} else {
$list_box_contents = array();

$list_box_contents[0] = array('params' => 'class="productListing-odd"');
$list_box_contents[0][] = array('params' => 'class="productListing-data"',
'text' => TEXT_NO_PRODUCTS);

new productListingBox($list_box_contents);
}

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
</tr>
</table>
<?php
}
?>


Any help would be greatly appreciated.

Thanks

Rick

michael_s
09-08-2003, 08:59 PM
How about just turning them off in the admin... There is an option for this, ya know. :)

Configuration :arrow: Product Listing

You could also install the 'Printable Catalog' mod.

disciple
10-03-2003, 01:54 PM
OK, Maybe I am somewhat dense. I have the price turned off in the configuration and it works on all pages EXCEPT the index page. It still shows as I have indicated above.

I have upgraded to 1.5 with no problems. The Printable Catalog works great but doesn't solve my problem.

Am I missing something?

Thanks

P.S. I did a fresh install of 1.5 max and still have the price showing as I indicated above. Any help would be appreciated.

michael_s
10-03-2003, 02:17 PM
That is because the products are controlled by the boxes that display them on the index page. So, you will have to manually edit the actual boxes to change the display. Also, MS2-MAX uses product_listing_col.php for the product listings.

To edit the specials, you need to edit default_specials.php, and to edit the new items box, the file new_products.php, both in the includes/modules directory...

In new_products.php, look for and remove this code:

. $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class _id']))

I have not looked in default_specials, but I am sure it is similar...

disciple
10-04-2003, 08:02 AM
That was the answer. I was just looking in the wrong files. Thanks for the help.

Thanks also for your work in providing this product to us. Your efforts are greatly appreciated.

Rick

In-Overtime
11-05-2003, 09:13 PM
I tried the same thing (switching off "display prices") in Admin, as all my products were 0.00 to begin with. DIdn't work!

To Kill the prices displaying (all except the shopping cart), you can also modify catalog/includes/classes/currencies.php around line 77

FIND:

function display_price($products_price, $products_tax, $quantity = 1) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);

CHANGE TO:

function display_price($products_price, $products_tax, $quantity = 1) {
return '';