Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Dropdownmenu


euskopc

Recommended Posts

  • Replies 248
  • Created
  • Last Reply

Top Posters In This Topic

Hello to all, there is a typo error in the demo url link. The correct url is:

http://members.lycos.co.uk/oscmenu/index.php

 

I think that there are a lot of things that could be better in the dropdownmenu contribution, please tell here your opinion, what is correct, incorrect, what need changes and new functions that can increment the "value" of the contribution.

 

I'll try to answer all your questions.

Link to comment
Share on other sites

contribution needs some work, firstly seems like a lot of code and files to accomplish this ( just my ignorant opinion).

 

The main issue i found was that i could not simply browse a categorie, eg: clicking on a main categorie would just reload the home page. ( at this stage i only have the javascript on index.php?)

 

Anyways i like the concept, maybe someone with more coding skill than me can help..

Link to comment
Share on other sites

There is an improtant bug, the javascript detection method disables the correct use of the web, click to product to view the description and see what happens :huh:

 

I have passed a lot of time trying to repair the bug but I dont know how to repair, another javascript detection?

 

Please HELP!!

Link to comment
Share on other sites

Onliner, this is the bug that I comment now. It seems that the javascript detection make the page autoreload if javascript is present and the rest of information gets lost, for example: if I click in categorie name the correct link is:

http://www.yourserver.com/catalog/index.php?cPath=1

 

But in order than add another information the page reloads with this info: http://www.yourserver.com/catalog/index.php?javascript=1 the correct url should be this: http://www.yourserver.com/catalog/index.ph...=1&javascript=1

 

The code that produces the errors is:

 

<?php
$javascript="";
$javascript = $_GET['javascript'];

if ($javascript=="")
  {
  $javascript="0";
?>
   <form name="js_habilitado"  method="get">
   <input type="hidden" name="javascript" value="1">
   </form>
   <script><!--

document.js_habilitado.submit();

   //-->
   </script>
<?php
   }
?>

 

Any ideas?

Link to comment
Share on other sites

This code repair the bug but disable the history back (back button) with the reloads. This is only a patch, I think that is important the back button.

 

<?php
$javascript="";
$javascript = $_POST['javascript'];

if ($javascript=="")
 {
 $javascript="0";
?>
  <form name="js_habilitado"  method="post">
  <input type="hidden" name="javascript" value="1">
  </form>
  <script><!--

document.js_habilitado.submit();

  //-->
  </script>
<?php
  }
?>

Link to comment
Share on other sites

Dropdownmenu v1.2 has been released.

 

It corrects an SQL error when using keywords.

 

I'm an idiot I forgot say when adding the new contribution that you repair the advanced_search_result.php file.

 

Pardon for the inconveniences.

 

Thanks to all and enjoy it :-D

Link to comment
Share on other sites

  • 1 month later...

Hello euskopc,

 

Thank you for your contribution. I really like it and have installed it (only on index page so far).

 

I hope you can help me. I am getting the following error when ever I use the search button:

 

Parse error: parse error in /home/afvhob/public_html/advanced_search_result.php on line 402

 

I have checked line 402 and that is th eline after the last line of code in advanced_search_result.

 

Any help would be appreciated. Thanks.

 

Pete

Link to comment
Share on other sites

Parse error: parse error, unexpected $ in /hsphere/local/home/havenbiz/havenelectronics.com/catalog/includes/column_right.php on line 39

 

(changed column_left.php to column_right.php....i have taken out column left!)

 

<?php
/*
 $Id: column_right.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

?>

<?php

//JAVASCRIPT ENABLED
if ($javascript=="1"){
 include(DIR_WS_BOXES . 'categories_js.php');
 require(DIR_WS_BOXES . 'whats_new.php');
 if ((USE_CACHE == 'true') && empty($SID)) {
   echo tep_cache_categories_box();
 }

//JAVASCRIPT DISABLED
else{
 if ((USE_CACHE == 'true') && empty($SID)) {
   echo tep_cache_categories_box();
   echo tep_cache_manufacturers_box();
 }
 else {
   include(DIR_WS_BOXES . 'manufacturers.php');
   include(DIR_WS_BOXES . 'search.php');
 }
 include(DIR_WS_BOXES . 'livehelp.php');
 require(DIR_WS_BOXES . 'whats_new.php');
}

?>

 

I dont see anything wrong...but then again..i dont know your jave calls...

 

Patrick

Patrick Bailey

www.DisplayHaven.com

Link to comment
Share on other sites

nevermind...fixed that one...it was missing a } in the first java part...now i have a new one when i search though:

 

 

Parse error: parse error, unexpected $ in /hsphere/local/home/havenbiz/havenelectronics.com/catalog/advanced_search_result.php on line 394

 

Same error, different file...something i copied and pasted was not correct...probably same parse error as the person who posted right above my first post...

Patrick Bailey

www.DisplayHaven.com

Link to comment
Share on other sites

/*******************dropdownmenu v.1.4******************/

 

I add to the oscommerce contributions page.

I recommend that you restore your backup without dropdownmenu 1.3 and earlier before, now you dont have to modify all the catalog simple files, only header.php.

I install the new contrib in a clean oscommerce site and it runs OK, please post me your problems.

 

 

Anybody knows better ways to detect javascript to disable the contrib if it is disabled, I have seen that the coolmenu disable it better but I dont know how to do it.

/******************************************************/

 

 

I'm very happy thinking that more than one uses my contribution, THANKS.

Link to comment
Share on other sites

Estimado Ivan:

 

Thanks for your interesting contrib!

 

I think there are a small bug, at least into your page...

 

When I change into the first dropdown menu to 'Cannon', so into the snd dropdown show 'Contiene Datos', but into the third there are no articles/subcategorias to show.

 

If then I press the 'Buscar' button, after reload de page the 'Contiene Datos' becomes 'Todas las categorias' but still are wide the third dropdown.

 

I think you have no articles of 'Cannon' manufacturer but the js have not the code to detect it (may be it should ask to de database 'show all manufacturers with num of articles > 0 before populate the first dropdown menu).

 

Another question: Wen change to some manufacturers the snd dropdown show sometimes 'Todas las Categorias' or 'Contiene Datos'. Why?

 

I thinks should be minor changes to get 100% free bugs your interesting contribution.

 

Are you planning to expand this issue to others pages?

 

I'm think it would be a good idea to populate the 'zones' refered to a country after the 'country' is selected in create_account.php (insead populate with ALL the zones).

 

All the best.

 

Antonio Garcia

Link to comment
Share on other sites

Hello Antonio, as you can see this site is under develpment and the products are the products that oscommerce sets by default. My store will never have products without category and for this reason I dont make the capability to detect if the category have or not products (I promise to try when I have more time).

Another question: Wen change to some manufacturers the snd dropdown show sometimes 'Todas las Categorias' or 'Contiene Datos'. Why?

I take a minute now to study what's wrong, thanks for the advise!

Are you planning to expand this issue to others pages?

I dont understand, could you specify?

I'm think it would be a good idea to populate the 'zones' refered to a country after the 'country' is selected in create_account.php (insead populate with ALL the zones).

Pardon, it could be my horrible english... could you specify?

 

Thx

Link to comment
Share on other sites

OK, to solve the "contains data"/"search all categories":

 

Open selectphp.js

_______________

 

Go to line 194 and replace:

if(document.forms['QForm']['manufacturers_id'].options[0].text==DROPDOWNMENU_CLEAN_DATA[languages_id]){

With this:

if(curOption['manufacturers_id']==""){

 

Thats all.

Link to comment
Share on other sites

Are you planning to expand this issue to others pages?

I dont understand, could you specify?

I'm think it would be a good idea to populate the 'zones' refered to a country after the 'country' is selected in create_account.php (insead populate with ALL the zones).

Pardon, it could be my horrible english... could you specify?

 

Dear Ivan:

 

Please see:

Country-State Selector

 

Your code may enable to charge ONLY the zones of the country selected insead ALL THE ZONES.

 

Thanks for the corrections!

 

Antonio

 

================

SPANISH

================

Estimado Ivan:

 

Perdona mi terrible Ingl?s. Probablemente nuestra lengua nos ponga en sinton?a.

La contribuci?n que te indico actualiza las zonas dependiendo del pais que el cliente selecciona cuando abre una cuenta.

Tu c?digo podr?a evitar el tener que cargar todas las zonas en un dropdonw y ?nicamente cargar las zonas del pais seleccionado.

 

Puede que no sea muy significativo, pero servir?a para evitar cargar largas p?ginas...

 

Un abrazo.

 

Antonio

Link to comment
Share on other sites

OK, Antonio I understand. This is a beatifull feature for the Country-State Selector contribution, but I have no time to do at this moment (I need to end euskopc.com in the minor period of time), I like your idea and probably I'll do a contribution (if nobody do it before).

 

/********SPANISH **********/

 

Hola Antonio, creo que es m?s facil de esta manera. Me parece una buena idea la de aplicar el metodo de dropdownmenu a "Country-State Selector", sin embargo ahora mismo estoy enfrascado en euskopc.com y no creo que le pueda dedicar tiempo hasta que est? terminada. Posiblemente lo hare m?s adelante (al igual que la otra idea de detectar si hay o no hay productos en dropdownmenu) cuando me baje un poquillo el estr?s ;-)

 

Un saludo y gracias por colaborar, agradezco mucho los comentarios.

Link to comment
Share on other sites

  • 4 weeks later...
DropDownMenu v2.0

Hello :)

 

On instructions you have:

 

7. Open catalog/includes/column_left.php and search this line:

include(DIR_WS_BOXES . 'search.php');

 

Replace with this one:

include(DIR_WS_BOXES . 'categories_js.php');

 

 

The only think that i find on original column_left.php is

 

require(DIR_WS_BOXES . 'search.php');

 

 

I changed:

require(DIR_WS_BOXES . 'search.php');

to

require(DIR_WS_BOXES . 'categories_js.php');

 

and it seems all fine :) Did i did it right?

 

http://www.0wn4g3.net/loja

Link to comment
Share on other sites

Yes, you are right.

 

You can view your fix in the contributions page.

 

I've visited your website, you need modify catalog/selectphp.js for getting all the dropdownmenu features:

 

1.-Go to the admin section an identify you language ID:

Admin -> Currencies ->Languages-> Select your language and copy your language order (Italian order in this case)

 

2.-Open catalog/selectphp.js and search this:

/***********************languages*******************/
var DROPDOWNMENU_CLEAN_DATA = new Array();
var DROPDOWNMENU_CONTAINS_DATA = new Array();
var DROPDOWNMENU_SEARCH_ALL_MANUFACTURERS = new Array();
var DROPDOWNMENU_SEARCH_ALL_CATEGORIES = new Array();
var DROPDOWNMENU_SEARCH_ALL_SUBCATEGORIES = new Array();
//English
DROPDOWNMENU_CLEAN_DATA[1] = 'Clean data';
DROPDOWNMENU_CONTAINS_DATA[1] = 'Contains data';
DROPDOWNMENU_SEARCH_ALL_MANUFACTURERS[1] = 'All manufacturers';
DROPDOWNMENU_SEARCH_ALL_CATEGORIES[1] = 'All categories';
DROPDOWNMENU_SEARCH_ALL_SUBCATEGORIES[1] = 'All subcategories';
//German
DROPDOWNMENU_CLEAN_DATA[2] = 'Saubere daten';
DROPDOWNMENU_CONTAINS_DATA[2] = 'Enthalt daten';
DROPDOWNMENU_SEARCH_ALL_MANUFACTURERS[2] = 'Hersteller alle';
DROPDOWNMENU_SEARCH_ALL_CATEGORIES[2] = 'Kategorien alle';
DROPDOWNMENU_SEARCH_ALL_SUBCATEGORIES[2] = 'Subkategorien alle';
//Spanish
DROPDOWNMENU_CLEAN_DATA[3] = 'Limpiar datos';
DROPDOWNMENU_CONTAINS_DATA[3] = 'Contiene datos';
DROPDOWNMENU_SEARCH_ALL_MANUFACTURERS[3] = 'Todos los fabricantes';
DROPDOWNMENU_SEARCH_ALL_CATEGORIES[3] = 'Todas las categorias';
DROPDOWNMENU_SEARCH_ALL_SUBCATEGORIES[3] = 'Todas las subcategorias';
/***************************************************/

Add new lines for your language (the number between[] is the language ID that we see in the admin section.

 

If you want you can add an extension for your language in contributions page!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...