Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2013
    Posts
    17
    Plugin Contributions
    0

    Default PHP code to study variables?

    Good afternoon everyone. May I ask for some help? I am slowly getting to understand the practical aspects of Zen Cart, but I would like to also be able to understand php coding. Over the years I have found that a combination of text books and practical examples is the best way forward in tackling the ‘steep curve’ for me. I would very much like to do the following:

    Using a Local Host setup:

    1. Create a file (i.e. MyStore_variables) for storing variables.
    2. Construct a piece of code which I can embed into any ZC program of interest.
    3. Collect the contents of the variables in the program of interest, as the program runs.
    4. Store these variables into the file MyStore and save in the ZC file structure.

    Is there anyone who could provide a solution? I do not want a full blown program just the basics and that in itself would help with php learning.

    Back in BASIC days I could STOP, HALT or PAUSE a program and type in the variable name(s), which would then appear on the VDU or be sent to a printer.

    Many thanks for any help.

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: PHP code to study variables in Zen Cart v151

    Quote Originally Posted by lewisasding View Post
    Back in BASIC days I could STOP, HALT or PAUSE a program and type in the variable name(s), which would then appear on the VDU or be sent to a printer.
    In places where you used to use STOP, etc, enter the following code.
    Code:
    require('dump.php'); // pretty variable dumps dump($var)
    var_dump( get_defined_vars() );die();
    Also, if you haven't yet discovered the joys of using a modern IDE I would strongly recommend you download one and learn how to use it. My preference is NetBeans, but there are several others that are equally good (and arguably better). Although these things may appear to have a lot of 'bloat' (especially for old time programmers, such as myself), and I still occasionally resort to 'hand coding' and using break commands to follow program flow, I think trying to code without a decent IDE these days is like riding a horse and buggy into town when everyone else is driving a car.

    Cheers
    Rod

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: PHP code to study variables in Zen Cart v151

    You could install the Super Globals Plus (http://www.zen-cart.com/downloads.php?do=file&id=524) plugin. It will display all the PHP variables you've configured via your admin for the current Zen Cart page.

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,684
    Plugin Contributions
    123

    Default Re: PHP code to study variables in Zen Cart v151

    Use PHPStorm. It's *awesome*. http://www.jetbrains.com/phpstorm/

    If you're even moderately serious about this endeavor then, as @rodg says, this puts you in a car instead of a horse and buggy.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Feb 2013
    Posts
    17
    Plugin Contributions
    0

    Default Re: PHP code to study variables in Zen Cart v151

    Thanks RodG for your help, support and code Very much appreciated; "die" in the context of this code is pretty scary the first time you use it.!!!

  6. #6
    Join Date
    Feb 2013
    Posts
    17
    Plugin Contributions
    0

    Default Re: PHP code to study variables in Zen Cart v151

    Quote Originally Posted by lat9 View Post
    You could install the Super Globals Plus (http://www.zen-cart.com/downloads.php?do=file&id=524) plugin. It will display all the PHP variables you've configured via your admin for the current Zen Cart page.
    Thanks Lat9 I will give it a go. I have only ever downloaded one other 'add-on' or 'plug-in’, sorry not sure of the difference.That was Dr.Byte's transfer of large sql files and that went well.

  7. #7
    Join Date
    Feb 2013
    Posts
    17
    Plugin Contributions
    0

    Default Re: PHP code to study variables in Zen Cart v151

    SWGuy, thank you for your help and advice. Much appreciated.

 

 

Similar Threads

  1. Effects Of Disabling PHP Variables
    By karlnj in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 24 Feb 2009, 04:02 PM
  2. Zen variables in define_privacy.php
    By willsy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Mar 2008, 04:43 AM
  3. Php variables and other questions
    By freef4ll in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 30 Dec 2006, 12:00 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