Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jul 2008
    Posts
    14
    Plugin Contributions
    0

    Default Storing the 'Products Decription' in a seperate file

    On my website I have a lot of items that have an identical Product Description. At the moment if I want to change something in the description I need to edit each item and that takes a long time.

    I would like to be able to save the text into a separate file and have it loaded when the product is viewed.

    Can this be done? (easily....lol)

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Storing the 'Products Decription' in a seperate file

    Not easily, no. You might look at swguys boilerplate mod:

    http: //www.thatsoftwareguy.com/zencart_php_in_description.html

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

    Default Re: Storing the 'Products Decription' in a seperate file

    What about using an IFRAME e.g.

    In the Products Description box I can put this ...
    Code:
    <iframe src ="http://www.mysite.com/some_text.htm" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="676" height="235">
      <p>Your browser does not support iframes.</p>
    </iframe>
    and the text will fill the frame. Obviously I need to adjust the height and width to suit.

    Are there any problems with using IFrames?

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Storing the 'Products Decription' in a seperate file

    Far as I know, there's no problem using iframes in Zencart as long as they don't come anywhere near the payment processing.

    By default, Zencart strips HTML out of the product listing, but that should work for the product info page. Give it a try and let us know if it works.

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Storing the 'Products Decription' in a seperate file

    I hate IFRAME ... but I do admit to using them in some zencart stores. As Steve says, keep IFRAMES away from all processes requiring user interactivity (sign-up, login, checkout, contact us, etc).

    I can see no practical reason why an IFRAME in your product description text will not do what you are after.

    Scott Wilson's Boilerplate mod may help... but I think it will apply universally... ie: not product-specific.
    20 years a Zencart User

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

    Default Re: Storing the 'Products Decription' in a seperate file

    It works, however to get consistency in the text I had to set up my external text file like this.

    Code:
    <head>
    <style type="text/css">
    body {
    	margin: 0;
    	font-family: verdana, arial, helvetica, sans-serif;
    	font-size: 62.5%;
    	}
    </style>
    </head>
    <body>
    <div style="font-size: 1.32em; line-height: 1.4em; text-align: justify; font-family: verdana,arial,helvetica,sans-serif; color: #363636">
    {Insert Text Here]
    </div>
    </body>
    Then in the product description I insert the html code for the Iframe like this ...

    Code:
    <iframe src ="http://www.my-site.com/some_text.htm" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="676" height="235">
      <p>Your browser does not support iframes.</p>
    </iframe>
    The productDescription div will expand to allow for an Iframe of any height (Did not check width) but the height does need to be entered into each Product so if I change the text in the external file then I would need to change the height value in each of the products anyway.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Storing the 'Products Decription' in a seperate file

    If you know basic PHP you can wrap a test around the boilerplate code to apply it only for specific produsts or categories.

  8. #8
    Join Date
    Jul 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Storing the 'Products Decription' in a seperate file

    I tried to be creative. I searched the web and found this page http://www.codeproject.com/KB/script...me_Height.aspx

    I inserted this script into the includes\templates\[my template]\jscript\jscrip_main.php

    Code:
    <script type="text/javascript">
    	function getElement(aID)
    	{
    		return (document.getElementById) ? document.getElementById(aID) : document.all[aID];
        }
    
        function getIFrameDocument(aID){ 
            var rv = null; 
            var frame=getElement(aID);
            // if contentDocument exists, W3C compliant (e.g. Mozilla) 
            if (frame.contentDocument)
                rv = frame.contentDocument;
            else // bad Internet Explorer  ;)
    			rv = document.getElementById(aID).document;
            return rv;
        }
    
        function adjustMyFrameHeight()
        {
            var frame = getElement("myFrame");
            var frameDoc = getIFrameDocument("myFrame");
            frame.height = frameDoc.body.offsetHeight;
        }
    </script>
    and modified the Iframe code to ...

    Code:
    <iframe id="myFrame" src ="http://www.my-site.com/some_text.htm" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" width="676" onload="adjustMyFrameHeight()">
      <p>Your browser does not support iframes.</p>
    </iframe>
    This worked perfectly in Firefox but Internet Explorer does not work properly.

    Also leaves me with missing text if a vistor to the site has javascript disabled.

    Will go back to changing them one at a time I think.

  9. #9
    Join Date
    Jul 2008
    Posts
    14
    Plugin Contributions
    0

    Default Re: Storing the 'Products Decription' in a seperate file

    Quote Originally Posted by gjh42 View Post
    If you know basic PHP you can wrap a test around the boilerplate code to apply it only for specific produsts or categories.
    I have the boiler plate link on my list to look into next. Time for bed.

  10. #10
    Join Date
    May 2009
    Posts
    20
    Plugin Contributions
    2

    Default Re: Storing the 'Products Decription' in a seperate file

    Quote Originally Posted by brettb76 View Post
    On my website I have a lot of items that have an identical Product Description. At the moment if I want to change something in the description I need to edit each item and that takes a long time.

    I would like to be able to save the text into a separate file and have it loaded when the product is viewed.

    Can this be done? (easily....lol)
    I have the same problem. Can I add a php include in the Products Description. And if yes, how?

    <?php include 'instructions-adult-en.php'; ?>
    v1.3.8a - Cherry Zen - English, French, German, Slovak, Czech -
    Admin Login as a customer v2.1, FastAndEasyCheckout 1.7.3, improved_attributes_controller_1-1b2, recover_cart_sales_300B, supertracker_1-0_Fix_20090925, testimonial_manager_v1-5-0

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Can't include catalog functions in seperate PHP file.
    By fawad123 in forum General Questions
    Replies: 38
    Last Post: 6 Dec 2017, 07:59 PM
  2. what is the proper folder for storing images?
    By idc1 in forum General Questions
    Replies: 3
    Last Post: 11 Jul 2011, 02:20 PM
  3. Storing order/customer info in a flat file
    By mithaimate in forum General Questions
    Replies: 0
    Last Post: 30 Sep 2009, 10:29 AM
  4. Special products decription and name removing
    By joemind in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Jul 2009, 05:01 AM
  5. Replies: 0
    Last Post: 22 Feb 2008, 06:12 PM

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