Forums / Templates, Stylesheets, Page Layout / remove price on product listing & New Products

remove price on product listing & New Products

Started by itseemedsosimple on 20 Sep 2009, 10:35 PM · Views: 5,677

Results 1 to 12 of 12
20 Sep 2009, 10:35 PM
#1
itseemedsosimple avatar

itseemedsosimple

New Zenner

Join Date:
Aug 2009
Location:
St. Louis, MO
Posts:
69
Plugin Contributions:
0

remove price on product listing & New Products

Have included the price in the Product Name (cause I like the way it looks).

Would like to exclude the price from the "New Products For Month" listing on the main page (Home)
http://myseedsofhappiness.com/store/
Configuration/New Listing/Display Product Price is set to "0" but does not seem to change anything that I can see?

And would like to hide the price under the Price column, but keep the Add to Cart button, on the category pages
http://myseedsofhappiness.com/store/index.php?main_page=index&cPath=7

Suggestions?

20 Sep 2009, 10:58 PM
#2
itseemedsosimple avatar

itseemedsosimple

New Zenner

Join Date:
Aug 2009
Location:
St. Louis, MO
Posts:
69
Plugin Contributions:
0

Re: remove price on product listing & New Products

itseemedsosimple:

Have included the price in the Product Name (cause I like the way it looks).

Would like to exclude the price from the "New Products For Month" listing on the main page (Home)
http://myseedsofhappiness.com/store/
Configuration/New Listing/Display Product Price is set to "0" but does not seem to change anything that I can see?

And would like to hide the price under the Price column, but keep the Add to Cart button, on the category pages
http://myseedsofhappiness.com/store/index.php?main_page=index&cPath=7

Suggestions?

Found the answer to the second question at
http://www.zen-cart.com/forum/showthread.php?t=109078 on about the eighth page of the response to my query - sorry.

But still have not found a solution to the first desire.

21 Sep 2009, 3:47 AM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: remove price on product listing & New Products

There is no identifier to use styling on for the price, so you will have to edit a PHP file to remove the price.
In /includes/modules/your_template/new_products.php around line 70, replace
'</a><br />' . $products_price
with
'</a>'
inphp $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"', 'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price); to get```php
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a>');

21 Sep 2009, 4:24 PM
#4
itseemedsosimple avatar

itseemedsosimple

New Zenner

Join Date:
Aug 2009
Location:
St. Louis, MO
Posts:
69
Plugin Contributions:
0

Re: remove price on product listing & New Products

Thanks, tg

29 Mar 2011, 9:06 AM
#5
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: remove price on product listing & New Products

Thanx! It works great!

http://www.dodeca.eu/
Zen Cart is simply Jamming

1 Oct 2011, 12:06 PM
#6
blackriver avatar

blackriver

New Zenner

Join Date:
Mar 2011
Posts:
18
Plugin Contributions:
0

Re: remove price on product listing & New Products

This worked great for me too! Thanks for the help:clap:

9 Oct 2011, 6:01 AM
#7
bladecris avatar

bladecris

New Zenner

Join Date:
Sep 2011
Posts:
40
Plugin Contributions:
0

Re: remove price on product listing & New Products

Where can i change the name of the "Price"? Because I want to translate it and i dunno where from.

Thank you.

9 Oct 2011, 6:21 AM
#8
bladecris avatar

bladecris

New Zenner

Join Date:
Sep 2011
Posts:
40
Plugin Contributions:
0

Re: remove price on product listing & New Products

Never mind, found it. It's in zencart/includes/modules/product_listing.php at this section case 'PRODUCT_LIST_PRICE':
$lc_text = 'Price';

9 Oct 2011, 8:54 AM
#9
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: remove price on product listing & New Products

bladecris:

Never mind, found it. It's in zencart/includes/modules/product_listing.php at this section case 'PRODUCT_LIST_PRICE':
$lc_text = 'Price';

:shocking:

That is not something in STANDARD, CORE zencart.

Looks like you have a commercial module installed, where the developer has FORCED the define text into the MODULE FILE.

That section should read:
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;

... and the relative text for TABLE_HEADING_PRICE is located in a LANGUAGE FILE as a DEFINE STATEMENT.

Module files are very "sensitive". Generally there is no need for a "novice" to edit them.

This demonstrates the types of risks associated with many commerical templates, where the creator blithely (or deliberately) by-passes protocol.

20 years a Zencart User

11 Oct 2011, 9:52 PM
#10
bladecris avatar

bladecris

New Zenner

Join Date:
Sep 2011
Posts:
40
Plugin Contributions:
0

Re: remove price on product listing & New Products

I downloaded it from zen-cart.com latest version 1.3.9h full fileset

11 Oct 2011, 10:40 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: remove price on product listing & New Products

bladecris:

I downloaded it from zen-cart.com latest version 1.3.9h full fileset

Clearly the file has been altered, either by you or by an addon, since the original v1.3.9h version of that file contains a constant, exactly as schoolboy quoted, and not the literal string of 'Price' as you quoted.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 Oct 2011, 12:43 AM
#12
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: remove price on product listing & New Products

I just checked that file on a couple of my installs and it appears exactly as Schoolboy noted it should.

The best way to learn is to try stuff. But, back it up first.