Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / editing front shop page

editing front shop page

Locked

Views: 1,702

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
11 Feb 2010, 10:02 AM
#1
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

editing front shop page

I need to call an external script into the main page, what and where would I need to edit to to able to do this if I put the file in the root
directory of the zen cart installation. The script only needs to appear on the front page.

Any help would be great.
Thanks

11 Feb 2010, 2:13 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: editing front shop page

If to be displayed in the center of only the front page...
paste the code in the define_main_page.php file through the admin > tools > defines page editor

12 Feb 2010, 11:39 AM
#3
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: editing front shop page

thankyou that worked exactly as I needed.

Is there anyway I can change the query the search performs
as I do not need to search the description etc..

I have all the products we sell in the correct tables but
as the script I have written selects information from extra tables
and I want it to pass an id to the search.

Example

my own script has select options:
car manufacturer -> car model -> car description and year->

This will give an id for the exact car I then intend to pass this id
to the search so that it will pull out any products with a matching
id

12 Feb 2010, 1:22 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: editing front shop page

Sounds like your search issue will require a total re-write of the search function - - Way too much to be coered in a few posts here

You can write this or can post in the commercial help wanted section

12 Feb 2010, 1:44 PM
#5
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: editing front shop page

I just need to know which file contains the search function and I may be able to rewrite it myself.

12 Feb 2010, 1:59 PM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: editing front shop page

Suggest you use the template override system as one should not edit the corefiles
Start by getting a copy of /includes/templates/template_default/sideboxes/tpl_search.php

12 Feb 2010, 2:14 PM
#7
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: editing front shop page

I have located that file but it has no sql in it.

If this is basically going to be difficult or not recommended
would it be better for me to pull the products out from my own script
and try to add the add to cart button and quantity options to those.

This would remove the need for me to touch the core serach files
and I would remove the default search box from showing.

12 Feb 2010, 11:10 PM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: editing front shop page

I have located that file but it has no sql in it.
Others to check

/includes/classes/db/mysql/query_factory.php
/includes/modules/pages/advanced_search/jscript_main.php

If this is basically going to be difficult or not recommended
would it be better for me to pull the products out from my own script
and try to add the add to cart button and quantity options to those.
That would be even more difficult as ZenCart is not designed to be used in pieces

15 Feb 2010, 8:28 AM
#9
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: editing front shop page

I think I found the file that I may need to edit.

/includes/modules/pages/advanced_search_result/header_php.php

As it has all the error checking for the search form

I will make a backup of it before I start playing around with it.

15 Feb 2010, 9:07 AM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: editing front shop page

Is there anyway I can change the query the search performs
as I do not need to search the description etc..

As it has all the error checking for the search form
No sql either

But hopeful you are on a correct track for what you want

15 Feb 2010, 9:25 AM
#11
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: editing front shop page

I have also noticed that there is a hidden field called zendid that is passed through the search
form. Is this essential for anything and if so does anyone know how I could put this into may own form.

15 Feb 2010, 9:30 AM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: editing front shop page

Is this essential for anything and if so does anyone know how I could put this into may own form.
Use only if you need to control/track the users session ID with your action appended and an else

if (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '')
15 Feb 2010, 9:38 AM
#13
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: editing front shop page

No sql either

But hopeful you are on a correct track for what you want

I think its around line 304 of

/includes/modules/pages/advanced_search_result/header_php.php

If the zendid is not essential to the performance of the shopping cart
and does not hinder the ability for customers to add products
to their cart from the search results then I do not believe I would
need to add it to my own form.

15 Feb 2010, 4:29 PM
#14
neit avatar

neit

Zen Follower

Join Date:
Feb 2010
Posts:
140
Plugin Contributions:
0

Re: editing front shop page

Thankyou for the help kobra