Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default External text file

    is there a possibility to use an external text file or html page on the product info page? Not from SQL.
    Using Zen Cart 1.5.1

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

    Default Re: External text file

    Why? What's the business problem you're trying to solve here?
    And how many products do you believe you need to do this with?
    .

    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.

  3. #3
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: External text file

    Since I don't have the knowledge of SQL and php, I thought this would be the vest way.

    It would up to 5 different text file or html pages for different products that needs to be changed periodically.

    I tried using the following but, this would be consistent for all products. I need to pass the value of $var1 somehow.
    PHP Code:
    <?php $var1 'red'?>

    <?php 

        $Message1 
    $var1 '.html';
        include 
    $Message1;

    ?>
    Thank you.
    Last edited by Kevin205; 28 Apr 2013 at 01:54 AM.
    Using Zen Cart 1.5.1

  4. #4
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: External text file

    Kevin, Maybe I'm missing something. Is this something for a particular product or for a group of products? Can you please give more clarity to your problem, like what exactly you are trying to do? Depending on what is doing on you could create a new template for a different product type. What is in this file you are trying to add to the product_info page? Please describe more of what you are trying to do so we may provide the best solution

  5. #5
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: External text file

    Sorry for not being precise, and thank you for replying.

    Quote Originally Posted by bislewl View Post
    Kevin, Maybe I'm missing something. Is this something for a particular product or for a group of products? Can you please give more clarity to your problem, like what exactly you are trying to do? Depending on what is doing on you could create a new template for a different product type. What is in this file you are trying to add to the product_info page? Please describe more of what you are trying to do so we may provide the best solution
    - It would be for a group of products/categories, for certain manufacturers.
    - File is formatted html. It is used to have more information, history, etc. It has to be separate from $products_description. It has to be placed at the bottom of the page above the footer area of the product info page.

    At the moment, I am trying to find out how to pass $var1 in <?php $var1 = 'red'; ?> to the following. red.html is what I am trying to display. The value red is what I am trying to pass to the code.
    PHP Code:
    <?php 

        $Message1 
    $var1 '.html';
        include 
    $Message1;

    ?>
    I hope I am making sense. Thanks.
    Last edited by Kevin205; 28 Apr 2013 at 02:30 AM.
    Using Zen Cart 1.5.1

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

    Default Re: External text file

    Yes, that's the way to do it. You must put the files into the root folder unless you're specifying the path to the file in your include() call. See the php.net site for proper syntax of the include() function.

    Tip: Don't ever use user-supplied input to specify include() paths. Well, at least not without sanitizing the data first. Best just to never do that.
    .

    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.

  7. #7
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: External text file

    If this is not possible, is there a way to have additional products fields for different products?
    Using Zen Cart 1.5.1

  8. #8
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: External text file

    In the product info page there should be a variable $manufacturers_name
    you could then use that, as it describes the manufactures already and would be easy to remember which is which.

    **If you want to do it a little bit more fancy**
    Personally, I would add a column to the manufactures table and then call on that on the product info page. And allow it to be changed via manufacturers.php in the admin.
    Or
    You could us just add plan php file that you could do a switch

    Does that make sense?

  9. #9
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: External text file

    Quote Originally Posted by DrByte View Post
    Yes, that's the way to do it. You must put the files into the root folder unless you're specifying the path to the file in your include() call. See the php.net site for proper syntax of the include() function.
    I will try this.

    Tip: Don't ever use user-supplied input to specify include() paths. Well, at least not without sanitizing the data first. Best just to never do that.
    Would you mind explaining this more.
    Thank you.
    Using Zen Cart 1.5.1

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

    Default Re: External text file

    Quote Originally Posted by Kevin205 View Post
    Tip: Don't ever use user-supplied input to specify include() paths. Well, at least not without sanitizing the data first. Best just to never do that.
    Would you mind explaining this more.
    Don't directly use $_POST or $_GET data in any value you pass to include(), either directly or indirectly.

    More info: study OWASP programming principles
    .

    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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Javascript As External File
    By jill8026 in forum General Questions
    Replies: 11
    Last Post: 12 Sep 2009, 04:12 PM
  2. Sidebox include external file?
    By bizshop1 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 6 Apr 2009, 10:00 PM
  3. single sidebox for external file
    By delia in forum All Other Contributions/Addons
    Replies: 16
    Last Post: 3 Jan 2008, 08:45 AM
  4. Use ZC defines in external file...
    By Alex Clarke in forum General Questions
    Replies: 2
    Last Post: 17 Jul 2007, 06:17 PM
  5. Easy Populate won't work with Excel text file, only Text Edit file.
    By anduril3019 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 21 Jan 2007, 04:42 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