Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Replace $0.00 price with Contact for Shipping Quote Only


Recommended Posts

I have been piling on the hacks for 2 sites I am developing. I would think a lot of the hacks should be part of the initial program but they are not. I am having fun learning how to do all this anyway. I have run into a bit of an issue. We have a wholesale site and a retail site. Both of which will need to have the same outcome when it comes to requesting a shipping quote before checking out. I tried the hack for shipping request RFQ_v1_3 but is it not quite what I am looking for. The Hide price if $0.00 "category_use_shopping_cart_1" is more like it but my custromers still need to be able to check out after the shipping quote is given.

 

In the hide price if $0.00 directions it states:

 

some people wanted to hide the price but not the buttons for spicific reasons, this can be achived by simply omitting the second edit in most of the steps.

 

I am new to all this php code and do not understand what needs to be omitted.

 

All my products for the wholesale site have a $0.00 price. We have so many different configurations for each style and size of aquarium cabinet be build that, setting up the cart was easier to set up all the base purchase options as product attributes.

 

I would like to place a button for "Request Shipping Quote" on all products with a $0.00 price. In the Hide Price if $0.00 instructions, I am not sure what code to leave out of the hack to accomplish this. Can someone please help?

 

Here are the hack instructions:

 

Step 1.

-------

 

catalog/product_info.php

 

Around line 93 replace the following line:

 

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

with:

 

<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->

<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) ;

echo (($product_info['products_price'] > 0 && $product_info['use_shopping_cart'] == 'true') ? tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) : '');

?>

<!-- End "Hide Price if $0" edit 1 of 2 -->

 

 

and around line 72 replace the following line:

 

$product_info_query = tep_db_query("select c.use_shopping_cart, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id

from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c , " .

"where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

with:

$product_info_query = tep_db_query("select c.use_shopping_cart, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id

from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c , " . TABLE_PRODUCTS_TO_CATEGORIES . " pc " .

"where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and p.products_id = pc.products_id and pc.categories_id = c.categories_id AND pd.language_id = '" . (int)$languages_id . "'");

 

 

and around line 216 replace the following line:

 

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

with:

<!--<td class="main" align="right"><?php //echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> -->

<!-- Start "Hide Price if $0" edit 2 of 2 (uncomment above line if removing this contribution) -->

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) ;

echo (($product_info['products_price'] > 0 && $product_info['use_shopping_cart'] == 'true') ? tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) :

'<a href="' . tep_href_link(FILENAME_CONTACT_US, tep_get_all_get_params()) . '">' . tep_image_button('button_contact.gif', IMAGE_BUTTON_CONTACT) . '</a>');

?>

</td>

<!-- End "Hide Price if $0" edit 2 of 2 -->

 

Step 1a.

-------

Em catalog/includes/languages/<your language>.php

-------------------------------------------------

 

Add (adicione)

 

///////

// Hide price when $0

define('TEXT_CALL_FOR_PRICE', 'Call for price');

define('IMAGE_BUTTON_CONTACT', 'Contact us');

 

Em catalog/includes/languages/<your language>/images/buttons

------------------------------------------------------------

 

create and save an image file named: "button_contact.gif".

(crie uma imagem de bot?o com o nome: "button_contact.gif".

 

 

 

Step 1b.

-------

include on the table "configuration", using phpMyAdmin or whatever method you prefer

(inclua na tabela "configuration", usando o PHPMyAdmin ou qualquer m?todo que preferir)

 

SQL:

ALTER TABLE `categories` ADD `use_shopping_cart` VARCHAR( 5 ) DEFAULT 'true' NOT NULL AFTER `sort_order` ;

 

Step 1c.

-------

catalog/includes/languages/<your language>/categories.php

*********************************************************

locate, at around line 41: (aproximadamente na linha 41)

 

$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);

 

$sql_data_array = array('sort_order' => $sort_order);

 

and REPLACE for: (substitua por:)

 

$sort_order = tep_db_prepare_input($HTTP_POST_VARS['sort_order']);

$use_shopping_cart = (tep_db_prepare_input($HTTP_POST_VARS['shopping_cart'])?'true':'false');

 

$sql_data_array = array('sort_order' => $sort_order,

'use_shopping_cart' => $use_shopping_cart);

 

 

*********************************************************

locate, at around line 810: (aproximadamente na linha 810)

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");

 

and replace with:

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.use_shopping_cart, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");

 

(adicionado "c.use_shopping_cart," ap?s "c.sort_order,"

 

**************************************

locate, at around line 921: (aproximadamente na linha 921)

 

$contents[] = array('text' => '<br>' . TEXT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', '', 'size="2"'));

 

and place, right after: (coloque logo abaixo)

 

$contents[] = array('text' => '<br>' . tep_draw_checkbox_field('shopping_cart','' , true) . ' ' . TEXT_USE_SHOPPING_CART );

 

******************************

locate, at around line 940:

$contents[] = array('text' => '<br>' . TEXT_EDIT_SORT_ORDER . '<br>' . tep_draw_input_field('sort_order', $cInfo->sort_order, 'size="2"'));

 

and place, right after:

$contents[] = array('text' => '<br>' . tep_draw_checkbox_field('shopping_cart','' , $cInfo->use_shopping_cart=="true") . ' ' . TEXT_EDIT_USE_SHOPPING_CART );

 

-------------------------------------------------------------------------

 

Step 2.

-------

 

In catalog/product_new.php

--------------------------

 

around line 56 replace the following line: (substitua a linha:)

 

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

 

with: (por)

//$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

$products_new_query_raw = "select c.use_shopping_cart, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name" .

" from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c , " . TABLE_PRODUCTS_TO_CATEGORIES . " pc " .

" where p.products_status = '1' and p.products_id = pc.products_id and pc.categories_id = c.categories_id AND p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' " .

" order by p.products_date_added DESC, pd.products_name";

 

 

around line 84 replace the following line: (substitua a linha:)

 

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

 

with:

//$products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));

// Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution)

$products_price = (($products_new['products_price'] > 0) ? $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) : '');

// End "Hide Price if $0" edit 1 of 2

 

 

and around line 93 replace the following line: (substitua a linha:)

 

<td align="right" valign="middle" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>

 

with:

<!--<td align="right" valign="middle" class="main"><?php //echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>'; ?></td>-->

<!-- Start "Hide Price if $0" edit 2 of 2 (uncomment above line if removing this contribution) -->

<td align="right" valign="middle" class="main"><?php echo (($products_new['products_price'] > 0 && $products_new['use_shopping_cart'] == 'true') ? '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART):

'<a href="' . tep_href_link(FILENAME_CONTACT_US, tep_get_all_get_params()) . '">' . tep_image_button('button_contact.gif', IMAGE_BUTTON_CONTACT)) . '</a>'; ?></td>

<!-- End "Hide Price if $0" edit 2 of 2 -->

 

-------------------------------------------------------------------------

 

Step 3.

-------

 

catalog/product_reviews.php

 

Around line 15 replace the following line: (substitua a linha:)

 

$product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

with:

 

$product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name, c.use_shopping_cart " .

"from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c , " . TABLE_PRODUCTS_TO_CATEGORIES . " pc " .

"where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and p.products_id = pc.products_id and pc.categories_id = c.categories_id AND pd.language_id = '" . (int)$languages_id . "'");

 

 

Around line 70 replace the following line: (substitua a linha:)

 

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

with:

 

<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->

<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->

<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : TEXT_CALL_FOR_PRICE ); ?></td>

<!-- End "Hide Price if $0" edit 1 of 2 -->

 

 

and around line 190 replace the following line: (substitua a linha:)

 

echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';

 

with:

 

// Start "Hide Price if $0" edit 2 of 2 (uncomment above line if removing this contribution)

//echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';

echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . (($review['products_price'] > 0 && $review['use_shopping_cart'] == 'true') ? tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) :

'<a href="' . tep_href_link(FILENAME_CONTACT_US, tep_get_all_get_params()) . '">' . tep_image_button('button_contact.gif', IMAGE_BUTTON_CONTACT)) . '</a></p>';

// End "Hide Price if $0" edit 2 of 2

 

-------------------------------------------------------------------------

Step 4.

-------

 

catalog/product_reviews_info.php

 

Around line 28 replace the following line: (substitua a linha:)

 

$review_query = tep_db_query("select rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, r.date_added, r.reviews_read, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where r.reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.products_id = p.products_id and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '". (int)$languages_id . "'");

 

with:

 

$review_query = tep_db_query("select rd.reviews_text, r.reviews_rating, r.reviews_id, r.customers_name, r.date_added, r.reviews_read, p.products_id, p.products_price, p.products_tax_class_id, p.products_image, p.products_model, pd.products_name, c.use_shopping_cart" .

" from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c , " . TABLE_PRODUCTS_TO_CATEGORIES . " pc " .

" where r.reviews_id = '" . (int)$HTTP_GET_VARS['reviews_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.products_id = p.products_id and p.products_status = '1' and p.products_id = pd.products_id and p.products_id = pc.products_id and pc.categories_id = c.categories_id AND pd.language_id = '". (int)$languages_id . "'");

 

Around line 79 replace the following line:

 

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

with:

 

<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->

<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->

<td class="pageHeading" align="right" valign="top"><?php echo (($review['products_price'] > 0) ? $products_price : TEXT_CALL_FOR_PRICE); ?></td>

<!-- End "Hide Price if $0" edit 1 of 2 -->

 

 

and around line 147 replace the following line:

 

echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';

 

with:

 

// Start "Hide Price if $0" edit 2 of 2 (uncomment above line if removing this contribution)

//echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';

echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . (($review['products_price'] > 0 && $review['use_shopping_cart'] == 'true') ? tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) :

'<a href="' . tep_href_link(FILENAME_CONTACT_US, tep_get_all_get_params()) . '">' . tep_image_button('button_contact.gif', IMAGE_BUTTON_CONTACT)) . '</a></p>';

// End "Hide Price if $0" edit 2 of 2

 

-------------------------------------------------------------------------

 

Step 5.

-------

 

catalog/product_reviews_write.php

 

 

Around line 20 replace the following line: (substitua a linha:)

 

$product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

with:

 

$product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name, c.use_shopping_cart" .

" from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc " .

" where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and p.products_id = pc.products_id and pc.categories_id = c.categories_id AND pd.language_id = '" . (int)$languages_id . "'");

 

 

Around line 130 replace the following line: (substitua a linha:)

 

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

with:

 

<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->

<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->

<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : TEXT_CALL_FOR_PRICE); ?></td>

<!-- End "Hide Price if $0" edit 1 of 2 -->

 

 

and around line 209 replace the following line: (substitua a linha:)

 

echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';

 

with:

 

// Start "Hide Price if $0" edit 2 of 2 (uncomment above line if removing this contribution)

//echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';

echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . (($review['products_price'] > 0 && $review['use_shopping_cart'] == 'true') ? tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) :

'<a href="' . tep_href_link(FILENAME_CONTACT_US, tep_get_all_get_params()) . '">' . tep_image_button('button_contact.gif', IMAGE_BUTTON_CONTACT)) . '</a></p>';

// End "Hide Price if $0" edit 2 of 2

 

-------------------------------------------------------------------------

 

Step 6.

-------

 

catalog/includes/boxes/whats_new.php

 

around line 31 replace the following line: (substitua a linha:)

 

if ($random_product = tep_random_select("select products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {

 

with:

 

if ($random_product = tep_random_select("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, c.use_shopping_cart " .

" from " . TABLE_PRODUCTS . " p, " . TABLE_CATEGORIES . " c , " . TABLE_PRODUCTS_TO_CATEGORIES . " pc " .

" where p.products_status = '1' AND p.products_id = pc.products_id and pc.categories_id = c.categories_id order by p.products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) {

 

around line 31 replace the following line: (substitua a linha:)

 

$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));

 

with:

 

//$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));

// Start "Hide Price if $0" edit 1 of 1 (uncomment above line if removing this contribution)

$whats_new_price = (($random_product['products_price'] > 0) ? $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) : '');

// End "Hide Price if $0" edit 1 of 1

 

 

-------------------------------------------------------------------------

 

Step 7. (If also using Random New Products Contribution use Alternate Step 7 instead.) (caso esteja usando a contribui??o "Random New Products", use o passo 7 alternativo abaixo)

-------

 

catalog/includes/modules/new_products.php

 

around line 33 replace the following line:

 

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

with:

 

//'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

// Start "Hide Price if $0" edit 1 of 1 (uncomment above line if removing this contribution)

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . (($new_products['products_price'] > 0) ? $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) : ''));

// End "Hide Price if $0" edit 1 of 1

 

 

-------------------------------------------------------------------------

 

Added by Steel Shadow:

Use THIS alternate code ONLY if you are also using Random New Products Contribution

(use este c?digo alternativo somente se vc tiver instalado a contribui??o "Random New Products")

 

Alternate Step 7.

-------

 

catalog/includes/modules/new_products.php

 

around line 33 replace the following line:

 

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])));

with:

 

//'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])));

// Start "Hide Price if $0" edit 1 of 1 (uncomment above line if removing this contribution)

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . $random_product['products_name'] . '</a><br>' . (($random_product['products_price'] > 0) ? $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) : ''));

// End "Hide Price if $0" edit 1 of 1

 

 

-------------------------------------------------------------------------

 

Step 8.

-------

 

catalog/includes/modules/product_listing.php

 

around line 112 replace the following line:

 

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

 

with:

 

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

// Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution)

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

// End "Hide Price if $0" edit 1 of 2

 

 

and around line 136 replace the following line:

 

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

 

with:

 

//$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

// Start "Hide Price if $0" edit 2 of 2 (uncomment above line if removing this contribution)

$lc_text = (($listing['products_price'] > 0 && $listing['use_shopping_cart'] == 'true') ? '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ' :

'<a href="' . tep_href_link(FILENAME_CONTACT_US, tep_get_all_get_params()) . '">' . tep_image_button('button_contact.gif', IMAGE_BUTTON_CONTACT) . '</a>');

// End "Hide Price if $0" edit 2 of 2

 

 

Step 8a.

-------

 

catalog/index.php

 

At around line 175, look for

*******************************

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only a specific category

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

} else {

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

}

} else {

// show the products in a given categorie

if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only specific catgeory

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

} else {

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

}

*******************************

 

and REPLACE with:

 

/////

// queries changed to include "call for price"button. (Claudio) BEGIN

////

if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only a specific category

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, c.use_shopping_cart, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price " .

"from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c " .

"where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

} else {

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, c.use_shopping_cart, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price " .

"from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c " .

"where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

}

} else {

// show the products in a given categorie

if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

// We are asked to show only specific catgeory

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, c.use_shopping_cart, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price " .

"from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c " .

"where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

} else {

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, c.use_shopping_cart, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price " .

"from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c " .

"where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

}

/////

// queries changed to include "call for price"button. (Claudio) END

////

 

Step 8b.

-------

 

catalog/advanced_search_result.php

 

At around line 207, look for

 

$select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";

 

and replace with:

 

$select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, c.use_shopping_cart, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";

 

At around line 223, look for

 

$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 

and replace with:

 

$where_str = " where p.products_status = '1' and p.products_id = pd.products_id and p2c.categories_id = c.categories_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 

#########################################################################

 

thanks much in advance!!! :D

 

Dolly

 

May be of use to someone other than me too!!

 

All work is greatly appreciated!!!!!!!!!!

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