Jump to content

How can I show manufacturers in an specific order


Recommended Posts

Hello everybody

Im new in this i hope you can help me with this.

Manufacturers in my store, appears in alphabetical order, i would like them to set in a specific order (relevance/importance in my case)

I have solved this issue on CATEGORIES (giving them a specific order non-alphabetical) by typing "01." "02." "03." without spaces before each new category. for example:

01.SHOES
02.PANTS
03.SHIRTS

but in the frontpage the "01." "02." "03." appear hidden, so it only shows the category in the order i wanted:

SHOES
PANTS
SHIRTS

But this process doesnt not work in Manufacturers.

Can you please Help me?

Thank you so much

Share this post


Link to post
Share on other sites

Try changing lines 56-58 of supplier.php in the root directory of PrestaShop from:

foreach ($data AS &$item)
   $item['image'] = (!file_exists($imgDir.'/'.$item['id_'.$objectType].'-medium.jpg')) ? 
       Language::getIsoById(intval($cookie->id_lang)).'-default' :    $item['id_'.$objectType];



to:

foreach ($data AS &$item)
{
   $item['image'] = (!file_exists($imgDir.'/'.$item['id_'.$objectType].'-medium.jpg')) ? 
       Language::getIsoById(intval($cookie->id_lang)).'-default' :    $item['id_'.$objectType];
   $item['name'] = Category::hideCategoryPosition($item['name']);
}



This should let you the same 01., 02., etc prefixes on manufacturers.

Share this post


Link to post
Share on other sites

I just tested the code and it is working on the manufacturer page, but not the manufacturer block. Try instead changing lines 187-191 of classes/Manufacturer.php from:

for ($i = 0; $i < sizeof($manufacturers); $i++)
   if (intval(Configuration::get('PS_REWRITING_SETTINGS')))
       $manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false);
   else
       $manufacturers[$i]['link_rewrite'] = 0;



to:

for ($i = 0; $i < sizeof($manufacturers); $i++)
{
   if (intval(Configuration::get('PS_REWRITING_SETTINGS')))
       $manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false);
   else
       $manufacturers[$i]['link_rewrite'] = 0;
   $manufacturers[$i]['name'] = Category::hideCategoryPosition($manufacturers[$i]['name']);
}



This should work for both the manufacturer page and block.

Share this post


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

Thank you soooo muchhh!!!

Now its working, it's so nice to have your support. Thanks again.

I have a quick issue, i want to change and i dont know where:

Its the word "search" in the search bar, it almost dissapear because this word has a dark gray color, over a black background, where can i change this color to white por example?

I hope you can help me with this, its the last thing i need to edit.

Thank you.

Jose

Share this post


Link to post
Share on other sites

I'm not sure exactly which "Search" you mean. Do you mean the button on the search block? Can you provide a link to your site so I can see what you mean?

Share this post


Link to post
Share on other sites

Sure, the URL is:
http://www.telecuador.net/ps

At the top left you will find a box with "BUSCAR" ("search" in english) the black box at its left you can put the words or keywords you are looking for search, That input text you type is in a dark gay color, almost dissapear from the black box background, so that text i want to change the color.

Attached you will find a screen capture where i have the problem.

Thanks for your time.

Jose

31179_dBN5YEJwY2ETIfiyRadv_t

Share this post


Link to post
Share on other sites

Change line 806 of themes/theme006/css/global.css from:

#header_right #search_block_top input#search_query { margin:0; border:solid 1px #2e2e2e; background:#0a0a0a; width:161px; font-size:11px; color:#3b3b3b; padding:4px 5px 3px 7px; vertical-align:middle; font-family:Arial, Helvetica, sans-serif;}



to:

#header_right #search_block_top input#search_query { margin:0; border:solid 1px #2e2e2e; background:#0a0a0a; width:161px; font-size:11px; color:#fff; padding:4px 5px 3px 7px; vertical-align:middle; font-family:Arial, Helvetica, sans-serif;}



This should change the text colour to white.

Share this post


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

hello,

 

Regarding manufacturers order; How to change it from alaphabeticall to by number of products descending???

 

Regards,

 

Steven

Share this post


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

I just tested the code and it is working on the manufacturer page, but not the manufacturer block. Try instead changing lines 187-191 of classes/Manufacturer.php from:

 

to:

 

for ($i = 0; $i < sizeof($manufacturers); $i++)
{
if (intval(Configuration::get('PS_REWRITING_SETTINGS')))
	$manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false);
else
	$manufacturers[$i]['link_rewrite'] = 0;
$manufacturers[$i]['name'] = Category::hideCategoryPosition($manufacturers[$i]['name']);
}

 

This should work for both the manufacturer page and block.

 

Hi,

 

I've tried to adapt this trick for Prestashop 1.5:

 

replacing in lines 221 (classes/Manufacturer.php)

 

 

$total_manufacturers = count($manufacturers);
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS');

for ($i = 0; $i < $total_manufacturers; $i++)
if ($rewrite_settings)
$manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false);
else
$manufacturers[$i]['link_rewrite'] = 0;

return $manufacturers;
}

 

by

 

 

$total_manufacturers = count($manufacturers);
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS');

for ($i = 0; $i < $total_manufacturers; $i++)
if ($rewrite_settings)
$manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false);
else
$manufacturers[$i]['link_rewrite'] = 0;
$manufacturers[$i]['name'] = Category::hideCategoryPosition($manufacturers[$i]['name']);

return $manufacturers;
}

 

But it doesn't work: the 01. 02. 03..in front of the manufacturer's names are still visible. Did I miss something?

 

Thank you!

Share this post


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

hi friends...

 

how we can have an alphabetical bar ( A to Z ) in first page ,so for example when users click on "A" we direct them to manufacturers that their name start with "A". it mean we must filter manufacturers with "A" Key or we can use javascript codes to scroll Manufacturers page to specified char for example "G" ...

 

the looks codes are HTML ( A to Z ) and hyperlinks ,but what are the backend codes ? is it requirement to create a module or we can do this without creating module with simple java script codes in themplate files ??

 

i appreciate you help me about that..

Share this post


Link to post
Share on other sites
  • 9 months later...
  • 1 year later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More