Jump to content

[FREE TUTORIAL] Displaying Prestashop manufacturers in alphabetical groups


NemoPS

Recommended Posts

Hey everybody! I just wrote a short tutorial about turning the default manufacturers/suppliers display to something split by letter/number.

Here is the tutorial link: http://nemops.com/al...-manufacturers/

Here is the final result: and here is the final result:

manufacturers_styling.png

 

Hope you like it!

 

Cheers! :)

Edited by Nemo1 (see edit history)
  • Like 6
Link to comment
Share on other sites

  • 1 month later...

Me2 Looking for the same.

 

Any help?

 

So far i created a new field in DB which has the first letter of the manufacturer.

 

But how can i group based on that when it's clicked?

 

please insert an screen shot of your module situation that we can see the changes you made..

Link to comment
Share on other sites

  • 3 weeks later...

any body hasn't any idea about alphabetical bar ? like the attached image?

i want to index manufacturers by alphabetical chars in home page , so when users click on specified chars i direct theme to manufacturers that start with specifed chars.

in other words i want to filter manufacturers by their start letter.

 

i created an special topic for this subject but i havent any post on that topic yet!!!

post-453141-0-76128600-1360246008_thumb.jpg

Link to comment
Share on other sites

Hi there,

Well, you can create something like this:

foreach letter add a link to the manufacturers page, and append something like "#letter_k".

In the manufacturers list, add id="letter_k" the the K letter title, and when the user clicks there, the browser loads the page and skips to that id.

 

it should work ;) If you want something cleaner and smooth, you should use the onhashchange event of html5 with some JS ;)

Link to comment
Share on other sites

  • 4 months later...
  • 1 year later...

I have tried this in the newest version 1.6.09 and I am having issues getting this to work. In the newest version, are we still using the same file manufacturer-list.tpl? Once, I add the code, do I need to clear cache or recompile somehow. When I add the code, I looked at the DOM to see if I can view the class <li class="alphabetical"> and it does not appear.

Edited by kdmonk1 (see edit history)
Link to comment
Share on other sites

It depends, if you are not compiling templates as preference option, yes, you need to clear the cache. As far as I know it's the same file

Hi Nemo1, I just tried again and this time I change the settings to force compilation and clear cache. Still does not work. So I deleted the contents of theme/default-bootstrap/manufacturer-list.tpl, loaded it back up and the manufacturer list is still working. Apparently this is not the same file. Has anyone figured out where the new file is for 1.6?

Link to comment
Share on other sites

It's that one

		if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToShop())
		{
			$this->productSort();
			$this->assignOne();
			$this->setTemplate(_PS_THEME_DIR_.'manufacturer.tpl');
		}
		else
		{
			$this->assignAll();
			$this->setTemplate(_PS_THEME_DIR_.'manufacturer-list.tpl');
		}

I know it sounds strange but are you sure you are editing the correct template?

Link to comment
Share on other sites

It's that one

		if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToShop())
		{
			$this->productSort();
			$this->assignOne();
			$this->setTemplate(_PS_THEME_DIR_.'manufacturer.tpl');
		}
		else
		{
			$this->assignAll();
			$this->setTemplate(_PS_THEME_DIR_.'manufacturer-list.tpl');
		}

I know it sounds strange but are you sure you are editing the correct template?

Hi Nemo1, I sent you a private link with the url. The file I loaded out has the changes that I took from your example. Its crazy that I deleted everything inside the file and the list still works. Any thoughts on why this change is not happening? What file are you looking at in the example above? Maybe my file is showing something different.

Link to comment
Share on other sites

That snippet is taken from the manufacturercontroller. I know it sounds strange but you should consider the hypothesis you are editing the wrong template. If you open that controller and write some garbage in like

 

 

34235434cxvxc

 

 

Just to break it, does the manufacturer page break?

Link to comment
Share on other sites

  • 1 year later...
  • 9 months later...
  • 3 months later...
  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...