Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Remove "Price" Hyperlink in product listing

Remove "Price" Hyperlink in product listing

Views: 525

Results 1 to 8 of 8
8 Nov 2011, 3:19 PM
#1
sethf avatar

sethf

Zen Follower

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

Remove "Price" Hyperlink in product listing

Hi

I have established that Alpha Product Filter clashes with the headings on top of the product listing page, namely "Item name" and "Price"(To see what I mean, go here: pcselect.co.za/index.php?main_page=index&cPath=176_179&sort=20a&filter_id=&alpha_filter_id=2 )

..so what I want to do is remove the hyperlink to "Price" and "Item name" so that my customers can just use the Alpha Product Filter. (I don't want to remove the actual headings, just the hyperlinks.)

Thanks for your help! :smile:
S

8 Nov 2011, 3:35 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove "Price" Hyperlink in product listing

In the Configuration ... Product Listing ... you can set to 0, for OFF, the setting on:

Display Product Price/Add to Cart
Do you want to display the Product Price/Add to Cart

8 Nov 2011, 3:49 PM
#3
sethf avatar

sethf

Zen Follower

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

Re: Remove "Price" Hyperlink in product listing

Ajeh:

In the Configuration ... Product Listing ... you can set to 0, for OFF, the setting on:

Thanks, but perhaps you didn't understand my question.

I don't want to remove the Price column... I simple want to remove the hyperlink on the Price heading, so that is does not allow a user to click it to arrange the price in ascending or descending order.

I still want the heading there - I just don't want to ability to be able to click this heading, ie, I don't want it hyperlinked.

Is there any other info you need?

Thanks for your help :smile:
S

8 Nov 2011, 4:00 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove "Price" Hyperlink in product listing

Edit the file:
/includes/modules/product_listing.php

and change the line:

  if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {

to read:

  if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') && ($column_list[$col] != 'PRODUCT_LIST_PRICE') ) {
8 Nov 2011, 4:09 PM
#5
sethf avatar

sethf

Zen Follower

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

Re: Remove "Price" Hyperlink in product listing

Ajeh:

Edit the file:
/includes/modules/product_listing.php

and change the line:

if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {

> 
> to read:
> ```
  if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') && ($column_list[$col] != 'PRODUCT_LIST_PRICE') ) {

That works perfectly, thanks you! :smile:

One last thing, how can I achieve the same outcome with "Item name" (which is right next to "Price" on the the left).

Thanks again for your help.
S

8 Nov 2011, 4:14 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove "Price" Hyperlink in product listing

If you look at the code change to turn off the link on the Price, you will see it is checking for what the column title is and if it is one of the two titles, it does not add the link ...

So, if you want another one to not build the link, then you need to find the constant that is used for it and add it to the IF in the same manner so that it is not turned into a link ...

NOTE: you should be using your templates and overrides on this file for your changes ...

8 Nov 2011, 6:16 PM
#7
sethf avatar

sethf

Zen Follower

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

Re: Remove "Price" Hyperlink in product listing

Ajeh:

If you look at the code change to turn off the link on the Price, you will see it is checking for what the column title is and if it is one of the two titles, it does not add the link ...

So, if you want another one to not build the link, then you need to find the constant that is used for it and add it to the IF in the same manner so that it is not turned into a link ...

NOTE: you should be using your templates and overrides on this file for your changes ...

Thanks! :smile:

This worked great:

  if ( ($column_list[$col] != 'PRODUCT_LIST_IMAGE') && ($column_list[$col] != 'PRODUCT_LIST_PRICE') && ($column_list[$col] != 'PRODUCT_LIST_NAME') ) {

Thanks again for your help.
S

8 Nov 2011, 11:15 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Remove "Price" Hyperlink in product listing

Good job ... you are most welcome ... and thanks for posting the solution that worked for you ... :smile: