Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2012
    Location
    LJubljana
    Posts
    14
    Plugin Contributions
    0

    Idea or Suggestion EZ Page display from php code

    Dear Sirs and Madams!

    URGENT

    Can someone tell me please, how to show the contents of some newly created ez page, created from admin section of zen cart, from php code. Here is my situation clarified: I have two ez pages, which display must be enabled/disabled from checkbox entry in custom module (configuration module for these two ez pages). Let's say display ez pages check box is enabled and this flag is saved into some custom table in database. Now, the user starts to browse products on our webshop and once he/she clicks some product category, ez page (instead of subcategories) must be shown in browser. How do I achieve that?

    URGENT

    I am zen cart newbie and I politly ask for some patience with potentialy dumb question.

    Sincerely,
    Marko

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

    Default Re: [URGENT]EZ Page display from php code[URGENT]

    Since EZ pages content is stored in the database, it isn't as easy as placing your code in t page. Maybe an option here:

    http://www.zen-cart.com/showthread.p...EZ-Page-In-PHP

  3. #3
    Join Date
    Jun 2012
    Location
    LJubljana
    Posts
    14
    Plugin Contributions
    0

    Default Re: [URGENT]EZ Page display from php code[URGENT]

    Thank you for your quick reply, but I think my question was posted in some unclear way. I am aware of problem you mentioned, but before this problem, I need to solve showing ez page (with just text inside it, nothing more) FROM custom php script programmatically. How do I achieve that?

    Sincerely,
    Marko

  4. #4
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: EZ Page display from php code

    Quote Originally Posted by MarkoSiroki View Post
    Now, the user starts to browse products on our webshop and once he/she clicks some product category, ez page (instead of subcategories) must be shown in browser. How do I achieve that?
    You said you want to display an ezpage instead of the category. So just add some custom code to redirect the customer to index.php?main_page=page&id=XX where XX is the ezpage number.

    Without knowing EXACTLY what you want to do and WHY, it's very difficult to give you a specific exact answer. Please supply specific examples and URLs and explain the business problem you're trying to solve.
    .

    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.

  5. #5
    Join Date
    Jun 2012
    Location
    LJubljana
    Posts
    14
    Plugin Contributions
    0

    Default Re: EZ Page display from php code

    Ok, let's say we have main page with categories visible on left side of this main page (named "PAGE_MAIN") with three categories (CATEGORY A with 5 subcategories, CATEGORY B with 2 subcategories and CATEGORY C with 7 subcategories). In the backoffice (admin area) there has been EZ page created, named "EZ_PAGE_A". I want to create php script, which will redirect click on CATEGORY_B from showing subcategories (default behaviour) to EZ_PAGE_A, if EZ_PAGE_A_ENABLE bit is set in custom table, added to zen cart database. How do I achieve that?

    Sincerely,
    Marko

  6. #6
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: EZ Page display from php code

    Isn't that what I said in my last post? You just want to make a category invisible to the user, and instead display an ezpage.

    Simply write your custom code in the /includes/modules/pages/index/header_php.php to redirect to the desired ezpage when the specified cPath is selected.
    No need to use a special script to extract ezpage data without headers and footers etc.
    .

    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
    Jun 2012
    Location
    LJubljana
    Posts
    14
    Plugin Contributions
    0

    Default Re: EZ Page display from php code

    Ok, I've digged into php and how do I get currently selected category?

  8. #8
    Join Date
    Jun 2009
    Location
    Orange County, California
    Posts
    544
    Plugin Contributions
    18

    Default Re: EZ Page display from php code

    For anyone else that may stumble upon this thread looking for the same thing; simply add this PHP code wherever you want that EZpage content to show up:

    Code:
    <?php $var_pageDetails = $db->Execute("select * from " . TABLE_EZPAGES . " where pages_id = 2");
    echo $var_pageDetails->fields['pages_html_text']; ?>
    Replace the number 2 with whatever EZpage ID you want (eg. where pages_id = 4")

 

 

Similar Threads

  1. Replies: 2
    Last Post: 30 May 2016, 01:28 PM
  2. v154 PHP Code to display customers email on checkout_success
    By botanybros in forum General Questions
    Replies: 2
    Last Post: 12 Nov 2015, 03:24 PM
  3. Display EZ-Pages from a page other than index.php?
    By alin in forum General Questions
    Replies: 5
    Last Post: 8 Sep 2011, 04:30 AM
  4. Display the text from define_page_2.php on every page
    By buxton1 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 22 Dec 2010, 12:14 PM
  5. PHP code to display Store Name
    By artcoder in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 11 Mar 2009, 06:43 AM

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