Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Turning product info pages off?

Turning product info pages off?

Locked

Views: 803

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
25 Mar 2010, 5:49 AM
#1
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Turning product info pages off?

A friend of mine is considering ZC for his online ordering system. He does not need/want the detailed product info pages for some of his categories, ie no links to the details but just the index listing with a qty box for the categories in question including the usual "add selected products to cart" button.

How can this be achieved?

Sorry, no link to the site available, store being developed locally.

Thanks / Frank

25 Mar 2010, 5:04 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Turning product info pages off?

ould require custom coding if/else for those categories

26 Mar 2010, 12:03 AM
#3
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Turning product info pages off?

kobra:

ould require custom coding if/else for those categories

Thanks kobra, I thought so...

Which files would be affected to process the relevant index listings?

26 Mar 2010, 2:45 AM
#4
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Turning product info pages off?

I believe the file to be modified with if/else is

/includes/modules/product_listing.php

would I be on the right track?

26 Mar 2010, 3:27 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Turning product info pages off?

Correct, and you should copy it to /includes/modules/your_template/product_listing.php before editing so the changes stay safe.

26 Mar 2010, 4:27 AM
#6
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Turning product info pages off?

gjh42:

Correct, and you should copy it to /includes/modules/your_template/product_listing.php before editing so the changes stay safe.
Thanks Glenn - I will have a play with this on my local machine over the weekend

Frank

28 Mar 2010, 7:20 AM
#7
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Turning product info pages off?

My solution:

Backup, Backup, Backup ...

Copy file includes/modules/product_listing.php to includes/modules/YOUR_TEMPLATE/product_listing.php

Caution: many templates may already use a template specific file product_listing.php !! So, create another backup of this file..

Open the copied file and create variable for categories to disable link to product details

$disable_productlinks_cPath = "61,64,65,66,68,68,78,93";

change this

case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3> (... rest of code omitted....);

to this

case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (in_array($cPath,explode(',', $disable_productlinks_cPath)) ) {
$lc_text = '<h3 class="itemTitle">' . $listing->fields['products_name'] . '</h3> (.... rest of code omitted ....);

Then to control the images and their links (if images are not already turned off globally in admin)

change this

if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
$lc_text = '';
} else {
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';

to this

if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
$lc_text = '';
} else {
if (in_array($cPath,explode(',', $disable_productlinks_cPath)) ) {
$lc_text = '';

Need to work on disabling the column header 'Product Image' for categories affected.

It goes without saying that individual product detail pages still need to be created albeit with a much shorter description

Frank

30 Mar 2010, 7:03 AM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Turning product info pages off?

Need to work on disabling the column header 'Product Image' for categories affected.

There has been discussion of doing this kind of thing a couple of years back. It was specifically for including one element under another element's heading (and eliminating the cell for the first one). A key element is tricking the loop into believing it has done enough iterations to fill the correct number of cells.

30 Mar 2010, 11:38 AM
#9
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Turning product info pages off?

Yeah, Glenn, that sounds like the real deal.

Anyway, did this little exercise for my mate and he is quite happy with the result. He is considering to show some images on the index pages but without the link to detail - easy fixed with a little tweak.

Thanks again to all for the hints and tips, might help someone to achieve something similar in the future.

Frank