Jump to content
rocky

[MODULE] AJAX Dropdown Categories

Recommended Posts

This module displays categories in dropdowns instead of a tree structure and allows subcategories to be dynamically loaded to reduce load time. Other options include displaying the number of products in each category, hiding empty categories, and saving the state of the dropdowns.

This module is useful for merchants selling printer cartridges, car parts, laptop batteries or anything else that requires the customer to select from thousands of product models to buy related accessories. Merchants can use the CSV import feature in PrestaShop to quickly add all the brands, makes and models and the module will automatically generate a product finder block so customers can quickly and easily select models.

 

For more information including a changelog and links to websites using the module, see the module page here. There is a link to purchase the module on PrestaShop Addons.

Compatible with PrestaShop v1.5.x, v1.6.x and v1.7.x

 

post-13933-0-18586500-1479261908_thumb.pngpost-13933-0-44234900-1479261910_thumb.pngajax-dropdown-categories-block-configuration.thumb.jpg.a777a24d5e4e8f66580e554e443f5969.jpgpost-13933-0-12010300-1479261913_thumb.pngpost-13933-0-69341600-1479261917_thumb.png

Edited by rocky (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Hello Rocky,

Nice module again, personally i stick with ajax slide categories from you for the simple reason cause i love it and is perfect when you do not have to much different products.

On the other hand this module will fit people needs that has a lot off different products then this module will keep it tide and looks more clean on the site.
So congrats with the new module buddy ;)

Best regards,

ysco..

Share this post


Link to post
Share on other sites

Hi Rocky,

I'm testing this module out and I was wondering if you can help me with the next two things:

1. I want to give different names to the fields. Since I'm selling laptop parts I want to use something like this:

First field: Select brand
Second field: Select model
Third field: Select type
Etc.

Can you please add this option or let me know how to change?


2. I want to have a fixed width for the fields. Now the length of the input decides what the width of each field will be and this is not looking nice. How can I set a fixed width?

You can check good examples of how I like it to be at: www.replacedirect.com



Thank you in forward!

Share this post


Link to post
Share on other sites

I'll add the options to define labels for levels and specify a width for the dropdowns in the next version of the module. I've already added the option to select a category to start from.

Share this post


Link to post
Share on other sites

I've now added the requested features. I'll send the module to you to test. If it works for you, I'll release it to all my customers.

Share this post


Link to post
Share on other sites

Yo, rocky, give me a shout about this, what control are you using?
I found one that is VERY easy to use that kind of looks just like this.

I am going to use it for my GoogleBase taxonomy.

Share this post


Link to post
Share on other sites

I'm not using any library for this module. I wrote all the Javascript myself.

Share this post


Link to post
Share on other sites

contact me off-line and I'll show you a jQuery plugin that will work brilliantly for this AND help in latency with the categories module if you have a lot of categories.

Share this post


Link to post
Share on other sites

v1.2 has been released. It adds the option to start the dropdowns from a subcategory, set the width of the dropdowns and set a different label for each level of dropdowns.

Share this post


Link to post
Share on other sites

v1.3 has been released. It adds the option to include products in the dropdowns.

Share this post


Link to post
Share on other sites

Is it posible to make it like

category (dropdown)
subcategory (dropdown)
subsubcategory (tree)

??

thanks!

Share this post


Link to post
Share on other sites

No, this module only lets you display dropdowns. It doesn't let you have a hybrid dropdown and tree structure.

Share this post


Link to post
Share on other sites

I have bought both categories modules and im wondering if it posible to set it like that:

dropdown would go to 2 level

tree verion would show only 3 level ?

:)

Share this post


Link to post
Share on other sites

It would be difficult to do. It would require merging the two modules in a way so that the dropdowns are used for the first two levels and the tree for the remaining levels.

Share this post


Link to post
Share on other sites

v1.4 has been released

It adds the option to display Go buttons next to each dropdown to allow navigation to parent categories, the option to start with all dropdowns displayed in a disabled state and the option to fix a display bug with long category names in IE8 and below.

Share this post


Link to post
Share on other sites

v1.5 has been released

The module is now compatible with PrestaShop v1.4. It also adds the option to display the label outside of the dropdown and the option to dynamically load categories on the "1. Info." tab of the product editor.

Share this post


Link to post
Share on other sites

I'm not sure. The module must get all the subcategories and at least one of the sub-subcategories to determine whether to navigate to the category or download the sub-subcategories. Since you have many subcategories and sub-subcategories, that takes a long time to do. I'll check my code again to see if I can find a way to optimise it. Since you've purchased AJAX Dropdown Categories v1.4, you only need to pay $10 to get the upgrade, and it will be free to upgrade to the next version I'm working on.

Share this post


Link to post
Share on other sites

You can use this link to pay the difference. The email address you used to sign up on my website must be invalid, otherwise you would have gotten an email about this. Please PM me an email adress I can use to send you the module.

Share this post


Link to post
Share on other sites

v1.5.1 has been released. It simplifies the new option to dynamically load Back Office categories, fixes a few bugs and adds instructions.

Share this post


Link to post
Share on other sites

Load time with 1.5.1 AJAX Dropdown Categories is for 2 or 3s better (5s before; 2-3s now)! Great job!

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v1.5.2 has been released. The "Save state" option now works with non-friendly URLs. Also, a bug was fixed when the "Label position" was set to "Outside" and "Show all dropdowns" was set to "Yes".

AJAX Dropdown Categories v1.5.3 has been released. It fixes a bug where the state wasn't maintained when visiting a product and fixes a bug where the label was displayed a second time when going back to a previous category.

Share this post


Link to post
Share on other sites

Hi, one of my customer bought your module v1.3. With simply categories make with "hands", the module work fine. But when I used CSV for categories, all the website dont work. Front office down but Back office stay.

And if I uninstall your module, the website work.

What can I do?

thanks

Share this post


Link to post
Share on other sites

Try choosing the "Repair tree" option. I'm not sure what else to do, since I don't know the cause of the problem.

Share this post


Link to post
Share on other sites

I tried that but dont works too (sorry for my english ^^)

Actually the module is activate with some csv categories and the error message say :

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, postmaster@mywebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


If i want to configure the module in Back office, I click on configure and........ same error message :s

Share this post


Link to post
Share on other sites

Check to make sure the permissions on the modules and modules/categoriesnc directories are chmod 755 and the files in the modules/categoriesnc directory are chmod 644. I can't think of any other reason why you would get an internal server error.

Share this post


Link to post
Share on other sites

Hi the problem is solved. When i created categories i began with ID 1. And the category Home in absentia was removed.

Now i dont use 1 in ID of the first category and the website and module work fine.


Sorry for the disturbance ^^.

Thanks very much

Share this post


Link to post
Share on other sites

v1.5.4 has been released

You can now regenerate the cache when the "Hide empty categories" option is enabled and "Product numbers" is disabled. I also made an error message translatable that previously wasn't.

v1.5.5 has been released

You can now translate labels. Also, a bug in the "Maximum depth" and "Show all dropdowns" options was fixed.

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v1.6 has been released

It is now compatible with PrestaShop v1.4 final.

Share this post


Link to post
Share on other sites

Hello!

I'm developing a shop that has 5 different top categories (Car, Motorcycle, ATV...) and I'd like to have separate navigations for these. The top categories should be listed only in the header and other category navigations should be using the current top category as their root.

The question:
Is it possible to change the root of your AJAX Dropdown Categories dynamically? Maybe same question for AJAX Sliding Categories, too.

Maybe a solution:
For other reasons I have to find out the top category (id) of currently viewed category (or the parent of currently viewed product). I wonder if I could use that id in your navigation blocks as their root.

I'm pretty experienced with PHP and e-commerces, but I'm just a Prestashop newbie atm. This is my first PS shop I'm developing. Version is 1.4 Final.

I hope to hear you soon, but of course other guys can answer too :)

(btw, you've done great work with these blocks! I really appreciate when things are done right)

Edit: I checked the screenshot of AJAX Dropdown Categories again and it seems that there is already a parameter called "Start from". Can I override it so, that it would be always the related top category?

Edit #2: As far as I understand Prestashop, this is not possible, but anyways... Could it be possible to have separate (instances of) AJAX Dropdown Categories blocks for all the top categories? If it is, I could set "Start from" manually to the category I want to use and then use some logic to show the correct block depending on the current top category. This would be very good solution actually, but is it possible?

Share this post


Link to post
Share on other sites

No, the "Start from" option requires you to select a specific category. It doesn't let you dynamically choose the current category. My AJAX Sliding Categories module has a "Hide parent categories" option that lets you display only the subcategories of the current category. My AJAX Dropdown Categories doesn't have that option, though I could add it if needed.

Share this post


Link to post
Share on other sites
No, the "Start from" option requires you to select a specific category. It doesn't let you dynamically choose the current category. My AJAX Sliding Categories module has a "Hide parent categories" option that lets you display only the subcategories of the current category. My AJAX Dropdown Categories doesn't have that option, though I could add it if needed.


I don't mind to get my hands dirty, so basically I wanted to know if you think it's possible for me to fork the "Start from" option to be set dynamically.

I think the option "Hide parent categories" would work only when one of the top categories was the current page. On product pages navigation would be pretty much useless.

If you don't see any reasonable easy solution for this, maybe I have to add a top category called "Model search", then create same categories (Car, Motorcycle, ATV...) inside that and finally choose the "Start from" option to be "Model search". This way user has to pick the correct top category by hand, but that's not a huge issue. That raises two questions though:

1) Can I hide the top category "Model search" (and therefore subcategories inside it) from AJAX Sliding Categories just by disabling "Model search" from BO?

2) If I can, am I still able to use the hidden "Model search" category as "Start from" option in the AJAX Dropdown Categories?

Sorry to bother you this much with pre-sales questions.

Share this post


Link to post
Share on other sites

I think it is possible to do with some simple hacking. For example, you could try changing line 850 of modules/categoriesnc/categoriesnc.php from:

$homeCategory = Configuration::get('CATEG_NC_START_FROM_CATEG');



to something like:

$homeCategory = $category;

do
{
  $homeCategoryObj = new Category((int)$homeCategory);
  if ($homeCategoryObj->id_parent > 1)
     $homeCategory = (int)$homeCategoryObj->id_parent;
}
while ($homeCategoryObj->id_parent > 1);



This should set the "Start from" category to the top-level category of the current category. I haven't tested it though, so it's likely to have a mistake. Basically, you should iterate through all the parent categories until you find one with the "Home" category as the parent, then you know you've found the top-level category.

  • Like 1

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v1.6.1 has been released. It makes the module compatible with PrestaShop v1.4.2 and fixes a bug when the "Start category" wasn't "Home".

Share this post


Link to post
Share on other sites

I bought this module today. It's Great module, that's what I wanted.

But I have only 2 Drop down labels. I had 3, but sth happened. How can I make 3 Dropdown labels to appear??

dropdownt.jpg

Uploaded with ImageShack.us

Regards

Share this post


Link to post
Share on other sites

Make sure you have three levels of categories. For example, Home > Level 1 > Level 2 > Level 3. If you do, try clicking the "Repair tree" button. If that doesn't work, send me your Back Office and FTP details and I'll debug the problem.

EDIT: Actually, the repair tool is broken. I've now fixed it in AJAX Dropdown Categories v1.6.2 and fixed another bug.

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v1.6.3 has been released. It fixes a bug with labels and "Show products", a bug in "Start from" and a bug in cache regeneration.

AJAX Dropdown Categories v1.6.4 has been released. It fixes a bug wiith labels and "Maximum depth".

AJAX Dropdown Categories v1.7 has been released. It now overrides the category pages so that product numbers are displayed and empty categories are hidden. It also fixes a bug with the "Maximum depth" that caused too many dropdowns to appear.

Share this post


Link to post
Share on other sites

Hello,
I've just bought this module, but on the demo, i could choose the brand (manufacturer), but it's not possible on my website after i installed it !
How can i do to be able to select the brand, before (or afer) choosing the type of product ?

Thanks.

Romain

Share this post


Link to post
Share on other sites

The module uses categories only, not manufacturers, so you must create all your manufacturers as categories and put the other categories as subcategories of the manufacturers.

Share this post


Link to post
Share on other sites

I have an issue with this module.

It seems to be conflicting with a hack I've added to remove the need for the "Save" button on the Customisation of a product.
See this link for the hack in question: http://www.prestashop.com/forums/viewthread/76874/development/how_to_remove_save_button_for_customized_fields_63

I'm using version 1.3.0 and it seems when I enable this module it stops the Ajax cart from loading properly.

When I disable this Module the hack works fine.

My question is really, what is this module doing to mess up the way that the products are added to the cart? I didnt think this needed to interface with the cart funuctions.

Can anyone help me get these two elements working together.

Any help is much appericated.

Kind Regards
Dan.

Share this post


Link to post
Share on other sites

From my research, It looks like this module is disabling the Ajax cart if im correct? Is this the case??
If so is there a reason for it doing this? As I have the Ajax cart checkbox in the Modules > Cart Block > Ajax cart : On.

If anyone can get back to me this would be kindly appreciated.

Cheers
Dan.

Share this post


Link to post
Share on other sites

I'm confused, since my module shouldn't affect the AJAX cart at all. Can you check for JavaScript errors? Perhaps it's something else causing the AJAX cart to stop working.

Share this post


Link to post
Share on other sites

Thanks for the quick reply, Yeah sure.

Although I'd like to add for dbugging purposes, this is a clean 1.3 install with only your module loaded and this hack in place. If i disable your module the Ajax cart works, If i enable your module it turns off the ajax cart. It seems to be doing this too without the hack installed and your module being the only third party one installed...

Cheers
Dan.

Share this post


Link to post
Share on other sites

If you PM me your FTP details, I'll take a look at your website and see if I can find the problem.

Share this post


Link to post
Share on other sites

OK just checked the JS Errors

Error: $("select#lev1").ieSelectWidth is not a function
Source File: http://www.*****.***/product.php?id_product=26
Line: 3883


Line 3883 (and Surrounding) :-


[removed]
$(function ()
{
       $('select#lev1').ieSelectWidth
   ({
       width:169,        containerClassName:'select-container',
       overlayClassName:'select-overlay'
   });
       $('select#lev2').ieSelectWidth
   ({
       width:169,        containerClassName:'select-container',
       overlayClassName:'select-overlay'
   });
   });
[removed]




Line 3883 is the first instance of

overlayClassName:'select-overlay'





Cheers
Dan

Share this post


Link to post
Share on other sites

Cheers for that, although currently Its an internal URL only. I can upload to an external URL if you like and give you the details.

Cheers
Dan.

Share this post


Link to post
Share on other sites

Looks like an issue with the "Fix IE select width" option. Does everything work when you disable that option?

Share this post


Link to post
Share on other sites

Brilliant, Thats it working now!

How odd that it would effect the Ajax cart...

Do I need that feature on? Im not sure what it does.

Cheers
Dan.

Share this post


Link to post
Share on other sites

That feature fixes a bug in IE8 and below where the width of the dropdown values is the same as the dropdown, causing long category names to be cut off. It uses JavaScript to increase the width of the dropdown, but uses an image to make it look the same width as before. Unless you have very long category names, that option doesn't need to be enabled.

Share this post


Link to post
Share on other sites

Hi Rocky, I have been playing with the new presta 1.5 rc1 release. I was wondering if you plan to update the ajax dropdown and the sliding categories modules for 1.5? I bought both these module late last year and never got a chance to use them.

 

Does anyone's modules ever make it into the core? I know its a money thing but both these modules belong in core.

Share this post


Link to post
Share on other sites

Hi,

I've a problem with this module. I can choose a first category, but the second category continues to show 'loading...'. How can I fix that?

Share this post


Link to post
Share on other sites

Bonjour, le module est'il compatible avec prestashop 1.5? ou existe t'il un module compatible similaire même payant?

Share this post


Link to post
Share on other sites

Bonjour, quelqu'un vend t il toujours ce module ? je recherche un module permettant de faire un tri par liste deroulante des categories > sous categories > sousous categories.

 

merci

Share this post


Link to post
Share on other sites

Hi guys

 

I have this module, ant it is very usefull with my v1.4.8

But, i would like to modify the first filter.

Example :

 

 

cat 1 : subcat a1, b1, c1

cat 2 : subcat a2, b2, c2

 

When im in the cat 1, it displays all the category parent

I need this :

 

Other category

cat 1

subcat a1

subcat b1

subcat c1

 

Sorry it is very difficult to explain it !

Share this post


Link to post
Share on other sites

I think it is possible to do with some simple hacking. For example, you could try changing line 850 of modules/categoriesnc/categoriesnc.php from:

 

$homeCategory = Configuration::get('CATEG_NC_START_FROM_CATEG');

 

to something like:

 

$homeCategory = $category;

do
{
  $homeCategoryObj = new Category((int)$homeCategory);
  if ($homeCategoryObj->id_parent > 1)
  $homeCategory = (int)$homeCategoryObj->id_parent;
}
while ($homeCategoryObj->id_parent > 1);

 

This should set the "Start from" category to the top-level category of the current category. I haven't tested it though, so it's likely to have a mistake. Basically, you should iterate through all the parent categories until you find one with the "Home" category as the parent, then you know you've found the top-level category.

 

Hi Rocky,

 

this modification interests me.

But it doesnt work.

I would like to let the possibility to go to the parent category

Anybody knows what i should modify please

Share this post


Link to post
Share on other sites

The link to buy this module is down... please advise where i can purchase this?

 

There are other modules but im only looking for the back office dropdown functionality.. please please help me find this module to purchase.

Share this post


Link to post
Share on other sites

I've left PrestaShop development now, so none of my modules are available for download anymore. The last version of the module isn't compatible with PrestaShop v1.5, only v1.4.9 and earlier. I have patched my modules to work with my own PrestaShop v1.5 websites, but they don't work with the new multiple shops feature, so I didn't release them. If you really need the module and aren't using the multiple shops feature, I can send you what I have. Just send me a private message.

 

UPDATE: I'm now back in PrestaShop development again

Share this post


Link to post
Share on other sites

Yes, anyone who is interested in buying this module can send me a private message and I'll explain how to do it.

  • Like 1

Share this post


Link to post
Share on other sites

I've left PrestaShop development now, so none of my modules are available for download anymore. The last version of the module isn't compatible with PrestaShop v1.5, only v1.4.9 and earlier. I have patched my modules to work with my own PrestaShop v1.5 websites, but they don't work with the new multiple shops feature, so I didn't release them. If you really need the module and aren't using the multiple shops feature, I can send you what I have. Just send me a private message.

 

 

Hello,

I'd appreciate if you send an emergency. I sent you a private message.

Share this post


Link to post
Share on other sites

This module displays categories in dropdowns instead of a tree structure and allows subcategories to be dynamically loaded to reduce load time. Other options include displaying the number of products in each category, hiding empty categories, and saving the state of the dropdowns.

 

This module is designed for electronics websites or websites that sell accessories for well-known products. You can see a demo of this module and buy it here.

 

v1.1

 

* Added the option to repair the category tree for those customers affected by a PrestaShop bug that caused the level depths to be miscalculated

 

v1.2

 

* Added the option to start the dropdowns from a subcategory

* Added the option to set the width of the dropdowns

* Added the option to set a different label for each level of dropdowns

 

v1.3

 

* Added the option to include products to the dropdowns

 

v1.4

 

* Added the option to display Go buttons next to each dropdown to allow navigation to parent categories

* Added the option to start with all dropdowns displayed in a disabled state

* Added the option to fix a display bug with long category names in IE8 and below

 

v1.5

 

* Made compatible with PrestaShop v1.4

* Added the option to display the label outside of the dropdown

* Added the option to dynamically load categories on the "1. Info." tab of the product editor

 

v1.5.1

 

* Simplified the new option to dynamically load Back Office categories

* Updated with code from PrestaShop v1.4 RC5

* Added instructions

 

v1.5.2

 

* The "Save state" option now works with non-friendly URLs

* Fixed a bug when the "Label position" was set to "Outside" and "Show all dropdowns" was set to "Yes"

 

v1.5.3

 

* Fixed bug where state wasn't maintained when visiting a product

* Fixed bug where label was displayed a second time when going back to a previous category

 

v1.5.4

 

* Can now regenerate cache when "Hide empty categories" option is enabled and "Product numbers" is disabled

* Made error message translatable

 

v1.5.5

 

* Made labels translatable

* Fixed a bug with "Maximum depth" and "Show all dropdowns"

 

v1.6

 

* Made compatible with PrestaShop v1.4 final

 

v1.6.1

 

* Made compatible with PrestaShop v1.4.2

* Fixed a bug when the "Home category" wasn't "Home"

 

v1.6.2

 

* Fixed a bug in maintaining category state

* Fixed a bug in the repair tool

 

v1.6.3

 

* Fixed a bug with labels and "Show products"

* Fixed a bug in the "Start from"

* Fixed a bug in cache regeneration

 

v1.6.4

 

* Fixed a bug with labels and "Maximum depth"

 

v1.7

 

* Added option to override the category pages so that product numbers are displayed and empty categories are hidden

* Fixed a bug with "Maximum depth" that caused too many dropdowns to appear

 

Compatible with PrestaShop v1.3.x and PrestaShop v1.4

Page not available

We're sorry, but the Web address you entered is no longer available. Please use the navigation links above.

Share this post


Link to post
Share on other sites

I'm pleased to announce that Nethercott Constructions is back online with a new responsive design and the much-requested AJAX Dropdown Categories v2.0 is now available. Sorry for such as long delay in updating the module. I hope the new features I added make it worth the wait.

 

I completely rewrote the module for PrestaShop v1.5 and I'm now using nested tree values to improve performance. After testing the module on a website with 200,000 categories, I added a new option to limit the number of subcategories loaded at a time to prevent memory limit errors, and progress screens when calculating product counts and repairing the category tree.

I added options to sort categories by name or position ascending or descending, set the maximum footer depth, hook the module at the top of the page, and delay reloading categories until the customer clicks a dropdown.

I also added French, Spanish, German, Italian, Dutch, Polish, Portuguese and Russian translations, numerous improvements after running it through the PrestaShop Validator, and the option to edit CSS on the configuration page.

 

I used Google Translate and Microsoft Word's grammar checker for the translations, so they may not be entirely accurate. If you are someone who speaks one of these languages and would like to improve my translations, please let me know. I can give you a free copy of the module for your work.

  • Like 1

Share this post


Link to post
Share on other sites

The module is not strictly responsive, though the dropdowns will wrap to fit the available space. I decided not to make a responsive version of the module, since the default mobile theme in PrestaShop already lets you select categories one level at a time in a similar way to my module.

Share this post


Link to post
Share on other sites

Thank you Adrian, so I prefere to wait for release with bootstrap, as actual mobile theme is not really the best solution.

 

Best regards

 

Conny

Share this post


Link to post
Share on other sites

OK. I'll consider making the module responsive when I update it for PrestaShop v1.6 final, when that is released.

  • Like 1

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v2.1 has now been released. I rewrote the module using PrestaShop's helper classes, so now the same module files work in both PrestaShop v1.5.x and v1.6.x.

 

@Conny

 

As requested, the module is now fully responsive in PrestaShop v1.6. The module displays as normal at desktop resolution, but in tablet and phone resolutions, the dropdowns are displayed full width. There is also an option to collapse the dropdowns in tablet and phone resolutions.

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v2.3 has now been released. It improves the configuration page of the module and fixes a bug that sometimes caused the product number cache to be deleted when saving settings. Multiple levels of categories can now be displayed in the footer, along with product numbers.

Share this post


Link to post
Share on other sites

Click the "Manage translations" link on the module's configuration page (or go to Localization > Translations > Installed module translations, click "English" or another language, then scroll down to categoriesnc) and enter a translation for "Categories", then save the changes.

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v2.4 has been released. I've improved the performance of the module by using nleft and nright to determine whether a category has subcategories, made dropdowns full width when appropriate and improved the styling of the dropdowns using Uniform to match the theme, and fixed a few bugs.

  • Like 1

Share this post


Link to post
Share on other sites

Hello Rocky!

 

I have a Problem with the recently bought Module: In backoffice you can chose the sorting for the dropdown "by Name" or "by position". By Name works perfect, but "by position" only works in the second,third,fourth an so on level, but NOT in the first level dropdown. I made screenshots found in the attachment.

Sorting by name is no option for my because it is not usable for my other level dropdown menus. What ca i do to force "sort by position" for the first, very important lev1 dropdown?

 

I´m using the 2.4 Version of the module in Prestashop 1.5.6.2

 

P.S.: I tested the 1.6 module with presta 1.6.0.9, too. Same Issue. The Sorting in the first dropdown is always very strange an weird...

 

post-407990-0-64159900-1412236130_thumb.jpg

Share this post


Link to post
Share on other sites

@schibulski

 

Thank you for your bug report. Try changing the $sql variable on line 1707 of modules/categoriesnc/categoriesnc.php to: 

$sql = '
	SELECT DISTINCT c.`id_category`, c.`id_parent`, c.`level_depth`, c.`nleft`, c.`nright`, cl.`id_lang`, cl.`name`, cl.`link_rewrite`'.
	((Configuration::get('CATEG_NC_HIDE_EMPTY_CATEG') == 1 || $num_products == 2) ? ', bn.`num_products`' : '').'
FROM `'._DB_PREFIX_.'category` c 
	LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (c.`id_category` = cs.`id_category`)
	LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` && cl.`id_lang` = '.
	(int)$params['cookie']->id_lang.' && cl.`id_shop` = '.(int)$this->context->shop->id.')
	'.((Configuration::get('CATEG_NC_HIDE_EMPTY_CATEG') == 1 || $num_products == 2)
	? 'LEFT JOIN `'._DB_PREFIX_.'blockcategoriesnc_numproducts` bn ON (c.`id_category` = bn.`id_category`)' : '').'
	LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`)
	WHERE c.`active` = 1'.$groups.' && (`level_depth` <= 1'.$subcategory_subquery.')
	ORDER BY `level_depth` ASC, '.(Configuration::get('CATEG_NC_SORT') ? 'cl.`name`' : 'cs.`position`').' '.
	(Configuration::get('CATEG_NC_SORT_WAY') ? 'DESC' : 'ASC');

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v2.5 has been released. The update fixes a bug in the ordering of categories in the first dropdown, improves security and adds a header to the top of the configuration page with a link to the contact page of my website for support.

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v2.6 has been released. It fixes a bug that caused the "Go" button to navigate to the wrong category. The cron job is now working correctly. The CSS has also been improved.

Share this post


Link to post
Share on other sites

This module looks very interesting, could this be used as a tool to help the customer to find the right product, like a "Product finder assist" ?

 

I want to help customer to find the right product by providing a tool that asks the visitor a set of questions and based on this it will list out products that best fit the answers.

 

Or is your product out of scope of what i am looking for?

Share this post


Link to post
Share on other sites

Unless those questions are in the format "What is the make of your car?" and "What is the model of your car?", then I don't think my module is for you. It was designed for websites that sell accessories like car parts or printer cartridges and require the customer to select their product using dropdown menus.

 

It does this by using the category system built in to PrestaShop. You set up your categories like "Ford" with subcategory "Focus" and then set the first level label to "Make" and second level label to "Model" so that customers can select their car on the website, then the products assigned to the "Focus" category would be displayed.

Share this post


Link to post
Share on other sites

Hello i have this module (v2.,6) on client (Prestashop 1.5.6.2) website ...
when i turn (PS_DEBUG_PROFILING_  true) on defines.inc.php file

i got this page : 

[PHP Notice #8] Undefined offset: 0 (/var/www/clients/modules/categoriesnc/categoriesnc.php, line 1711)

(not on home page)

I do not know if it is binding but we have some worries to load on this site with the cache
the first Waiting (TTFB) is 10 seconds long (with or without cache)

 

Share this post


Link to post
Share on other sites

Thanks for letting me know about the notice. I thought I'd fixed all the notices.

 

This error could occur because your category level depths are corrupted. In that case, clicking the "Repair tree" button on my module's configuration page should fix it. If that doesn't work, there may be something seriously wrong with your categories. Send me a private message with your FTP and Back Office details and I'll see if I can figure out what's causing the problem.

 

If the module appears to be working fine despite the notice, you can simply add the following above the for loop on line 1711:

if (count($result) > 0)

This will skip the line of code if there are no results. 

Share this post


Link to post
Share on other sites

Just a note to my customers that PrestaShop v1.6.1.0 contains a bug that causes the category tree on my modules' configuration pages to not load correctly. You can click the Expand All button to load the category tree, but it will fail again whenever you refresh the page. To permanently fix the problem, apply the fix at https://github.com/PrestaShop/PrestaShop/pull/3349/files

 

Note that this bug also affects the loyalty module in PrestaShop and any other module that generates it's configuration page using the 'categories' input type.

  • Like 1

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v2.7.0 has been released. It fixes some bugs in the display of dropdowns, improves security of the module, makes the Re-count, Revert and Repair buttons bigger so they are easier to find, and changes the code format to PSR-2.

Share this post


Link to post
Share on other sites

AJAX Dropdown Categories v3.0.0 has been released. It is now possible to have multiple sets of dropdowns (for example, one for "Cars" and one for "Bikes") and different CSS for each shop when multistore is enabled.

  • Like 2

Share this post


Link to post
Share on other sites

Hello rocky!

 

Where can I download it? Prestashop Addons still shows 2.7.0  :blink:

 

by the way: just installed the update to 2.7.0 and found a bug: The Option "Show All Dropdowns" does´t work anymore. Means that the Categories don´t reload. Can just use the first dropdown. All others are deactivated. Switched back to 2.6 Version and everything is fine. Presta 1.6.1.1

Edited by schibulski (see edit history)

Share this post


Link to post
Share on other sites