Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to modify Information infobox....


Panzerguy

Recommended Posts

Posted

I would like to modify the Information infobox to create a new infobox called Quicklinks. In this infobox I would like to have the information (eg. shipping, returns, privacy, etc) contained in a dropdown box within the infobox.

 

The following two screen shots illustrate what it is I want to achieve:

 

linkbox1.gif

 

And with the info dropped down...

 

linkbox2.gif

 

I would appreciate any assistance offered in helping me achieve this. I have very limited HTML skills and not a lot of php experience. I have searched exisiting contribs and not found anything that with my meagre skills I could adapt.

 

Thanks in anticipation of some help.

 

Pete

Posted

If I knew what I was doing it might help....Thanks for the tip John but I'm hoping someone here has done a similar thing and might be able to provide some code to simply cut & paste

 

Thanks again.

 

Pete

Posted

to make it as a dropdown should not be the problem...

if i customer would select it, it would take the customer to that page!

making it searchable it would not be as easy!

 

so...

 

#1 simple dropdown and take the customer to the page

or

#2 make it searchable???

 

greetz john

Posted
#1 simple dropdown and take the customer to the page

or

#2 make it searchable???

 

 

John,

 

I just want a simple dropdown that essentially contains linnks to the various info pages. You help is much appreciated.

 

Pete

Posted

You could try something like this?

 

$info_box_contents = array();

$info_box_contents[] = array('text' => '<FORM METHOD="get" NAME="CustomerService"> <select name="CustomerService" onChange="this.form.submit();">

<option value="">Select an option..</option>

<option value="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</option>

<option value="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</option>

<option value="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</option>

<option value="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</option> 

</select>

</form> ');

 

  new infoBox($info_box_contents);

 

And just pop that into your information infobox file

 

Jane.

Posted

Thanks Jane.

 

I tried the code you posted and it worked..sort of. The text above the dropdown, which I assume you have labelled as "Customer Service" does not appear.

 

Also, I tried pasting the code into search.php above the original search box and the new dropdown box is contained within a box within the infobox. I assume it is because I pasted

new infoBox($info_box_contents);
into the file so it appears twice. If I remove it however the new dropdown box does not appear?

 

I am essentially clueless to sort this so any help you can offer is greatly appreciated.

 

Pete

Posted

Sorry to bump this but I really need some help. Any assitance would be greatly appreciated. Thanks.

 

Pete

Posted

This should create an infobox similar to the one that you have there with the quicklinks in it.

 

The >> can be replaced easily with an image.

The links for the top are easily changed, I've just left them as some of the default links from the information box.

The customer service dropdown will go to the page automatically once selected.

In the search part, the search button will have to be pressed to go to either the category or keyword or both.

 

Just save it as quicklinks.php and then add

require(DIR_WS_BOXES . 'quicklinks.php');

into whichever colum you want it in.

 

 

<?php

/*

  $Id: quicklinks.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

*/

?>

<!-- quicklinks //-->

          <tr>

            <td>

<?php

  $info_box_contents = array();

  $info_box_contents[] = array('text' => 'Quick Links!');

 

  new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

  $info_box_contents[] = array('text' => '>> <a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . 'A link to somewhere!' . '</a><br>' .

      '>> <a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . 'A link elsewhere' . '</a><br>' .

      '>> <a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">' . 'Somewhere else again' . '</a><br>');

 

  new infoBox($info_box_contents);

 

  $info_box_contents = array();

$info_box_contents[] = array('text' => 'Customer Service<br><FORM METHOD="get" NAME="CustomerService"> <select name="CustomerService" onChange="this.form.submit();">

<option value="">Select an option..</option>

<option value="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</option>

<option value="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</option>

<option value="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</option>

<option value="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</option> 

</select>

</form> ');

 

  new infoBox($info_box_contents);

 

$info_box_contents = array();

  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),

                              'text' => '<table border="0" width="100%" cellspacing="0" cellpadding="1"><tr><td class="infoBoxContents" valign="top">Search by Category</td></tr><tr><td class="infoBoxContents" valign="top">' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => 'Select Category')))) . '</td></tr><tr><td class="infoBoxContents" valign="top">Or Search by Keyword</td></tr><tr><td class="infoBoxContents" valign="top">' . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="15" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . '  ' . tep_image_submit('button_quick_find.gif', 'Search!') . '</td></tr></table>');

 

  new infoBox($info_box_contents);

 

 

?>

            </td>

          </tr>

<!-- quicklinks_eof //-->

 

I hope this is ok!

Jane

Posted

hey, not sure if you noticed this but i checked out your website to see if this worked and that infobox is flipping out :blink:

 

when the page is trying to load it's having alot of trouble loading that box

 

Christina

Posted

Actually, wait a minute.

 

Everything else works but the customer service drop down box. Lemme have a look-see if I can work out what the issue is, I'm sure I had it working, I must've made a hiccup somewhere.

 

I'm not a coder, just a tinkerer.

Posted

yeah! I've been testing out the code on it. I've managed to make it chuck a hissy fit.

 

I'm making my way through it though and as soon as I sort it out, I'll post the amended code.

 

hey, not sure if you noticed this but i checked out your website to see if this worked and that infobox is flipping out  :blink:

 

when the page is trying to load it's having alot of trouble loading that box

 

Christina

Posted
yeah!  I've been testing out the code on it. I've managed to make it chuck a hissy fit.

 

I'm making my way through it though and as soon as I sort it out, I'll post the amended code.

 

actually, i don't have a link to your site, i was talking about Panzerguy's site.

 

but if you are using the same code, it's probably doing the same thing :P

Christina

Posted

*slaps forehead* :blush:

 

actually, i don't have a link to your site, i was talking about Panzerguy's site.

 

but if you are using the same code, it's probably doing the same thing :P

Christina

Posted

I got it! Huzzah!

 

New Infobox code:

 

<?php

/*

  $Id: quicklinks.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright ? 2003 osCommerce

 

  Released under the GNU General Public License

*/

?>

<!-- quicklinks //-->

          <tr>

            <td>

<?php

  $info_box_contents = array();

  $info_box_contents[] = array('text' => 'Quick Links!');

 

  new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

  $info_box_contents[] = array('text' => '>> <a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . 'A link to somewhere!' . '</a><br>' .

      '>> <a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . 'A link elsewhere' . '</a><br>' .

      '>> <a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">' . 'Somewhere else again' . '</a><br>');

 

  new infoBox($info_box_contents);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => 'Customer Service<br><FORM METHOD="get" NAME="CustomerService"> <select onchange="if (this.selectedIndex > 0) location.href=this[this.selectedIndex].value;">

  <option selected="selected">Select an option...</option>

<option value="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</option>

<option value="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</option>

<option value="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</option>

<option value="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</option>

</select></form>');

 

  new infoBox($info_box_contents);

 

 

$info_box_contents = array();

  $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),

                              'text' => '<table border="0" width="100%" cellspacing="0" cellpadding="1"><tr><td class="infoBoxContents" valign="top">Search in Category</td></tr><tr><td class="infoBoxContents" valign="top">' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => 'Select Category')))) . '</td></tr><tr><td class="infoBoxContents" valign="top"> For Keywords</td></tr><tr><td class="infoBoxContents" valign="top">' . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="15" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . '  ' . tep_image_submit('button_quick_find.gif', 'Search!') . '</td></tr></table>');

 

  new infoBox($info_box_contents);

 

 

?>

            </td>

          </tr>

<!-- quicklinks_eof //-->

Posted

Jane,

 

Firstly, thanks for the effort you have gone to for me to get this thing working! I really appreciate it.

 

Now, I have got a quicklinks box on my site (BTW the link in my profile is a disused test site...I will hopefully unveil my new site in the new year)

 

quicklink.gif

 

Is it possible to get rid of the horizontal lines separating the 3 elements? This is the same problem I was having with the first lot of code. I wasn't able to get the new dropdowns to display unless I had

new infoBox($info_box_contents);
after each element but this then seemed to cause the horizontal lines?

 

Once again thanks. If you get a chance to look at the line issue (or it may be something really simple I can fix?) let me know.

 

Pete

Posted

Hey Pete,

 

I think those lines are to do with the stylesheet settings - putting that light green border around the infoboxes.

The easiest way to get rid of them, is to just sort of stack everything together into the one infobox array.

 

So, you can replace the three separate calls for the new infobox's with just this one:

 

$info_box_contents = array();

  $info_box_contents[] = array('text' => '>> <a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . 'A link to somewhere!' . '</a><br>' .

      '>> <a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . 'A link elsewhere' . '</a><br>' .

      '>> <a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">' . 'Somewhere else again' . '</a><br><br>

 

Customer Service<br><FORM METHOD="get" NAME="CustomerService"> <select onchange="if (this.selectedIndex > 0) location.href=this[this.selectedIndex].value;">

  <option selected="selected">Select an option...</option>

<option value="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</option>

<option value="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</option>

<option value="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</option>

<option value="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</option>

</select></form><br><br>'

 

. tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . '<table border="0" width="100%" cellspacing="0" cellpadding="1"><tr><td class="infoBoxContents" valign="top">Search in Category</td></tr><tr><td class="infoBoxContents" valign="top">' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => 'Select Category')))) . '</td></tr><tr><td class="infoBoxContents" valign="top">For Keyword(s)</td></tr><tr><td class="infoBoxContents" valign="top">' . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="15" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . '  ' . tep_image_submit('button_quick_find.gif', 'Search!') . '</td></tr></table>');

 

  new infoBox($info_box_contents);

 

I'm glad I could help!

Jane

Posted

Actually, I don't have it up on my site.. I was just fiddling with it for Pete and uploading it so I could see if it worked or not.

 

could i have a link to your site to see it in action?

Thanks :)

Christina

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...