Post by mikki » Sat Nov 08, 2008 12:14 am

Is is possible to have php code in an information page (using code edit). I don't think it's working.

Basically i set up a new info page for "new/latest products".

Here is what i'm pretty sure is the code that shows the most recently added products.






  ">" title="" alt="" />
">




Now, ideally i could just paste that in the code edit for the info page and it would work. However I doesn't like it and if you go back into the edit screen it's removed the code. Do i need to page a seperate "real" page for it or is there a simple work around?

New member

Posts

Joined
Mon May 19, 2008 11:01 pm

Post by Qphoria » Sat Nov 08, 2008 12:22 am

Well, the issue is more than just that.

You can't really get product information from the information page because you don't have all the constructs and classes set up. Information page knows nothing about $products or anything like that.

I do like the idea of where you are going with that, however, it can't be done as simply as you are trying to make it.
This is something we could look into tho.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mikki » Sat Nov 08, 2008 12:48 am

Can a make a seperate page with just the latest products on it then? I mean the layout.tpl file is just a PHP file and I skinned that by basically finding out what bits of PHP call which information and then moving them around to where I wanted them displayed. That's the php from the layout file that would show the latest products. I just don't want it on the main page :]

New member

Posts

Joined
Mon May 19, 2008 11:01 pm

Post by Qphoria » Sat Nov 08, 2008 1:05 am

Here's what you can do.

1. Clone the home page files:
- /catalog/controller/home.php
- /catalog/language/english/controller/home.php
- /catalog/template/default/content/home.tpl

2. Rename them to new_products

3. Edit /catalog/template/default/content/home.tpl file and put just what you want in there with normal hardcoded html. Unless you want something else like categories or something listed on that page instead.

4. Now decide where you want to put the "New Products" link.
- header bar?
- category sidebox?
- information sidebox?

5. Edit that particular extension and add the link there:
New Products


Now home will be something else and new products will have all the stuff on home.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by bruce » Sat Nov 08, 2008 6:55 am

or you could use the Latest/Featured/Specials contribution.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Qphoria » Sat Nov 08, 2008 7:07 am

heh. teach a man to fish and he'll eat for a lifetime ;D

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Wed Dec 03, 2008 12:23 am

The feature/latest/specials adds those items to the homepage if I'm understanding how it works. I think our friend here wants a separate page with just the latest products on it.

But using that contrib, he could probably take the latest product code out of it and put it into a separate controller & template

That would be the best place to start

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mikki » Wed Dec 03, 2008 12:29 am

I've had a fiddle and nothing is quite working. I looked at the "feaured Prodcut" addon, but it still seems to an extra peice of code rather than a new "page".

I think what I need to do it just have a new blank controller. controller=contact is a controller which just has some content in it (ie: a contact form). I just need a new one that I can paste the original latlest products code into.

Soooo. How do i go about that. I tried just duplicating an existing one, but I think there must be a file that identifys existing controllers.

New member

Posts

Joined
Mon May 19, 2008 11:01 pm

Post by jty » Wed Dec 03, 2008 5:34 am

Does this thread help
See Q's post on October 15 for how to create a module

http://forum.opencart.com/index.php/topic,2033.0.html

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by mikki » Fri Dec 05, 2008 12:54 am

Unfortunatley a module doesn't help because it can't be linked by a URL as a sperate page (only code in the existing framework).

What I need is a new controller that I can add my own content too.

New member

Posts

Joined
Mon May 19, 2008 11:01 pm

Post by Qphoria » Fri Dec 05, 2008 1:17 am

my original post in this thread should still apply:

http://forum.opencart.com/index.php/top ... l#msg10932

You just need to figure out the sql for "latest products" and display that on your new page

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 3 guests