Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2008
    Posts
    67
    Plugin Contributions
    0

    Default Help with php for customization of main page

    I would like to customize my define_main_page so that I can have 3 DIVs side to side. Each one would contain an individual product ie product title, image, price, description, attributes, and an add to cart button. The reason for this is that the store only has 3 products and it would be great to bypass most of the category structures etc. I have already turned off all the sideboxes so the store is already lean.

    My thoughts on how to accomplish this was to use the php from the product_info.php template page and drop it into each of the 3 DIV's and hard code the $GET [product ID] on each one. My php is a bit rusty since my last zen cart site I built was 3 years ago and so I'm not completely sure if this will work or what the proper syntax is. Anybody have any ideas or advice on how to make this work?

  2. #2
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Help with php for customization of main page

    You'd need to also think about the code in header_php.php and some other files to get that code to work directly. But it is obviously possible. It depends how much you want to hard code and how much you want to be changeable from admin.

    To be honest if you only have three products why not simply display them as featured products on the main page. This feature already exists. Then you are just altering the code for the featured box to include the bits that you want that are not already there.

    Also, if you really only have three products and are not going to have too many more in the future you could just copy and paste the html ( not the php ) from the source code of a product info page and put it into the home page ( edited as appropriate. I am probably going to get criticised for saying that but - hey ho , the thing is that a simple site should be simple so perhaps you don't need the huge configurabiltiy that Zen offers.

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

    Default Re: Help with php for customization of main page

    You can get all of your products displaying on the homepage by setting in Configuration > Layout Settings >
    Categories - Always Show on Main Page -->set to 1
    Main Page - Opens with Category -->set to 0

    To have the attributes etc. there, you could use rbarbour's "quick look" mod which he has been developing - look in the forum. I don't know if he has it ready for others to use yet, but I think he will be helpful.

  4. #4
    Join Date
    Jan 2008
    Posts
    67
    Plugin Contributions
    0

    Default Re: Help with php for customization of main page

    The featured products uses a tabbed layout which I don't like for this purpose, I want distinct divs so I can easily change them via css, plus I didn't want to change a feature that may be used in the future. I also considered coding directly in HTML but thought I remembered a reason why not to do it? Also although only 3 products now we will expand in the future and like the backside of zen cart with the newsletter feature and downloadable attributes and such.

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

    Default Re: Help with php for customization of main page

    Then my suggestion will do the job you want.

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

    Default Re: Help with php for customization of main page

    I would code it in HTML in define_main_page.

    I'm not sure what you mean by a 'tabbed layout', though. I've seen sites with few products use the Featured Products section.

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

    Default Re: Help with php for customization of main page

    Putting the HTML in define_main_page.php would probably be the easiest way to start. You could develop the dynamic setup at your leisure while you get the site up and running now.

  8. #8
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Help with php for customization of main page

    I also considered coding directly in HTML but thought I remembered a reason why not to do it?
    Hmmm, well there are arguments against it for sure but there are also arguments for it in certain circumstances. You loose adaptabiltiy but gain speed and simplicity. It seems popular to think that everything has to be a 'mod'. I am not sure that I see it that way. If you have a block of html that you want output then the most effective way of doing that is in html.

    As stevesh says put the html in the define pages, or alternatively put it in the template. Just because Zen is php based doesn't mean that you have to put everything through the processing grinder.

 

 

Similar Threads

  1. v139h Help with this code for Main Page please
    By traytray in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 7 Jun 2013, 08:09 AM
  2. How to properly implement jscript_*.php file for main page?
    By webwiz in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Oct 2009, 01:49 AM
  3. Replies: 1
    Last Post: 17 Oct 2009, 11:50 PM
  4. php error message for my checkout success page that I need help with
    By Markp001 in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 5 Jul 2009, 07:53 PM
  5. Question about main page product customization
    By kgmack in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Apr 2007, 08:14 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