Page 1 of 37 12311 ... LastLast
Results 1 to 10 of 361
  1. #1
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Easy embed template

    HI there,
    Though out last year I had developed an 'easy embed template' for Zen Cart 1.2.x.
    All you had to do was define a template file for your site in the config, and through a long set of REGULAR EXPRESSIONS it would put what ever you had for the rest of your site around your zen cart. embedding it in in site of the master template.
    Well for ver 1.3.x I am going to realease that code. this is the starter thread.
    below I am going to paste all the expressions, please feel free to make any suggestions as, I stumbled through making them and could use the communities help.

    JOsh

    PHP Code:
    //strip some duplicate tags that zen cart manages itself 
    $sitetemplate=preg_replace('/<!DOCTYPE.*?>/si'''$sitetemplate);
    $sitetemplate=preg_replace('/<meta.*?>/si'''$sitetemplate);
    $sitetemplate=preg_replace('/<html.*?>/si'''$sitetemplate);
    $sitetemplate=preg_replace('/<title.*?title>/si'''$sitetemplate);


    //Sangus: replace hrefs to point above catalog, but not the href for the style sheet! or http links!
    $sitetemplate=preg_replace('/href="/si''href="../'$sitetemplate);
    $sitetemplate=preg_replace('/href="..\/..\//si''href="../'$sitetemplate);
    $sitetemplate=preg_replace('/href="..\/http/si''href="http'$sitetemplate);

    //replace last bits: img src
    $sitetemplate=preg_replace('/src="images/si''src="../images'$sitetemplate);
    $sitetemplate=preg_replace('/<!-- START EMBED -->/si''<!-- START EMBED -->'$sitetemplate);
    $sitetemplate=preg_replace('/<!-- END EMBED -->/si''<!-- END EMBED -->'$sitetemplate);

    //creates bits for the had and the body
    $sitetemplate_head preg_replace('/<\/head>.*$/s'''$sitetemplate);
    $sitetemplate_top=preg_replace('/<!-- START EMBED -->.*$/s'''$sitetemplate);

    //replicats info fot the body tag atributes
    preg_match('/<body([^>]+)>/'$sitetemplate$sitetemplate_body_pre) ;
    $sitetemplate_body =  $sitetemplate_body_pre['1'];
    $sitetemplate_body preg_replace('/images/s''../images'$sitetemplate_body);

    //strips the head info from the body
    $sitetemplate_top=preg_replace('@<head[^>]*?>.*?<body.*?>@si'''$sitetemplate_top);
    $sitetemplate_top=preg_replace("@,'images/@si"",'/images/",  $sitetemplate_top);

    //strips the head info from the body
    $sitetemplate_head=preg_replace('@</head>@si'''$sitetemplate_head);
    $sitetemplate_head=preg_replace('@<head>@si'''$sitetemplate_head); 

  2. #2
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: Easy embed template

    ##########################-

    I really hate to sound lame, but after reading and re-reading your post - I have absolutely no idea what you are talking about. Nor do I understand what you're supposed to with the lines of code.

    Any further info on what and how this works would be appreciated.

    thank you,

    Betty

  3. #3
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Re: Easy embed template

    fair enough.
    I tend to murder written communication.
    what this is is a template program that make its very easy to add a zen cart to and existing web site. this is more for people who already have a look and feel that they like, and just want to stick zen cart into the "content' are of their site and have it surrounded but the rest of their site.
    In example. Joe had a site a/ a few pages on it and he has a pay pal style shopping cart that lists all his products and has the normal add to cart & check out buttons (ie http://www.estesjewelry.com)
    say the client want to upgrade to zen cart but does not want to loose her current layout. this template would make it very quick and easy for her to install ZC and then have her lay out wrap around the zen cart that just replaces the pay pal part of her site.
    I know that one can do this by just copying an pasting things into the tpl header and footer, but once you do that one can not rely on Dream Weaver template files any more and when ever a Graphic designer, (who does not care to know php) makes and update to the whole site the Zen cart does not get updated until a developer goes and cuts and pastes things in again.
    so this template program takes one file that has a
    HTML Code:
    <HTML>
    <head>
    </head>
    <body>
    <lay out top>
    <zen cart>
    <lay out foot>
    </body>
    </HTML>
    set up and does all the cutting for you it also will redirect their links/images to work in a sub directory, via the above regexps.

    I hope this is clear now what the bennifit is.
    I will post the code as soon as I have a the time to make and unbranded version.

    JOsh

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Easy embed template

    Looks like a PayPal site ... so what was gained here?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Re: Easy embed template

    that was just an example of a site that had a paypal site, the rest of the upgrade was all for your imagination. sole of the site running the old embed template are.
    llamafantics.com,
    moosepaws.com,
    delightsoftheearth.com,
    hsrc.biz
    cleverwares.com

    the list goes on

    JOsh

  6. #6
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: Easy embed template

    ##########################-

    Thank you for the excellent explanation, I get it now !!

    Sounds like a really nice addition. There are so many attractive eCommerce templates that currently cannot be used for Zencart. Hopefully this will enable us to give ZC a more updatred and unique look!

    Thank you again for the explanation. Also, will you not be releasing the pre-1.30 version?

    Betty

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Easy embed template

    You may wish to look into why your zenid is remaining on all pages ...

    That should really only be there on the first click and secure pages ... but not on every page ...

    Could just be a simple configuration issue on your session settings or something ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Re: Easy embed template

    Betty,
    I thank you that you get it. really, I fell bad for the most part when I post things in forums. my skill w/ communication in general is not very good (in know I am adding the Geek stereo-type)
    The reason that I am not realizing the pre 1.3 version is that I did no develop the fist version of the thing. I took it over from another developer who had gotten it from another developer. A lot of the code besides the regexps that is not there any more, was for all intents and purposes their's and w/ no way to contact them I did not want to give away their handy work.
    Also the firm it was developed for has this idea that taking Open Source and changing it (a tiny bit) makes it theirs. The new versions is more of and inspired version then a updated copy, and it's all mine to give away.
    BTW these reg exes work in almost any template setting. I have recycled them in Gallery 2 and Phorum.
    But I must confess the real reason behind making this version release public.
    I am in the future going to starting a project which I am thinking will be called Zen Cart on the Rails. in which I am going to be wrapping (and replacing in some cases) Zen cart in Ruby on the Rails controllers. That will be my new easy embed template. I hope that people can enjoy what I have doone here and uses it, and ultimately keep it going so that when need it again (for ver 1.4, on a non rails server) it is not be all dusty. yes I am useing opnen source for my onw selfish purposes.

    Linda, is that zen Id thing a ver1.2.x thing accross the board? beacuse all these sites are 1.2.x. the template mod would not affect the stock ZC sessions settings that they are running.

    Please forgive the rant it is late, I have had and over heated week and I guess one to many beers.

    JOsh

    PS. I may have time to release the next version for a week as I am on vacation next week, and am behind schedule due to (heat) illness.

  9. #9
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: Easy embed template

    Thank you again Josh for the added information.

    You communicate just fine! Could that be because I am a "geekette" and it reads good to me!

    Enjoy your vacation and feel better. I'm subscribed to this thread so will be anxiously awaiting updates once you get in your R&R time.

    Take Care,

    Betty

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Easy embed template

    When the zenid (session id) stays displayed throughout the site ...

    1 there is a server issue

    2 there is a configuration issue

    3 there is a combination of both

    The session id is ment to display in the least number of locations ...

    When it is contantly present, something is out of wack and needs to be fixed ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 1 of 37 12311 ... LastLast

Similar Threads

  1. Embed php template within another php template based on drop-down menu selection?
    By mcqueeneycoins in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 21 Jan 2012, 06:44 PM
  2. Embed cart button to old site is easy! if no atributes
    By medragon in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 9 Jun 2009, 06:21 AM
  3. How easy is it to install a zen-cart template?
    By ssbeats in forum Addon Templates
    Replies: 1
    Last Post: 22 Nov 2007, 09:43 PM

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