Results 1 to 10 of 22

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    24
    Plugin Contributions
    0

    help question which file calls tpl_index_product_list.php?

    I am trying to create a separate product-listing display for the Documents General product type. My preferred method would be to copy the product-listing files (tpl_index_product_list.php, tpl_modules_product_listing, and if necessary even product_listing.php) and customize them to process Documents General requests in the particular way I want. That's easy enough, but for it to work I need to modify the file that calls them in the first place so that it redirects Documents General requests to the custom files. Unfortunately, in my ignorance, I just can't figure out which file calls tpl_index_product_list.php. I would expect it to be the same file in which the switch "Skip 1-prod Categories" get processed, since that switch performs a gate-keeper function similar to the one I want to add, but I can't manage to find that one, either, since I don't know what the switch is called outside of the Admin interface.

    I've spent hours doing every search I can think of, both in Developers Tool Kit and on this site, without success, driving myself to such a point that I'm actually willing to ask for help (!).

    So, to boil this down:

    1) which file does call tpl_index_product_list.php;
    2) is that even the file I need, and if not, which one is;
    3) is there some handy online resource I have somehow overlooked that would have answered this question for me without bothering all of you?

    Many thanks!

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: which file calls tpl_index_product_list.php?

    Try
    /includes/modules/pages/index/main_template_vars.php
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: which file calls tpl_index_product_list.php?

    That's the one! Thanks, Kobra. I really appreciate it. Unfortunately, now that I'm there, I can't figure out the right formulation for the crucial if/then statement that distinguishes the product type. I know the product type id for Documents General is 3, and I've tried any number of formulations to get there, but none of them have worked. That leaves me with:

    if [perplexing mystery variable] == 3 {

    $tpl_page_body = 'tpl_index_document_list.php';
    } else {
    $tpl_page_body = 'tpl_index_product_list.php';
    }

    Any suggestions? Sorry to be so helpless. Actually, I do seem to be okay at figuring out existing code and tweaking it, but I don't know php and Zen Cart well enough to figure out how to do things I can't find a model to imitate. Thanks again.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: which file calls tpl_index_product_list.php?

    Document-General is a "product type".
    And the product-type is specific to each *product*, not to the *list*.

    So then the question is ... what if the products in the list are of *mixed* product-types? Then what do you expect it to do?


    Aside: what's this alternate product-listing "display" intended to look like? What are you doing unique with it?
    .

    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.

  5. #5
    Join Date
    Jul 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: which file calls tpl_index_product_list.php?

    Thank you for your reply, Dr. Byte. To answer your questions in reverse order:

    My business, in addition to having a small online component, sells its products wholesale to something like 120 retail stores. Since I didn't need the Documents General product type for anything else, I decided to use it for the names and addresses of those stores (categorized by country and subcategorized by state and city), so that customers who wanted to go to a bricks-and-mortar store could easily determine if there was one near them. My product-listing display of actual physical products consists solely of product images, arranged in a grid. I want my new document-listing display for Documents General to consist solely of the "product" (i.e., document) descriptions, arranged in a single column.

    I have been careful to prevent mixed results from occurring. I modifed both the categories sidebox and advanced search to exclude the retail store results. Then I created a separate categories sidebox exclusively for the retail stores. That was when I realized that displaying the results of the latter sidebox presented a problem, because I needed a very different layout for them.

    I do understand your point about product type being specific to products rather than to group results, but since I had been able to deal with that issue up to now in modifying the category sideboxes and advanced search, I innocently assumed I would be able to cope with it here, too. Of course, that depended on my finding main_template_vars.php to see how it even worked -- hence my original question to this forum.

    I do see two other possible ways of addressing my problem besides using "product type" as a filter, but they both present the same problem you raise. The way I excluded Documents General from the categories sidebox was first to disable all the categories that contained documents-general and then to limit the standard sidebox to enabled categories. Although a little strange, that seemed more efficient than letting the sidebox pull up all the categories and then screening the results by product type, and all I had to do to make my new documents-general sidebox work was to flip the toggle and tell it to pull up only DISabled categories (in four years of my old 1.3.8 site, I've never needed to disable an actual product category, so I don't anticipate that being a problem going forward). So, at least in theory, excluding products from enabled categories could be the filter here. Similarly, the way I excluded Documents General from advanced search was to debar my entire "retailers" root category and all its subcategories (countries, states, and cities) from the database query. So again, in theory, that would be another possible filter here. But neither of these cases gets around the individual vs. group issue you raise. Still, the problem doesn't seem insurmountable to me. Surely there must be a way to say, "if ANY of the products in this list is of the Documents General product type (or from a disabled category, or from a subcategory of category X) then go to tpl_index_document_list.php instead of tpl_index_product_list.php -- though it would be more efficient, I suppose, to ask instead "if the FIRST product in this list ... " since if it is, the rest of them will be, too.

    I hope all of that is clear, even if it is a little discursive. Does it suggest any solutions beyond having me taken out and shot? Thanks again for your help!

  6. #6
    Join Date
    Jul 2008
    Posts
    24
    Plugin Contributions
    0

    Default Re: which file calls tpl_index_product_list.php?

    Oh, forgot. To avoid mixed lists, I also modified New Products, so that it would pull up only physical products, not the retail stores. That one I did using product type. In each of these different cases, I filtered by whatever method seemed easiest to apply to the code I found in place.

 

 

Similar Threads

  1. product description in which php file?
    By charliepingpong in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 2 Jun 2011, 07:42 AM
  2. Which php variable calls for Total Items in Cart?
    By samar777 in forum General Questions
    Replies: 8
    Last Post: 24 Sep 2010, 09:59 PM
  3. knowing which php file calls which?
    By joemind in forum General Questions
    Replies: 0
    Last Post: 15 Oct 2008, 08:28 PM
  4. How do I add the MFR IMG to tpl_index_product_list.php?
    By molywerks in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 22 Jun 2008, 05:39 AM
  5. tpl_index_product_list.php - single image
    By sam18204 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Jan 2007, 01:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg