Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Show advanced search in centerbox frontpage?

Show advanced search in centerbox frontpage?

Locked

Views: 2,458

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
10 Sep 2010, 1:48 AM
#1
joshuabaer23 avatar

joshuabaer23

New Zenner

Join Date:
Aug 2010
Posts:
34
Plugin Contributions:
0

Show advanced search in centerbox frontpage?

Does anyone know the code aI can use to display the advanced search box in the center box for the home page?
I used this, but I just get a link. I want the actual "advanced search box" on the center box of home, and not in the sidebox.
<a href="<?php echo zen_href_link(FILENAME_ADVANCED_SEARCH); ?>"><?php echo HEADER_TITLE_SEARCH; ?></a>

10 Sep 2010, 6:52 PM
#2
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,794
Plugin Contributions:
22

Re: Show advanced search in centerbox frontpage?

This is a confusing question... Can you explain again what you want, this is a bit hard to understand... Or, even better, create a simple image to demonstrate what you want.

10 Sep 2010, 10:33 PM
#3
joshuabaer23 avatar

joshuabaer23

New Zenner

Join Date:
Aug 2010
Posts:
34
Plugin Contributions:
0

Re: Show advanced search in centerbox frontpage?

balihr:

This is a confusing question... Can you explain again what you want, this is a bit hard to understand... Or, even better, create a simple image to demonstrate what you want.

Ok, here is a link to my home page. I have some images and info in the center box, generally layed out as fill for now.
http://erepaircenter.com/

Here is my search page. I plan on customizing the look of the search box, then some how, embed it in to the center column of the home page, so it will be one of the first things people see when they come to the site. Probably by simply placing the proper code within the define_main_page.php. I need to know WHAT the code is, that would call it properly.

Here is an example of what I want.
I appreciate the attention you have given this matter.

11 Sep 2010, 5:13 AM
#4
kobra avatar

kobra

Black Belt

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

Re: Show advanced search in centerbox frontpage?

Probably by simply placing the proper code within the define_main_page.php
Not sure that you can include php code in that file...

11 Sep 2010, 6:13 AM
#5
joshuabaer23 avatar

joshuabaer23

New Zenner

Join Date:
Aug 2010
Posts:
34
Plugin Contributions:
0

Re: Show advanced search in centerbox frontpage?

kobra:

Not sure that you can include php code in that file...
Dang.
I tried all the functions I could figure, and since I have seen little on this, I am going to suppose that you are correct.

I went with a big search button linked to the search page.
Thanks for the tip.:cry:

11 Sep 2010, 6:19 AM
#6
kobra avatar

kobra

Black Belt

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

Re: Show advanced search in centerbox frontpage?

In a copy of ipl_header.php insert a NEW NAMED div before the define main page call and insert your image and the search code there( might relocate the header search into this div)

Name the div uniquely so one can add styling in the stylesheet if needed

11 Sep 2010, 6:47 AM
#7
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,794
Plugin Contributions:
22

Re: Show advanced search in centerbox frontpage?

OK... I can't access your site, it asks for username and password so, if i click cancel a few times, i get the site without css...

I'm still not sure about what you're trying to do. Kobra confused me a bit mentioning tpl_header so...

I attached a screenshot - if I understand correctly, that's what you want to do. If so, let me know and I'll post the procedure.

EDIT: image is very small so i added one on tinypic

11 Sep 2010, 7:00 AM
#8
kobra avatar

kobra

Black Belt

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

Re: Show advanced search in centerbox frontpage?

OPPS!:oops:

Meant tpl_main_page.php....

11 Sep 2010, 7:04 AM
#9
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,794
Plugin Contributions:
22

Re: Show advanced search in centerbox frontpage?

kobra:

OPPS!:oops:

Meant tpl_main_page.php....

Well, I believe we can pardon you this time, but don't let it happen again! :D

11 Sep 2010, 8:33 AM
#10
joshuabaer23 avatar

joshuabaer23

New Zenner

Join Date:
Aug 2010
Posts:
34
Plugin Contributions:
0

Re: Show advanced search in centerbox frontpage?

balihr:

Well, I believe we can pardon you this time, but don't let it happen again! :D

Sorry, forgot the site was in maintenance mode.
The screen shot is exactly what I am looking to do. Please O please, show me your magic!:lamo:

11 Sep 2010, 9:02 AM
#11
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,794
Plugin Contributions:
22

Re: Show advanced search in centerbox frontpage?

OK, well, what i did is extremely simple.

Go to your includes/templates/apple_zen/templates folder and open tpl_index_default.php

Add this piece of code anywhere you want it displayed:

<div id="advSearchDefault">

<?php echo zen_draw_form('advanced_search', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onsubmit="return check_form(this);"') . zen_hide_session_id(); ?>
<?php echo zen_draw_hidden_field('main_page', FILENAME_ADVANCED_SEARCH_RESULT); ?>

<?php if ($messageStack->size('search') > 0) echo $messageStack->output('search'); ?>

<fieldset>
<legend><?php echo HEADING_SEARCH_CRITERIA; ?></legend>
<div class="forward"><?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_SEARCH_HELP) . '\')">' . TEXT_SEARCH_HELP_LINK . '</a>'; ?></div>
<br class="clearBoth" />
    <div class="centeredContent"><?php echo zen_draw_input_field('keyword', $sData['keyword'], 'onfocus="RemoveFormatString(this, \'' . KEYWORD_FORMAT_STRING . '\')"'); ?>   <?php echo zen_draw_checkbox_field('search_in_description', '1', $sData['search_in_description'], 'id="search-in-description"'); ?><label class="checkboxLabel" for="search-in-description"><?php echo TEXT_SEARCH_IN_DESCRIPTION; ?></label></div>
<br class="clearBoth" />
</fieldset>

<fieldset class="floatingBox back">
    <legend><?php echo ENTRY_CATEGORIES; ?></legend>
    <div class="floatLeft"><?php echo zen_draw_pull_down_menu('categories_id', zen_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)), '0' ,'', '1'), $sData['categories_id']); ?></div>
<?php echo zen_draw_checkbox_field('inc_subcat', '1', $sData['inc_subcat'], 'id="inc-subcat"'); ?><label class="checkboxLabel" for="inc-subcat"><?php echo ENTRY_INCLUDE_SUBCATEGORIES; ?></label>
<br class="clearBoth" />
</fieldset>

<fieldset class="floatingBox forward">
    <legend><?php echo ENTRY_MANUFACTURERS; ?></legend>
    <?php echo zen_draw_pull_down_menu('manufacturers_id', zen_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)), PRODUCTS_MANUFACTURERS_STATUS), $sData['manufacturers_id']); ?>
<br class="clearBoth" />
</fieldset>
<br class="clearBoth" />

<fieldset class="floatingBox back">
<legend><?php echo ENTRY_PRICE_RANGE; ?></legend>
<fieldset class="floatLeft">
    <legend><?php echo ENTRY_PRICE_FROM; ?></legend>
    <?php echo zen_draw_input_field('pfrom', $sData['pfrom']); ?>
</fieldset>
<fieldset class="floatLeft">
    <legend><?php echo ENTRY_PRICE_TO; ?></legend>
    <?php echo zen_draw_input_field('pto', $sData['pto']); ?>
</fieldset>
</fieldset>

<fieldset class="floatingBox forward">
<legend><?php echo ENTRY_DATE_RANGE; ?></legend>
<fieldset class="floatLeft">
    <legend><?php echo ENTRY_DATE_FROM; ?></legend>
    <?php echo zen_draw_input_field('dfrom', $sData['dfrom'], 'onfocus="RemoveFormatString(this, \'' . DOB_FORMAT_STRING . '\')"'); ?>
</fieldset>
<fieldset class="floatLeft">
    <legend><?php echo ENTRY_DATE_TO; ?></legend>
    <?php echo zen_draw_input_field('dto', $sData['dto'], 'onfocus="RemoveFormatString(this, \'' . DOB_FORMAT_STRING . '\')"'); ?>
</fieldset>
</fieldset>
<br class="clearBoth" />


<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEARCH, BUTTON_SEARCH_ALT); ?></div>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>

</form>
</div>

I placed it right before ```

<?php if (SHOW_CUSTOMER_GREETING == 1) { ?>

Now, you can remove some of the fields if you like, but be careful so you don't mess up the code.

Have fun!
11 Sep 2010, 9:05 AM
#12
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,794
Plugin Contributions:
22

Re: Show advanced search in centerbox frontpage?

Oh, I'm so sorry, i forgot...

Next, open your includes/languages/english.php and add this anywhere with the other defines:

  define('NAVBAR_TITLE_1', 'Advanced Search');
  define('NAVBAR_TITLE_2', 'Search Results');

  define('HEADING_TITLE_1', 'Advanced Search');
  define('HEADING_TITLE_2', 'Products meeting the search criteria');

  define('HEADING_SEARCH_CRITERIA', 'Choose Your Search Terms');

  define('TEXT_SEARCH_IN_DESCRIPTION', 'Search In Product Descriptions');
  define('ENTRY_CATEGORIES', 'Limit to Category:');
  define('ENTRY_INCLUDE_SUBCATEGORIES', 'Include Subcategories');
  define('ENTRY_MANUFACTURERS', 'Limit to Manufacturer');
define('ENTRY_PRICE_RANGE', 'Search by Price Range');
  define('ENTRY_PRICE_FROM', 'Price From:');
  define('ENTRY_PRICE_TO', 'Price To:');
define('ENTRY_DATE_RANGE', 'Search by Date Added');
  define('ENTRY_DATE_FROM', 'Date From:');
  define('ENTRY_DATE_TO', 'Date To:');

  define('TEXT_SEARCH_HELP_LINK', 'Search Help [?]');

  define('TEXT_ALL_CATEGORIES', 'All Categories');
  define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

  define('TABLE_HEADING_IMAGE', '');
  define('TABLE_HEADING_MODEL', 'Model');
  define('TABLE_HEADING_PRODUCTS', 'Product Name');
  define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
  define('TABLE_HEADING_QUANTITY', 'Quantity');
  define('TABLE_HEADING_PRICE', 'Price');
  define('TABLE_HEADING_WEIGHT', 'Weight');
  define('TABLE_HEADING_BUY_NOW', 'Buy Now');

  define('TEXT_NO_PRODUCTS', 'There is no product that matches the search criteria.');
  define('KEYWORD_FORMAT_STRING', 'keywords');
  define('ERROR_AT_LEAST_ONE_INPUT', 'At least one of the fields in the search form must be entered.');
  define('ERROR_INVALID_FROM_DATE', 'Invalid From Date.');
  define('ERROR_INVALID_TO_DATE', 'Invalid To Date.');
  define('ERROR_TO_DATE_LESS_THAN_FROM_DATE', 'To Date must be greater than or equal to From Date.');
  define('ERROR_PRICE_FROM_MUST_BE_NUM', 'Price From must be a number.');
  define('ERROR_PRICE_TO_MUST_BE_NUM', 'Price To must be a number.');
  define('ERROR_PRICE_TO_LESS_THAN_PRICE_FROM', 'Price To must be greater than or equal to Price From.');
  define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');

If you're using a language override file, then go to your includes/languages/apple_zen/english.php and do the step above.

13 Sep 2010, 5:13 AM
#13
joshuabaer23 avatar

joshuabaer23

New Zenner

Join Date:
Aug 2010
Posts:
34
Plugin Contributions:
0

Re: Show advanced search in centerbox frontpage?

balihr:

Oh, I'm so sorry, i forgot...

Next, open your includes/languages/english.php and add this anywhere with the other defines:

define('NAVBAR_TITLE_1', 'Advanced Search');
define('NAVBAR_TITLE_2', 'Search Results');

define('HEADING_TITLE_1', 'Advanced Search');
define('HEADING_TITLE_2', 'Products meeting the search criteria');

define('HEADING_SEARCH_CRITERIA', 'Choose Your Search Terms');

define('TEXT_SEARCH_IN_DESCRIPTION', 'Search In Product Descriptions');
define('ENTRY_CATEGORIES', 'Limit to Category:');
define('ENTRY_INCLUDE_SUBCATEGORIES', 'Include Subcategories');
define('ENTRY_MANUFACTURERS', 'Limit to Manufacturer');
define('ENTRY_PRICE_RANGE', 'Search by Price Range');
define('ENTRY_PRICE_FROM', 'Price From:');
define('ENTRY_PRICE_TO', 'Price To:');
define('ENTRY_DATE_RANGE', 'Search by Date Added');
define('ENTRY_DATE_FROM', 'Date From:');
define('ENTRY_DATE_TO', 'Date To:');

define('TEXT_SEARCH_HELP_LINK', 'Search Help [?]');

define('TEXT_ALL_CATEGORIES', 'All Categories');
define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');

define('TABLE_HEADING_IMAGE', '');
define('TABLE_HEADING_MODEL', 'Model');
define('TABLE_HEADING_PRODUCTS', 'Product Name');
define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
define('TABLE_HEADING_QUANTITY', 'Quantity');
define('TABLE_HEADING_PRICE', 'Price');
define('TABLE_HEADING_WEIGHT', 'Weight');
define('TABLE_HEADING_BUY_NOW', 'Buy Now');

define('TEXT_NO_PRODUCTS', 'There is no product that matches the search criteria.');
define('KEYWORD_FORMAT_STRING', 'keywords');
define('ERROR_AT_LEAST_ONE_INPUT', 'At least one of the fields in the search form must be entered.');
define('ERROR_INVALID_FROM_DATE', 'Invalid From Date.');
define('ERROR_INVALID_TO_DATE', 'Invalid To Date.');
define('ERROR_TO_DATE_LESS_THAN_FROM_DATE', 'To Date must be greater than or equal to From Date.');
define('ERROR_PRICE_FROM_MUST_BE_NUM', 'Price From must be a number.');
define('ERROR_PRICE_TO_MUST_BE_NUM', 'Price To must be a number.');
define('ERROR_PRICE_TO_LESS_THAN_PRICE_FROM', 'Price To must be greater than or equal to Price From.');
define('ERROR_INVALID_KEYWORDS', 'Invalid keywords.');

> 
> If you're using a language override file, then go to your includes/languages/apple_zen/english.php and do the step above.
Score. This worked. I didnt have the index default file, but I figured it out. Now I just need to preety it up some, and I am good. Thanks for the help.:smartalec: