Post by inovateqsa » Wed Aug 12, 2015 8:46 pm

Hey All,

I'm looking to create a custom page for Opencart that can show search results for products, but without the top Menu that Opencart usually comes with. This mustn't affect the rest of my store, only this page must be different.

Basically I want to be able to have it show a list of products matching a search result, but without the rest of the fluff that shows on Opencart normally.

How would I go about accomplishing this?

I have attached an image of what ideally I'd like to do.

Attachments

Untitled.png

Untitled.png (278.4 KiB) Viewed 2950 times


New member

Posts

Joined
Wed Mar 19, 2014 8:22 pm

Post by Kenberne1965 » Wed Aug 12, 2015 9:39 pm

Sounds easy enough.... but sadly its quite a bit more complicated. Look for a tutorial on making a custom page in opencart.
then you`ll need to make a copy of your header.tpl and its controller & make your new page point to this header instead of the original one.

Your new header.tpl should include all the workable code, but not anything that is output to the screen.

the header.tpl has a lot more going on than just the visuals you see, so you cant just remove it.

hope that helps,

If in doubt ask a developer to do it ;)

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by inovateqsa » Wed Aug 12, 2015 9:45 pm

Wat would the code be to point to the new header be called?
Assume I'm calling the header 'customheader' - for example.

I know that most Opencart pages call the header in the template file with <?php echo $header; ?>, but what would I use to instead load the custom header?

I've been reading up on how to make a custom page and have made one successfully, but using a different header is something I have been struggling with.

New member

Posts

Joined
Wed Mar 19, 2014 8:22 pm

Post by Kenberne1965 » Wed Aug 12, 2015 9:55 pm

inovateqsa wrote:Wat would the code be to point to the new header be called?
Assume I'm calling the header 'customheader' - for example.

I know that most Opencart pages call the header in the template file with <?php echo $header; ?>, but what would I use to instead load the custom header?

I've been reading up on how to make a custom page and have made one successfully, but using a different header is something I have been struggling with.
near the bottom of your custom page, you`ll see something like the below code, this loads the controller for the header amongst other things, which in turn loads the header.tpl and places it in a variable called data['header'] which in your view file will be accessible from $header so make a copy of these two files, the controller and the view called say customHeader and change that in your custompage code to point to that controller

Code: Select all

$data['column_left'] = $this->load->controller('common/column_left');
		$data['column_right'] = $this->load->controller('common/column_right');
		$data['content_top'] = $this->load->controller('common/content_top');
		$data['content_bottom'] = $this->load->controller('common/content_bottom');
		$data['footer'] = $this->load->controller('common/footer');
		$data['header'] = $this->load->controller('common/header');
this is how all the code gets loaded into the variables that are accessed in the view.tpl file

Paul

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by inovateqsa » Wed Aug 12, 2015 10:16 pm

All right, I've now got the custom page setup with it's own header and templates, so it's just a matter of time to tweak it to my liking.

Thanks for everything guys!
*Well Technically, Thanks for everything "Kenberne1965".

New member

Posts

Joined
Wed Mar 19, 2014 8:22 pm

Post by Kenberne1965 » Wed Aug 12, 2015 10:38 pm

inovateqsa wrote: Thanks for everything guys!
:o
inovateqsa wrote: *Well Technically, Thanks for everything "Kenberne1965".
haha i`ll let you off ;)

No problem, glad you got it working

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by inovateqsa » Thu Aug 13, 2015 7:50 pm

Would anyone know how to remove the search criteria box "after a search is done"?
It's a bit of an eyesore at the moment.

An alternative is to remove the search bar entirely and place a link in the admin menu for the search (which sounds a little bit more complicated to me and may be beyond my current skills at least).

I should probably explain why I want such a simple page - I plan to use an iFrame to link the content to a forum I am setting up. I want the users to think that the product list is still part of the forum, and the Menu and other such clutter would break the illusion of being a part of the same page.

I can edit the styling to match that of the forum once the layout is as I want it.

Attachments

Untitled.jpg

Untitled.jpg (98.05 KiB) Viewed 2915 times


New member

Posts

Joined
Wed Mar 19, 2014 8:22 pm

Post by Kenberne1965 » Thu Aug 13, 2015 8:48 pm

Since they dont search on this page ie (there is no search box) i think you can either remove the relevant code by commenting it all out or wrap this content in a <div> with an id such as #hideMe

Code: Select all

<div id="hideMe"></div>
and then use jquery to hide that div on page load

Code: Select all

<script type="text/javascript">
  $(document).ready(function(){    
      $('#hideMe').hide();
    });
</script>
because this is a custom one off page, you don't really need to bother yourself with VQMod for the above changes
although this would be the way to do it if it was a normal opencart page.

Paul

Freelance Opencart 1.5.x and 2.x Developer - Available For Hire
Latest Opencart 2 Project --> http://www.falcon-rangecookers.co.uk


User avatar
Active Member

Posts

Joined
Wed Apr 22, 2015 9:37 pm
Location - Doncaster, UK

Post by inovateqsa » Thu Aug 13, 2015 9:56 pm

Thanks, I'll try that when I get the chance to.
In the meantime I've simply removed the search, and just manually type in the address myself.

New member

Posts

Joined
Wed Mar 19, 2014 8:22 pm
Who is online

Users browsing this forum: No registered users and 149 guests