Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Disable drill down to single product

Disable drill down to single product

Locked

Views: 2,984

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
4 Jun 2007, 4:21 PM
#1
rottiejoe avatar

rottiejoe

New Zenner

Join Date:
Mar 2007
Posts:
86
Plugin Contributions:
0

Disable drill down to single product

Hi everybody,

can any one help me on this. It's an easy question but the answer may not be. I want to disable the feature for drilling down from catagories to the individual product i.e. when a custome clicks on catagories on the main page they are directed to the product list for that catagorie and cannot click to go deeper than this. From here they can select the number of items oer product and add selected items to their cart. This is for our wholesale customers only. The skeleton of the site is here. Also would need for any NEW for month product listings to direct them to that catagorie.

5 Jun 2007, 6:13 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Disable drill down to single product

Is the whole site for wholesale customers, or do you want different behavior for logged-in wholesale customers and all others?
If the latter, it should be possible but decidedly more complex coding required.

If the former, what you would want is to disable the "more info" and title/image links in product listings. This should be a relatively simple matter to do, but from my memory of a year ago, could take a while to find the right files to edit.

You would need to repeat at least some of this process for each type of listing you want to use (featured, new, all, specials & maybe search).

5 Jun 2007, 8:19 PM
#3
rottiejoe avatar

rottiejoe

New Zenner

Join Date:
Mar 2007
Posts:
86
Plugin Contributions:
0

Re: Disable drill down to single product

Hi Glenn
The first option. We already have a Zen cart site for retail Customers here so the new site would be only for wholesale. I am new to Zen cart and for that matter PHP, CSS but I am a fairly quick study when needed!! If you can point me in the right direction as to what files need to be edited and in what way I would be very gratefull. I have an idea that it is just a case of disabling the links from sub catagories as you pointed out but on this I need a wee bit of help.
:smartalec:

Thank you for the help so far and the vey quick reply

5 Jun 2007, 11:59 PM
#4
rottiejoe avatar

rottiejoe

New Zenner

Join Date:
Mar 2007
Posts:
86
Plugin Contributions:
0

Re: Disable drill down to single product

Hi

I have figured out how I can use the zen cart catagories and sub-catagories to do what I need. My only gripe is that on the listing page I cannot click on an image to get a larger image without drilling down to that specific products page. Is there a way of setting this up in admin because I have searched everywhere in admin without, obviously, any success.

Thanks

6 Jun 2007, 12:08 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Disable drill down to single product

In tpl_product_info_display.php, there is code around the main image display that calls in the popup function. You could probably transplant that to product_listing.php, in the "image" case section. You will have to be sure you get enough code and not too much.

6 Jun 2007, 9:59 PM
#6
rottiejoe avatar

rottiejoe

New Zenner

Join Date:
Mar 2007
Posts:
86
Plugin Contributions:
0

Re: Disable drill down to single product

Don't know what I did wrong here but it does nothing. Sorry but my PHP skills are not very good. This is the code from product_listing.php with the transposed code from tpl.product_info_display.php. What have I done wrong.

 
   case 'PRODUCT_LIST_IMAGE':
        $template->get_template_dir('/tpl_modules_additional_images.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_additional_images.php';
        $lc_align = 'center';
        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>';
          } else {
            $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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>';
          }
        }
        break;
      }
      $list_box_contents[$rows][$col] = array('align' => $lc_align,
                                              'params' => 'class="productListing-data"',
                                              'text'  => $lc_text);
6 Jun 2007, 10:43 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Disable drill down to single product

You have gotten the additional images code, not the main product image code.
If the product has no additional images this will happily do nothing.

Also, you will need to comment out the listing image code so you don't get two images. I think you would be safe disabling the entire "if" statement, leaving nothing between

$lc_align = 'center';

and

break;

7 Jun 2007, 12:04 AM
#8
rottiejoe avatar

rottiejoe

New Zenner

Join Date:
Mar 2007
Posts:
86
Plugin Contributions:
0

Re: Disable drill down to single product

Given up on this for now. It does not work and it seems to be something a lot of people are requesting in the forums. Pity. last code tried below. :frusty:

   ```php

case 'PRODUCT_LIST_IMAGE':
$template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php';
$lc_align = 'center';
{
$lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 0 ? 'cPath=' . $_GET['cPath'] . '&' : '') . '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>';
}
break;
}
$list_box_contents[$rows][$col] = array('align' => $lc_align,
'params' => 'class="productListing-data"',
'text' => $lc_text);
}

7 Jun 2007, 1:25 AM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: Disable drill down to single product

I said to remove everything between $lc_align = 'center'; and break;

The orphan { $lc_text... } would cause a problem if nothing else does.

I'll have a look at tpl_modules_main_product_image.php and see if I spot any obvious problems there. I'm not sure if it will properly recognize the product to be displayed in its new location - might require some of the listing image definition code.

7 Jun 2007, 10:59 AM
#10
duckarina avatar

duckarina

New Zenner

Join Date:
Nov 2006
Posts:
14
Plugin Contributions:
0

Re: Disable drill down to single product

I too have the same requirement as rottijoe - you can see where I have gotten so far at: http://www.monbijouusa.com/shop/index.php?main_page=index&cPath=1_2

I have managed to get a pop up window to work on the image but I haven't figured out how to control the pop up image or the size and look of the pop up window.

   ```php

case 'PRODUCT_LIST_IMAGE':
$lc_align = 'center';
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(FILENAME_POPUP_IMAGE, 'pID=' . $listing->fields['products_id']) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
} else {
$lc_text = '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $listing->fields['products_id']) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
}
}
break;


I took the href link from tpl_modules_main_product_image.php
I think if the javascript from this page can be modified for use in product_listing.php the pop up would work properly - but I can't get this script to work:
```php
<script language="javascript" type="text/javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
//--></script>

Have to go to sleep now - I am hoping a zen good fairy can finish what I have started.

7 Jun 2007, 11:13 AM
#11
duckarina avatar

duckarina

New Zenner

Join Date:
Nov 2006
Posts:
14
Plugin Contributions:
0

Re: Disable drill down to single product

Update to previous post...

When you go to the Mon Bijou website - click on the picture for Afreeka #MN039 - that is the only one with a large image. And yes the large image does appear but the window it opens isn't as clean as the javascript window.

7 Jun 2007, 12:50 PM
#12
duckarina avatar

duckarina

New Zenner

Join Date:
Nov 2006
Posts:
14
Plugin Contributions:
0

Re: Disable drill down to single product

Javascript pop up works.

To see on my site, go to http://www.monbijouusa.com/shop/index.php?main_page=index&cPath=1_2 - click on the picture for Afreeka #MN039 (only prod with a large image at the moment).

How I did it ( I am using grid layout product listing):

In includes/modules/CUSTOM/product_listing.php around line 207:

case 'PRODUCT_LIST_IMAGE':
        $lc_align = 'center';
        if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
          $lc_text = '';
        } else {
          if (isset($_GET['manufacturers_id'])) {  
		  								
            $lc_text = '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $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>';
          } else {
            $lc_text = '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $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>';
          }
        }
        break;

Then I copied the javascript file jscript_main.php from
includes/modules/pages/product_info/
to
includes/modules/pages/index/

I didn't do anything to jscript_main.php - just copied it from one folder to another.

I hope I am telling you everything - but considering it's 5:45am and I haven't had any sleep I may have missed something.

Once I decide whether to eat breakfast or sleep - I am going to do the same to the text link. If I find I've missed anything I'll let you know.
:clap: :clap: :clap:

7 Jun 2007, 2:45 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Disable drill down to single product

Excellent work! I know lots of people will be happy to have this functioning.

7 Jun 2007, 8:59 PM
#14
duckarina avatar

duckarina

New Zenner

Join Date:
Nov 2006
Posts:
14
Plugin Contributions:
0

Re: Disable drill down to single product

Thanks Glenn.

Code for the text link in product_listing.php follows:

case 'PRODUCT_LIST_NAME':
          $lc_align = '';
          if (isset($_GET['manufacturers_id'])) {
		  
            $lc_text = '<h4 class="itemTitle"><a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $listing->fields['products_id']) . '\')">' . $listing->fields['products_name'] . '</a></h4><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
          } else {
            $lc_text = '<h4 class="itemTitle"><a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $listing->fields['products_id']) . '\')">' . $listing->fields['products_name'] . '</a></h4><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
          }
          break;

I have tested this in Safari and Firefox on a Mac and Explorer on a PC.

7 Jun 2007, 10:51 PM
#15
rottiejoe avatar

rottiejoe

New Zenner

Join Date:
Mar 2007
Posts:
86
Plugin Contributions:
0

Re: Disable drill down to single product

Hi,
Brilliant work have set it up and it does exactly what I needed. This should be included in future releases in admin. The only thing missing now is the text link.:clap::clap::clap::clap::clap::clap:

8 Jun 2007, 4:13 AM
#16
duckarina avatar

duckarina

New Zenner

Join Date:
Nov 2006
Posts:
14
Plugin Contributions:
0

Re: Disable drill down to single product

Thanks Rottiejoe - Take a look at my post (#14) just before your last - that has the text link.

Post # 12 covers the image link.

Post # 14 covers the text link.

If you go to my site http://www.monbijouusa.com/shop/index.php?main_page=index&cPath=1_2 - you'll see they both work.

Cheers.

2 Feb 2009, 9:01 PM
#17
dave_nextexit avatar

dave_nextexit

New Zenner

Join Date:
Mar 2008
Posts:
57
Plugin Contributions:
0

Re: Disable drill down to single product

gjh42:

Is the whole site for wholesale customers, or do you want different behavior for logged-in wholesale customers and all others?
If the latter, it should be possible but decidedly more complex coding required.

If the former, what you would want is to disable the "more info" and title/image links in product listings. This should be a relatively simple matter to do, but from my memory of a year ago, could take a while to find the right files to edit.

You would need to repeat at least some of this process for each type of listing you want to use (featured, new, all, specials & maybe search).

Hi,

I want to do what he was talking about previously - not being able to drill down into the individual products' Product Info page. Basically I want to disable the product image link and title link so that people can't drill down any further than the Product Listing view. Any help would be greatly appreciate! Thanks!