Jump to content

[MODULE] Sliding accordion categories block


Recommended Posts

  • 2 weeks later...
  • Replies 241
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

For my first module, I have created the sliding accordion categories block. I copied the original categories block from v1.1 and added the JQuery Accordion plugin so that I could add the following fe

I've removed the download link to eliminate confusion. I'll update the post when I rewrite the module for PrestaShop v1.5.

Hi Rocky, I would like to report something that I find. As I set the menu up as click on mouse event and start mode to open, when I click on the parent cat, the sub-cat images in all of the levels (

Posted Images

I don't understand what you mean. The module gets the default category of the product and highlights that category. This makes it easier to track the current category and browse subcategories. Do you want the module to collapse every time you go to a product? That is possible in my paid module, but not my free one.

Share this post


Link to post
Share on other sites

Yes the module to collapse every time you go to a product!

You say: That is possible in my paid module, but not my free one.
My answer: What a pity!
You propose a module and then later you say, now if you want it to work, pay me.

This is a bizare atitude, or is the concept of sharing of departure?

Share this post


Link to post
Share on other sites

The reason I made this a paid module is because I've spent many months working on this module and providing support for it. I need to be compensated for this work. I'm a freelance programmer who's income comes from working on websites and selling modules. I'm a volunteer moderator on these forums and spend much time answering questions and contributing code for free. If you click on my username "rocky" and click "View all posts", you will see how much I've contributed.

I'm not trying to start an argument, I'm just giving context to explain my decision to make this a paid module.

Share this post


Link to post
Share on other sites

You can see a screenshot of the configuration page and a demo of the module with the AJAX feature enabled on my site here. My paid module is based on this free one, so this module also serves as a demo of what the module is like.

After getting some much-needed sleep, I realised that it is actually quite easy is make the categories collapse. I think all you need to do is replace lines 94-97 of blockcategoriesaccordion.tpl with:

{*        navigation: true,*}
       event: {$event},
       animated: {$animation}{*{literal},
       navigationFilter: function() { return containsChild(this); }*}{literal}



This will comment out the navigation code that makes the categories stay open. If this is all you want and you don't want any of the features in my paid module, then this should work for you.

Share this post


Link to post
Share on other sites

Thank you Rocky

it's very generous from you. :zip:

it works for products in subcategories.
But not for products in subcategories which are also in the above categories.

I don't need the features in your paid module, just a functional module v1.6.

Thank you for your help Rocky.

Share this post


Link to post
Share on other sites

That's odd. I just downloaded the v1.6 zip from my first post and made the change I suggested above. On my test site, the module collapsed on all pages including products that also appear in parent categories. Can you try the same steps to see whether it works?

I just noticed you can also {* comment out *} the containsChild function, since you won't need it anymore.

Share this post


Link to post
Share on other sites

I've tested! :roll:

I uninstalled the module, I have deleted the directory "blockcategoriesaccordion" I have put the the directory "blockcategoriesaccordion" version 1.6, I've installed without modification. Then I've tested! Results: The menu will collapse only when I click on a product in a category and that the same product in the sub category too.

example: if I click the peripheral category and click on a Keyboard product (which is too in the Keyboard sub category) , then the menu collapses.
If I click on the same keyboard product in the sub-category "keyboard" no problem!

And with the changes, in fact it is the same. 8-/

Share this post


Link to post
Share on other sites
  • 3 weeks later...

You can set the maximum depth to hide all child categories that are more than a certain depth, but there is no option to pick exactly which category you want children to be hidden from. Can you explain further why you want to do that?

Share this post


Link to post
Share on other sites

Try changing lines 2-3 of modules/blockcategoriesaccordion/category-tree-branch.tpl from:

<a id="cat{$node.id}" href="{$node.link|escape:'htmlall':'UTF-8'}"> 0} class="acc{$i}"{/if} title="{$node.desc|escape:'htmlall':'UTF-8'}">{$node.name|escape:'htmlall':'UTF-8'}
{if $node.children|@count > 0}



to:

<a id="cat{$node.id}" href="{$node.link|escape:'htmlall':'UTF-8'}"> 0 AND $node.id != 7} class="acc{$i}"{/if} title="{$node.desc|escape:'htmlall':'UTF-8'}">{$node.name|escape:'htmlall':'UTF-8'}
{if $node.children|@count > 0 AND $node.id != 7}



Change the two 7s to the ID of the category you don't want to display the children for.

Share this post


Link to post
Share on other sites
  • 2 weeks later...

HI Rocky,

When am using this module I keep getting IE secure and non-secure HTTPS warning.

I uninstalled your module and the warning stopped.

Could you please point me to the file or line that I need to edit to fix this problem?

Thanks
IJ

Share this post


Link to post
Share on other sites

Thank you for reporting this problem. I don't have an SSL certificate, so I can't test my module with it. Try adding $useSSL = true; to the top of blockcategoriesaccordion.php (after the <?php). Let me know if this solves you problem, so I can update the module.

Share this post


Link to post
Share on other sites
Thank you for reporting this problem. I don't have an SSL certificate, so I can't test my module with it. Try adding $useSSL = true; to the top of blockcategoriesaccordion.php (after the <?php). Let me know if this solves you problem, so I can update the module.


I could be wrong.

For my experience, if I add $useSSL = true; to the top of blockcategoriesaccordion.php after the <?, everytime when the customers clicked on the menu, it would make the pages that they clicked became ssl. If the pages were not ssl ready, it would break the site. What I did was I changed all of the {$base_dir} to {$content_dir} on all of the categoriesaccordion.tpl. And it works.

Share this post


Link to post
Share on other sites
Thank you for reporting this problem. I don't have an SSL certificate, so I can't test my module with it. Try adding $useSSL = true; to the top of blockcategoriesaccordion.php (after the <?php). Let me know if this solves you problem, so I can update the module.


I could be wrong.

For my experience, if I add $useSSL = true; to the top of blockcategoriesaccordion.php after the <?, everytime when the customers clicked on the menu, it would make the pages that they clicked became ssl. If the pages were not ssl ready, it would break the site. What I did was I changed all of the {$base_dir} to {$content_dir} on all of the categoriesaccordion.tpl. And it works.



Hi Star,

Thank you very much for the help.
It fixed the problem for too.

Rocky thanks fo your reply too.

JJBYPC

Share this post


Link to post
Share on other sites
  • 1 month later...

Sorry, but my sliding accordion category module doesn't have that option. You'll need to buy my AJAX sliding accordion category module for that option. See this topic for more information.

Share this post


Link to post
Share on other sites

Sliding Accordion Categories v1.6.1 is now available. I've applied Star's SSL fix to my module, removed the PayPal donate button (no-one used it anyway) and replaced it with a link to my AJAX Sliding Categories module. I also moved the module from the Blocks section to a new Nethercott Constructions section to make the module easier to find.

@Ensign

Please try downloading "blockcategoriesaccordion v1.6.1" from my first post and let me know whether it has fixed your SSL problems.

Share this post


Link to post
Share on other sites

Hi Rocky,

module is great. Thank you.

Please can you advise me how to modify the module to be displayed:

If I'm on the page (HOME PAGE - $currentCategoryId = 0 or HOME category - $currentCategoryId = 1) in block categories show only text: Select the main category.

and

If I select a main category (level_depth = 1) - hide other categories with level_depth = 1 except the selected category ($currentCategoryId).

Thank you in advance for ideas for resolving.

Share this post


Link to post
Share on other sites

Hi Rocky,

Looking for a code change to enable:

Example:

In the horizontal menu, I have three main categories.

Main Category 1! Main Category 2! Main Category 3

After clicking the Main category 1 appear in the block:

Main Category 1
  - Subcategory 1
      - Sub 11
      - Sub 22
  - Subcategory 2
....



Main categories 2 and 3 are hiding in the block.

Sample code (category-tree-branch.tpl):

>
{if $node.id == $currentCategoryId}

{$node.name|escape:html:'UTF-8'}
   {if $node.children|@count > 0}
</pre>
<ul>
       {foreach from=$node.children item=child name=categoryTreeBranch}
           {if $smarty.foreach.categoryTreeBranch.last}
                       {include file=$tpl_dir./category-tree-branch.tpl node=$child last='true'}
           {else}
                       {include file=$tpl_dir./category-tree-branch.tpl node=$child last='false'}
           {/if}
       {/foreach}
</ul>
<br>   {/if}<br><br>{/if


This works only for $node.id = = $currentCategoryId. When I click the subcategory everything disappears - this is correct. This is in the condition.
But How to modify this code after clicking on the Subcategory 1 or Sub 11 display remained the Main categories 1 (for more than 2 levels).

Thank you for your advice

Share this post


Link to post
Share on other sites

This sounds difficult. I think you could do this by searching through the parents of the current category until you reach parent category 1 (the "Home" category) then save the ID as the main category ID in the blockcategoriesaccordion.php, then pass it into the blockcategoriesaccordion.tpl. To do this, change lines 196-197 of blockcategoriesaccordion.php from:

if (isset($_GET['id_category']))
   $smarty->assign('currentCategoryId', intval($_GET['id_category']));



to:

$currentCategoryId = 0;
$mainCategoryId = 0;

if (isset($_GET['id_category']))
   $currentCategoryId = intval($_GET['id_category']);

$smarty->assign('currentCategoryId', $currentCategoryId);

if ($currentCategoryId > 1)
{
   $id_category = $_GET['id_category'];

   do
   {
       $category = new Category($id_category);
       $id_parent = $category->id_parent;

       if ($id_parent == 1)
           $mainCategoryId = $id_category;
       else
           $id_category = $id_parent;
   }
   while ($mainCategoryId == 0);
}

$smarty->assign('mainCategoryId', $mainCategoryId);



Then change lines 12-16 in blockcategoriesaccordion.tpl from:

{if $smarty.foreach.blockCategTree.last}
   {include file=$branche_tpl_path node=$child i=$i last='true'}
{else}
   {include file=$branche_tpl_path node=$child i=$i}
{/if}



to:

{if $smarty.foreach.blockCategTree.last}
   {include file=$branche_tpl_path node=$child i=$i mainCategoryId=$mainCategoryId depth=1 last='true'}
{else}
   {include file=$branche_tpl_path node=$child i=$i mainCategoryId=$mainCategoryId depth=1}
{/if}



Then you could replace the first line category-tree-branch.tpl with the following:

{if $mainCategoryId == 0 OR $node.id == $mainCategoryId OR $depth > 1}



and change lines 9-11 from:

{if $smarty.foreach.categoryTreeBranch.last}
   {include file=$branche_tpl_path node=$child i=$i last='true'}
{else}
   {include file=$branche_tpl_path node=$child i=$i last='false'}
{/if}



to:

{if $smarty.foreach.categoryTreeBranch.last}
   {include file=$branche_tpl_path node=$child i=$i mainCategoryId=$mainCategoryId depth=$depth+1 last='true'}
{else}
   {include file=$branche_tpl_path node=$child i=$i mainCategoryId=$mainCategoryId depth=$depth+1 last='false'}
{/if}



and put the following at the end:

{/if}

Share this post


Link to post
Share on other sites

Thank you

I will try to make a change.

Just have a small question.

Where to insert this code in the file blockcategoriesaccordion.php?:

       $id_category = $currentCategoryId;
   $mainCategoryId = 0;

   do
   {
     $category = new Category($id_category);
     $id_parent = $category->id_parent;

     if ($id_parent == 1)
       $mainCategoryId = $id_category;
     else
       $id_category = $id_parent;
   }
   while ($mainCategoryId == 0);

   $smarty->assign('mainCategoryId', $mainCategoryId);

Share this post


Link to post
Share on other sites

After the code change to:

for blockcategoriesaccordion.php line 190 from:

   if (isset($_GET['id_category']))
       $smarty->assign('currentCategoryId', intval($_GET['id_category']));


to:

   if (isset($_GET['id_category']))
       $currentCategoryId=intval($_GET['id_category']);



for category-tree-branch.tpl line 1 from:

{if $mainCategory == 0 OR $node.id == $mainCategoryId OR $depth > 1}


to:

{if $mainCategory != 0 OR $node.id == $mainCategoryId OR $depth > 1}



for blockcategoriesaccordion.php line 195 - 212 from:

   if ($currentCategoryId > 1)
   {
       $id_category = $_GET['id_category'];

       do
       {
           $category = new Category($id_category);
           $id_parent = $category->id_parent;

           if ($id_parent == 1)
               $mainCategoryId = $id_category;
           else
               $id_category = $id_parent;
       }
       while ($mainCategoryId == 0);
   }

   $smarty->assign('mainCategoryId', $mainCategoryId);


to:

   if ($currentCategoryId > 1)
   {
       $id_category = $_GET['id_category'];

       do
       {
           $category = new Category($id_category);
           $id_parent = $category->id_parent;

           if ($id_parent == 1)
               $mainCategoryId = $id_category;
           else
               $id_category = $id_parent;
       }
       while ($mainCategoryId == 0);
   }

   $smarty->assign('mainCategoryId', $mainCategoryId);
   $cookie->last_visited_category = intval($_GET['id_category']);
   $smarty->assign('currentCategoryId', intval($_GET['id_category']));




Menu starts work.

The problems is:
1) After a long time in the menu - everything stops working (does not generate categories).
I must to uninstall the module. and Reinstall.

Any Idea?

Thank you

Share this post


Link to post
Share on other sites

I finally found time to test my code. I make a couple of simple mistakes. I've updated my code here. Try it again. It appears to be working on my test site.

Share this post


Link to post
Share on other sites

Hi,

Block displays all the main categories.

Must be changed:

{if $mainCategory == 0 OR $node.id == $mainCategoryId OR $depth > 1}


to:

{if $mainCategory != 0 OR $node.id == $mainCategoryId OR $depth > 1}



If you click on the product in category or featured products.
Menu is hidden.

Example: - Click on the product in Main category 1 -> Subcategory 1
Result: - Menu is hidden.

Correct result has to be:

Main Category 1 
   [b]-Subcategory 1[/b] 
        -Sub 11 
        -Sub 22 
   -Subcategory 2 
   -Subcategory 3



Thank you

Share this post


Link to post
Share on other sites

No, it is impossible to collapse a category without clicking on another on the same level in both my free and paid modules.

Share this post


Link to post
Share on other sites
  • 3 weeks later...

For legal reasons, I can't upload my module to this topic. The only place you can download this free module is on the "Download" tab of my AJAX Sliding Categories page here.

Share this post


Link to post
Share on other sites
  • 4 weeks later...

HI ROCKY
There are two questions.
One is: can i add product numbers after the category name?
The other is:when mouse hover,the subcategories is displayed,and when the mouse left,the subcategories is also displayed.i want it chosed when the mouse left.Is is possible to do it?

Thank you for you help.

Share this post


Link to post
Share on other sites

It is not possible to add product numbers with my free category module, but it is with my paid category module here.

It is not possible to collapse categories using this module. In my paid module, I have the option to display the +/- buttons like in the original category module to get around this issue. The jQuery Accordion plugin I'm using doesn't have to option to collapse the accordion, so I'd have to manually write code to do this. It's on my list of things to do.

Share this post


Link to post
Share on other sites
  • 2 weeks later...

It is not possible with this module. The jquery.accordion.js doesn't support it. I'd have to write this myself. I'm not adding any more features to this module, since it has been superceded by my AJAX Sliding Categories module. I'll add this request to my list of features for the next version, which already has the request to click on an expanded category to collapse it again.

Share this post


Link to post
Share on other sites

Hello Rocky,

I am using this fantastic module in my shop.

Is there any way to solve the following problems?

- When I select a family and I want't to display the next page of products, the tree is closed and the client may be a bit lost.
- The opposite happens when selecting any tab of the footer, since it leaves open the whole tree.

Thanks

Share this post


Link to post
Share on other sites

I can reproduce the bug in the second screenshot in this module. It also exists when "Dynamic" mode is disabled in my AJAX Sliding Categories. I never noticed it before since everyone turns on "Dynamic" mode to improve the speed of their websites. I'll have a look at this issue. It looks like I need to remove the query strings from the URL before comparing it to the category URLs.

In the fourth screenshot, it is likely that there is a Javascript error that is preventing the accordion from loading.

Share this post


Link to post
Share on other sites

It's one of many features I added to my AJAX Sliding Categories module to differentiate it from this free module. When it is turned on, only the top-level categories are loaded initially and subcategories are loaded only when needed. See my website for a demo.

Share this post


Link to post
Share on other sites

Ok.

In my shop, I use only two level tree, do you think it would be advisable to use the AJAX Sliding Categories module?
What would benefit?

On the other hand, you plan to solve the bug's that I've commented on Sliding Accordion Categories?

Thank you

Share this post


Link to post
Share on other sites

It depends how many subcategories you have. If you don't have many subcategories, then there is little benefit to using the AJAX mode. It was designed to allow sites to have a large number of categories with an acceptable page load time. For example, muffler.pl has 1500 categories in three levels. They are using my AJAX Sliding Categories module to make this possible. It would take minutes to load the page using the category module that comes with PrestaShop.

The AJAX is the main feature of the module, so if you don't need it, then you probably don't need the module, unless one of the other features in the module like adding the number of products in each category (and its subcategories) next to each category name, hiding empty categories, starting with a category open or displaying only the subcategories of the current category interests you.

Share this post


Link to post
Share on other sites
  • 2 months later...

This module is translatable. I just checked and found this line:

{l s='Categories' mod='blockcategoriesaccordion'}



You should be able to go to Tools > Translations, select "Module translations" in the dropdown, click a flag, then scroll down to the "prestashop - blockcategoriesaccordion" section to translate the module.

Share this post


Link to post
Share on other sites
  • 3 months later...

v2.0 is now available

It uses the new jQuery UI Accordion to allow the option to make subcategories collapsible, and has been redesigned for PrestaShop v1.4. It now uses a color picker to select the highlight colour.

Share this post


Link to post
Share on other sites
  • 1 month later...
You can see a screenshot of the configuration page and a demo of the module with the AJAX feature enabled on my site here. My paid module is based on this free one, so this module also serves as a demo of what the module is like.

After getting some much-needed sleep, I realised that it is actually quite easy is make the categories collapse. I think all you need to do is replace lines 94-97 of blockcategoriesaccordion.tpl with:

{*        navigation: true,*}
       event: {$event},
       animated: {$animation}{*{literal},
       navigationFilter: function() { return containsChild(this); }*}{literal}



This will comment out the navigation code that makes the categories stay open. If this is all you want and you don't want any of the features in my paid module, then this should work for you.



This is exactly what I would like to do, on mouse off for the categories to collapse back to the parent, I tried to do what you said with the code above and it really did not change anything.. see this code below.. also dreamweaver said there was a syntax error on line 29..

[removed][removed]
[removed][removed]
[removed][removed]

<!-- Block categories accordian module -->

{l s='Categories' mod='blockcategoriesaccordion'}


       {counter assign=i}
       {foreach from=$blockCategTree.children item=child name=blockCategTree}
           {if $smarty.foreach.blockCategTree.last}
                       {include file=$branche_tpl_path node=$child i=$i last='true'}
           {else}
                       {include file=$branche_tpl_path node=$child i=$i}
           {/if}
       {/foreach}

    


{counter assign='num_accord'}
{assign var='num_accord' value=$num_accord-1}

{literal}
[removed]

var locationhref = location.href.toLowerCase();
var currentcat = {/literal}{if $currentCategoryId}{$currentCategoryId}{else}null{/if}{literal};

if (locationhref.indexOf('product.php') != -1)
{
   if (document.referrer.indexOf('category.php') != -1)
       locationhref = document.referrer;
   else
       locationhref = location.href.toLowerCase().substring(0, location.href.lastIndexOf('/')) + '/category.php?id_category={/literal}{$currentCategoryId}{literal}';

   if (locationhref.indexOf('&') != -1)
       locationhref = locationhref.substring(0, locationhref.indexOf('&'));

   currentcat = locationhref.substring(locationhref.indexOf('id_category') + 12);
}

$('a#cat' + currentcat).css({color: '{/literal}{$highlight}{literal}'});

function containsChild(child)
{
   var foundChild = false;
   var UL = child;

   while ((UL = UL.nextSibling) != null)
       if (UL.nodeName == 'UL')
           break;

   if (UL != null)
   {
       var nextLI = null;

       if (UL.childNodes != null)
           nextLI = UL.childNodes[0];

       while (nextLI != null)
       {
           if (nextLI.nodeName == 'LI')
           {
               var nextA = null;

               if (nextLI.childNodes != null)
                   nextA = nextLI.childNodes[0];

               while (nextA != null)
               {
                   if (nextA.nodeName == 'A')
                       foundChild = (foundChild || containsChild(nextA));

                   nextA = nextA.nextSibling;
               }
           }

           nextLI = nextLI.nextSibling;
       }
   }

   return (foundChild || child.href.toLowerCase() == locationhref);    
}

jQuery().ready(function(){
{/literal}
   {section name=accord loop=$num_accord}
   {literal}jQuery('#acc{/literal}{$smarty.section.accord.iteration}{literal}').accordion({
       active: {/literal}{$active},
       autoheight: {$height},
       header: '.acc{$smarty.section.accord.iteration}',
{*        navigation: true,*}
       event: {$event},
       animated: {$animation}{*{literal},
       navigationFilter: function() { return containsChild(this); }*} {literal} 
   });{/literal}
   {/section}
{literal}    
});
[removed]
{/literal}

<!-- /Block categories accordian module -->



above is the code, the site is: www.ledlites4rvs.com Please advise. We will donate and will probably upgrade eventually but I have to wait for approved budget.

Share this post


Link to post
Share on other sites

Sorry, I can't do that with the old accordion for jQuery v1.2.6. You will need to upgrade to PrestaShop v1.4 to use the jQuery UI accordion, which has the option to collapse categories on mouse click or mouse hover. Even it doesn't have the option to automatically collapse all categories when the mouse moves off the category block. I'd have to code that myself.

Share this post


Link to post
Share on other sites

Hi,

I'm considering buying the module AJAX Sliding Categories v3.0.4 for my PS 1.3.7. My question is; in the demo in your store I see that clicking on a category opens up a list of subcategories. But does it also at the same time go to the main category's page? If not then how does one navigate to the main category page? Can a link called all products be added to the subcategory list? Is there a site that uses this module that I can look at?

Regards,
Dan

Share this post


Link to post
Share on other sites

I don't understand why so many people want to load subcategories and navigate to the main category at the same time. If you do that, the page will reload before the subcategories have had a chance to load, making it unnecessary to even load them. You may as well disable the AJAX option and just use the "Hide sub-subcategories" option, so that only the top-level categories are displayed.

My module also has the option to load subcategories on mouse hover instead of mouse click, so you can load subcategories by moving the mouse over a main category, then click the main category to go directly to it. Otherwise, the only way to go to a main category is to choose a subcategory, then click the main category in the breadcrumb bar. You can see my AJAX Sliding Categories module in use this way at muffler.pl.

Share this post


Link to post
Share on other sites

Thanks for the fast reply. I understand your reasoning.

Are you of the opinion then that it's not important for the customer to be able to easily/intuitively navigate to the products under the main category?

Is creating a subcategory called All Products for each category that has subcategories, and adding all products in the category to it a good solution?

Also is there an option to click on the category to close the list as opposed to clicking on another category and the previously opened one closing automatically?

Share this post


Link to post
Share on other sites

Rocky, I bought and installed your module. It looks to be working fine except when clicking on a category starting from the store home page it looks like in the attachment.

If I first click on another category that doesn't have subcategories, then click on a category that does, there is no overlapping effect. How can this be fixed?

39699_QJ1NFdW56Ud9oLWDtirJ_t

Share this post


Link to post
Share on other sites

I've never seen that before. Can you please send me a link to your website so I can investigate?

Yes, I think adding an "All products" link is an acceptable solution if you want customers to be able to view all products in a main category.

The PrestaShop v1.4 version of the module has the option to let you collapse categories, since it uses jQuery UI for the accordion. The PrestaShop v1.3.x version doesn't though, since I couldn't find an accordion compatible with jQuery v1.2.6 with that option.

Share this post


Link to post
Share on other sites

Thanks.

I changed the setting Dynamically load - Load sublevels only when needed (reduces load time when there are many sublevels) to No (red X) and this appears to have solved the problem. I'm good with that as I don't think I'll ever have so many sub-levels in this shop. I want to bring to your attention that selecting a few other module settings in back office creates the same problem. If you need to know I can play with it again and tell you which ones they were. Fortunately I only need the basic functionality of this module.

The only other thing I'd like to know is how to change the selected category color which is green. I'm not talking about the subcategory selected color, I see there's an option for that in the module settings.

Share this post


Link to post
Share on other sites

I don't understand why the spacing is different, since the module uses your theme's CSS. You must change the /* Block categories */ section of global.css. Here's the part that controls the green colour:

div#categories_block_left ul.tree a.selected {
   color: #488c40;
   font-weight: bold
}



Change #488c40 to the colour you want.

Share this post


Link to post
Share on other sites

Thank you very much for that information. Please disregard my nonsense about spacing, my eyes must be getting tired. However if I did want to reduce the space between the categories where would I change the code?

Share this post


Link to post
Share on other sites

Rocky,

Can you please tell me where to change the code for the subcategory text to be the same size and weight as the category text?

Thanks,
Dan

Share this post


Link to post
Share on other sites

To decrease the height of the categories, edit the following code in global.css:

div#categories_block_left ul.tree li {
   border: none;
   padding-top: 5px;
   padding-left: 15px;
   background: none;
   margin-left: 0;
   font-weight: bold;
   font-size: 13px;
   line-height: 13px
}



You can reduce the padding-top here to reduce the height of the category.

I think it may be confusing to have the subcategories the same size as the main categories, but you can make the subcategories the same size and weight as the main categories, change the following code in global.css:

div#categories_block_left ul.tree li ul { padding: 2px 0 0 }
div#categories_block_left ul.tree li ul li {
   padding: 1px 0 1px 15px;
   background: none;
   font-size: 11px;
   font-weight: normal
}
div#categories_block_left ul.tree li ul li.last { padding-bottom: 0 }
div#categories_block_left ul.tree li ul li ul li {
   padding-left: 15px;
   font-size: 9px
}



Remove the font-size and font-weight lines.

Share this post


Link to post
Share on other sites

Dreamweaver is saying there is a syntax error on line 29 of blockcategoriesaccordion.tpl file.

I can not tell what that is.

Here is the line of code:

var currentcat = {/literal}{if $currentCategoryId}{$currentCategoryId}{else}null{/if}{literal};

any ideas.. I am having problems with mine not working on home page but works on other pages sometimes.. ???
http://www.ledlites4rvs.com
any suggestions?

Thanks, Tina

Share this post


Link to post
Share on other sites
Dreamweaver is saying there is a syntax error on line 29 of blockcategoriesaccordion.tpl file.

I can not tell what that is.

Here is the line of code:

var currentcat = {/literal}{if $currentCategoryId}{$currentCategoryId}{else}null{/if}{literal};



any ideas.. I am having problems with mine not working on home page but works on other pages sometimes.. ???
http://www.ledlites4rvs.com
any suggestions?
It is like it is really corrupted.. I did not change anything.

In the process found one more error when doing final checks:

jQuery("ul.sf-menu").superfish is not a function

(?)()superf...fied.js (line 123)
F()jquery....min.js (line 19)
$(G=[function(), function(), function(), function()], K=function(), F=undefined)jquery....min.js (line 12)
G = [function(), function(), function(), function()]
K = function()
F = undefined
F()jquery....min.js (line 19)
F()jquery....min.js (line 19)
[break On This Error] jQuery('ul.sf-menu').superfish(); 



Thanks, Tina

Share this post


Link to post
Share on other sites

There is no error. Dreamweaver doesn't understand Smarty code and is interpreting it as JavaScript. You can ignore it.

The JavaScript error is in the third-party menu module you are using, not my module. I see you are using an old version of the module. I suggest upgrading to the latest version v2.6 version here.

Share this post


Link to post
Share on other sites

Hello,

I have installed the accordion product menu V1.6.1, it woks fine without with friendly url.
I have seen a post with a change to do in \class\product.php and in the Blockcategories accordion.tpl but nothing change.
when I display the produt-list in the screen the url is:

http://127.0.0.1/prestashop/lang-en/15-the-honey-candies

and the menu works fine and show me the subcategory and highlight the name of the subcategory, but
when I clic in the photo to go in the product page the url change like that :

http://127.0.0.1/prestashop/lang-en/honey-of-alcornocales/44-candies-with-honey-and-eucalyptus.html

please can u help me to find something to modify who can works.

thank you very much

Share this post


Link to post
Share on other sites

I'm not sure that I understand. Are you saying that clicking on a product from a category displays a different category in the URL? That's normal if the product is in multiple categories and you click on a product from a category different to the default category. That's the way PrestaShop works. It's a pity your website is on localhost. I can't check it out for myself.

Share this post


Link to post
Share on other sites

Thanks for answerring (i'm french - sorry from my language)

No, i said when you click on a category in the accordion menu, the menu expand showing all the subcategories.
after, you click on a subcategory to display it at the screen.
(-> You cau see the product-list page of the subcategory displayed and the menu "current" is highlighted) - since there it,s ok.

the url shown is : http://127.0.0.1/prestashop/lang-en/17-assortments

after , you click on one of the product to display the product page (product.php) and the url change by :
http://127.0.0.1/prestashop/lang-en/pastries/24-assortment-of-arabic-pastries-with-honey.html (normal because friendly url activated)

and the accordion menu close and highlight just the category of the menu but no the subcategory selected.

sorry for my explaination.

Share this post


Link to post
Share on other sites

So you mean the selected category isn't staying open when you navigate to a product with friendly URLs turned on? I think it's an old bug that has been fixed in my AJAX Sliding Categories module a long time ago. Unfortunately, I'm not sure how I fixed it. I'd have to spend time figuring out how and whether it could be backported. Since this is a free module, it has low priority. My paid modules have higher priority.

Share this post


Link to post
Share on other sites

i send you two photos

the product-list.jpg is where the menu works fine showing the good subcategory and highlight the selected

and the second photo you go to the product page and the menu close and highlight just the category ...

40034_miARcs8mnYEijv66k4Zh_t

40035_V1OUTaPTcHxlzXoDIuBP_t

Share this post


Link to post
Share on other sites

Yes i think the problem is there because in the product-list i ve got the friendly url for the SUBCATEGORY :

http://127.0.0.1/prestashop/lang-en/15-the-honey-candies

and when i go to the product page (in the same SUBCATEGORY) , i ve got :

http://127.0.0.1/prestashop/lang-en/the-honey-candies/44-candies-with-honey-and-eucalyptus.html

and the menu close...

there is a difference between the first : 15-the-honey-candies and the second: the-honey-candies

i think it need to modify something in the menu to donĀ“t look at the number before the name ...