Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set?

    OK, so I'm looking in some templates, and trying to achieve some behavior that I want. If you see something like:

    if (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS == 0)

    ...how can you find out where in the admin interface this variable actually is?

    I mean, I already searched all the code for it, and it is only used in a number of places, never actually set, so I am assuming it is set from the admin interface - but there are so many possible locations, and the names don't necessarily match these constants.

    Thanks!

  2. #2
    Join Date
    Oct 2007
    Location
    Fairbanks, Alaska
    Posts
    426
    Plugin Contributions
    0

    Idea or Suggestion Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    Did you try admin-tools-developers tool kit try under Look up Constant.

  3. #3
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    If it's not there, it is defined in db. You will want to check the table configuration I think, and search for that specific constant in the field configuration_key
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  4. #4
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    Thank you, I managed to find it by searching in the database, in the config table. Then, by laboriously going through each configuration page in the zencart/admin, looking for something that sounded like it and had the same value setting as the database (1). This took nearly a half hour.

    It would be so nice if there were an easier way to correlate CONSTANTS and the places that they exist in the admin interface. Perhaps the database's configuration_group_id relates to which page they are on, but again, there's no list that I know of that lists this info.

    For example, here's the correlation:

    SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS = Index Listing > New Products Columns per Row

    This was not obvious at all. But thanks for the tips.

  5. #5
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    Actually, I did figure out somewhat of a method for anyone who is interested.

    1. Search in the database configuration table, and find the variable name, such as SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCT.

    2. Check the database entry's configuration_group_id. In this case, it is '24'.

    3. In zencart/admin, choose any of the configuration pages, such as the first one 'My Store'.

    4. Check the URL at the top of the browser. It will say something like: http://yourdomain.com/zencart/admin/configuration.php?gID=1

    5. The end part is the Group Id. Change this to 24, and then hit enter. Voila, you are now on the page containing that variable. It's somewhere in the list.

  6. #6
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    Actually, another way is:

    Once you lookup the parameter in the configuration table and find out what the Group_id is (i.e. 24), you can go to the configuration_group table, hit browse, and lookup the number - it tells you the page title for that group, i.e. "Index Listing".

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    If you'd followed colemanpa's suggestion to use the built-in Developers Toolkit, you would have found it in 15 seconds.
    And then in another 20 seconds you would have a listing of all files where the constant is ever used, just by telling it which subset of files to look in.
    .

    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.

  8. #8
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    Quote Originally Posted by DrByte View Post
    If you'd followed colemanpa's suggestion to use the built-in Developers Toolkit, you would have found it in 15 seconds.
    And then in another 20 seconds you would have a listing of all files where the constant is ever used, just by telling it which subset of files to look in.
    I'm sorry, but I used that, it told me nothing useful. Please try it, with this variable, and see what you get. You will get the fact that it is used, but never *set* in many files. Please try it and show me how you can determine where that variable is *set* based on the results, and what config page it is actually set on.

    Not only that, I have many developer's tools here on my computer, I can search all of the source code and template code with many different approaches.

    I'm not sure what your point is, but I believe the info I have posted here can be useful to someone else who is new to zencart.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    Quote Originally Posted by karma-lab View Post
    I'm sorry, but I used that, it told me nothing useful. Please try it, with this variable, and see what you get. You will get the fact that it is used, but never *set* in many files. Please try it and show me how you can determine where that variable is *set* based on the results, and what config page it is actually set on.

    Not only that, I have many developer's tools here on my computer, I can search all of the source code and template code with many different approaches.

    I'm not sure what your point is, but I believe the info I have posted here can be useful to someone else who is new to zencart.
    Okay, I'll indulge for a moment.

    You're making it way more difficult than you need to, and I would not recommend your approach for newbies ... the tools are already provided. For example:
    Quote Originally Posted by karma-lab View Post
    Actually, I did figure out somewhat of a method for anyone who is interested.

    1. Search in the database configuration table, and find the variable name, such as SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCT.

    2. Check the database entry's configuration_group_id. In this case, it is '24'.

    3. In zencart/admin, choose any of the configuration pages, such as the first one 'My Store'.

    4. Check the URL at the top of the browser. It will say something like: http://yourdomain.com/zencart/admin/...tion.php?gID=1

    5. The end part is the Group Id. Change this to 24, and then hit enter. Voila, you are now on the page containing that variable. It's somewhere in the list.

    1. Go to Admin->Tools->Developers Toolkit.
    2. In the first input box, paste in the constant you're looking for: SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS
    3. Click search (without touching the pulldowns).
    4. Bam ... you are given a screen which shows you:
    a) the constant name
    b) its description
    c) where to set it
    d) a button to click to take you to the page where it can be changed
    e) a reference to the section in which it is configured if you wanted to navigate manually.

    Takes longer to type out how it works than to actually use it.

    No need to muss with the database.



    ... and if you want to see every place where the constant is *used*, simply paste the constant name in the appropriate input box and choose the grouping of files you want to search. In a couple seconds you'll see all the search results including filenames and line numbers.
    .

    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.

  10. #10
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: How can you find where a value like SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS is set

    Thank you! You are, of course, right. However, let's examine why I never found this info in the first place.

    When you go to developer's toolkit, the page is confusing. Why would I enter the variable in the first box and leave the files menu set to "None"? That doesn't seem to make sense. I don't want to search "no" files, I want to search something.

    Secondly, when I looked at this page, and read the various options, I chose the last item on the page: "search all files". I figured I didn't want to search any specific groups, I wanted to search all of the files. And using this option indeed presents you with a listing of all the places in the files where it is used, but nothing useful about where you can find it. Also, you have this message about CONSTANTS under each search option; it makes it look like you can search for a constant with any of the methods.

    Perhaps this is explained somewhere; I am not anti-documentation reading; I've read many things in the last week or so, but I can't say I'm overly impressed with the scattered organization of the documentation here.

    Now that I know this, of course your method gives all the needed info and takes you directly to it. But I don't think this page makes it clear, at all, how it should best be used - especially to a zen-cart newbie. I think you should have the option to search for a constant and find where to set it more separate from the rest of the options on that page. Just a simple text box with no drop down menu, with a line divider after it, simply "search for CONSTANT in database" or something, clearly offset from the rest of the options, so that it is obviously the first thing to be tried. Thanks for listening.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How can I set up a built in credit card payment like this?
    By buhebutler in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 25 Nov 2012, 06:20 AM
  2. Replies: 1
    Last Post: 22 Feb 2010, 05:48 PM
  3. Where do I find the current value...
    By SoyCandleMaker in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 28 Jun 2006, 05:27 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR