Jump to content

[FREE PRESTASHOP MODULE ] Products in categories as LIST OR GRID using jQuery for PS1.3 and PS1.4


jolvil
 Share

Recommended Posts

No sorry

Hi Jovil,

Maybe you can tell me, how i can use my own css when click in grid style?

Just a simple function to change css

I think for example would have (product-list.css and product-grid.css), to do yet more simple use 2 icons (list icon and grid icon) And you and you can imagine what my point.

- Click on grid icon then show product-grid.css

- Click on list icon then show product-list.css

I dont know lot of js, could you give me some clue?, thanks in advanced.

Share this post


Link to post
Share on other sites

As I'm cleaning all css-errors on my template, I found some for this module too, but I don't how to fix... Please can somebody help ?

 

.listorgridswitch a:hover.switch_but - Parse Error opacity=75)

.listorgridswitch a:hover.switch_but - Property opacity doesn't exist in CSS level 2.1 but exists in [css3] : 0.75

.listorgridswitch a:hover.switch_but - Property -ms-filter doesn't exist: "progid:DXImageTransform.Microsoft.Alpha(Opacity=75)" ul.sw_view#product_list li .new - Value Error : padding-left Too many values or values are not recognized : 0 0.4em

Share this post


Link to post
Share on other sites

yes there is a little mistake in this line

ul.sw_view#product_list li .new - Value Error : padding-left Too many values or values are not recognized : 0 0.4em 

css file is probably not perfect and should be adjusted according to your theme.

I made little changes in CSS files fixing "NEW" display issue.

1.8 archive is modified

Share this post


Link to post
Share on other sites

i installed the module as u said in /"readme" and is not working for me, im using prestashop 1.4.7 and using the default theme :S

 

just the link/image to click and change the view, dont appear

Share this post


Link to post
Share on other sites

Hello chetwyn, i have installed this module but have a little problem, i think with css from my theme, i use the new them prestashop 1.4.5, can see here, the problem is in sort-list, best-sales or search result don't show fine, in product-list i can see very well, anything category show very well, can you halp me?

This my store

 

Hi aQs this qeury is not related to this topic - i have seen your site "cotoko.com". its really good. even i am working on same presto theme. but i am unable to get the kind of layout and modules you are using.. can you pls help in giving the information how u did it. if i ask u few questions?

Share this post


Link to post
Share on other sites

Hi aQs this qeury is not related to this topic - i have seen your site "cotoko.com". its really good. even i am working on same presto theme. but i am unable to get the kind of layout and modules you are using.. can you pls help in giving the information how u did it. if i ask u few questions?

So... what exactly you need?

Share this post


Link to post
Share on other sites

So... what exactly you need?

 

 

1. Which module you are using in menu categery vertical slide out?

2. How did u get the centre top (in the header) search module?

3. How did you do it - The right column is removed and the products are listed (in grid form) till the right end. What is the method / module / code to do it?

Share this post


Link to post
Share on other sites

well, i found my error already, but now i've another problem... when i try to see Grid as first view, i cant do it, my prestashop is 1.4.7 and i just copied "Cookie.php" on override/classes, but nothing happen (still looking first the list, instead the grid) :S

 

some1 could help me pls?

 

btw... when i install this module, my "blocklayered" module isnt working anymore... thats not good :S

Share this post


Link to post
Share on other sites

Hi,

I have installed the module, thanks a lot jolvil for this one, on localhost wamp and the only problem I have is the fact that pagination is not working anymore, not being clickable.

Any solution fo this ?

Regards,

 

EDIT : I noticed that some of the links are working some redirecting to the right place some not, for ex clicking on the "<<" to go to first listing page is redirecting to previous instead.

Product display are set to 9 and the them is derived from default but simplified.

In post#7 I've seen that I should have clear: both in .css, it is probably about global.css and pagination.tpl section but where to add it ?

[sOLVED] it was a css property setting, ul.sw_view#product_list li div.right_block with a 75px height.

I have reduced it to 25 and voila, it works!

Share this post


Link to post
Share on other sites

One small problem though with default grid view, it is appearing after a very brief delay (2 secs) in which passes through the list view.

So, when you click on category it first displays the list vie for about 2 secs and then it changes to grid view which is set by default with coockie.php in override.

Anyone encountered this issue ?

Regards,

Share this post


Link to post
Share on other sites

well, i found my error already, but now i've another problem... when i try to see Grid as first view, i cant do it, my prestashop is 1.4.7 and i just copied "Cookie.php" on override/classes, but nothing happen (still looking first the list, instead the grid) :S

 

some1 could help me pls?

 

btw... when i install this module, my "blocklayered" module isnt working anymore... thats not good :S

 

i wanna change "Switch view" text but i dont see where i gotta change it, i search in all the css/php files of listgridswitch and nothing, some1 know how to?

Share this post


Link to post
Share on other sites

1. Which module you are using in menu categery vertical slide out?

2. How did u get the centre top (in the header) search module?

3. How did you do it - The right column is removed and the products are listed (in grid form) till the right end. What is the method / module / code to do it?

1.- Its a free module, see this link, http://www.prestashop.com/forums/topic/10394-module-menu-deroulant-vertical-v06/page__hl__tom06__fromsearch__1

2.- Just use position:absolute; in css from module and test you best position with top:XXpx; and left:XXpx; (emplace XX width numbers, test you best position)

3.- In global.css from you theme search right colum and type display:none;

Share this post


Link to post
Share on other sites

  • 2 weeks later...

Hi Jolvil,

Thanks for the great module. I use grid as the default view. I had the same issue with tdr170 (right block moves to the center block below the list of manufacturers) and it has been solved thanks to the updated version (Listorgrid 1.8). Now when I click on any of manufacturers in the manufacturer list page, the product list from the selected manufacturer appears in list view not in grid.

Is it possible for you to fix this?

 

Thanks in advance and I'm sorry for my English.

Share this post


Link to post
Share on other sites

Thanks Jolvil, I have updated to version 1.9 but the product list from the selected manufacturer still appears in list view not in grid. This module is very helpful, in the meantime I'll use the 1.7 and will disable link to manufacturer list page so visitor will directly taken to product list of desired manufacturer from the link in left block.

Share this post


Link to post
Share on other sites

...

 

btw... when i install this module, my "blocklayered" module isnt working anymore... thats not good :S

 

I'd like to start by thanking you for the module, its great!

 

But it breaks the layered navigation module that comes with prestashop. The module's requests to the server return 500 errors and I'm pretty sure it has something to do with the changes made to the product-sort.tpl file.

 

btw I've updated to 1.9 and am running Prestashop 1.4.6.2

Share this post


Link to post
Share on other sites

Hi! I´m a beginner at this and need som help with the module. When I removed the View-button in product.tpl the H3-title suddenly moved to the top over the product image. I just want it positioned under the image over the price. I dont know if I have given enough information here. But I really need som help in this matter, thanks!

 

http://www.asplundsp...p?id_category=2

 

Sara

Share this post


Link to post
Share on other sites

NOTE: This module is made to work fine with Prestashop default thème.

You will have to modify css file for use with new_prestashop theme or other personal theme.

 

This module displays products lists (products in category, new products, prices drop, best sales...) by default as a list or as a grid when clicking the switcher using jQuery and css. Tested with PS 1.3.7.0 and PS 1.4.5.1 Original jQuery code from: http://designm.ag/tu...display-switch/

 

List is the default display used in Prestashop theme and with this module.

 

How to display grid as default

They are two ways to display grid as default:

 

- Modify your .css for the default display and modify listorgridswitch.css for the alternate display.

 

- Use cookie:

 

With PS 1.4 copy and paste Cookie.php in override/classes/ folder. That's all !

 

With PS 1.3 in classes/Cookie.php modify fonction _get($key) like this:

 

function __get($key)
{
 if ($key=='listorgridmode' && !isset($this->_content[$key]))
				return 1;
 return isset($this->_content[$key]) ? $this->_content[$key] : false;
}

 

 

Note: No support, ask for help on forum -_-

 

Discussion en français http://www.prestasho...le-avec-jquery/

 

listorgridswitch 1.7

 

NEW ! version 1.7 is done . Now you don't need to make any modification on files, module is going to do it on install and display choice is kept all along customer visit.

 

A great thanks to Doekia who makes it possible.

 

See READ-ME.pdf joined to archive to have more informations about install and resolve issues.

 

If switcher doesn't appers on product-list, try to clear smarty compile

 

UPDATED 16/12/2011 listorgridswitch 1.7

bug fixed with Explorer see: http://www.prestasho...post__p__705956

Number of downloads: 585

 

UPDATED 12/02/2012 listorgridswitch 1.8

Display issue on manufacturer list fixed - see post#95

Number of downloads: 170

If you have listorgridswitch 1.7 you can just modify listorgrid.tpl is like this:

{if $page_name != manufacturer}

..code

{/if}

 

UPDATED 02-03-2012 listorgridswitch 1.9

Bug fix with Switch View text translation fixed

 

post-134-0-11303700-1320998127_thumb.jpg

 

 

Good morning,

I am Spanish and I am using the google translator so do not make much sense if what I say and do not know if I learn well from everything said in this post.

 

I just installed 1.9 on my store listorgridswitch PS 1.4.7 and great except for one thing.

- As I can do to make default display in the list of products colomunas mode.

- And I can do to make Page in multiples of 3 so that the end does not stay only two or one. Right now only leaves 10 or 20 or 30 ... when you would need it to be 9 or 18 or 36, etc ...

 

website if they want to see is www.grizzlysexshop.com

 

thank you very much

 

 

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Hello, i Gave UP ! I've tried an hours to installate this module. I see module in backoffice but images to switch view style doesn't apper. I put switch code ive found on this topic to category.tpl product-sort.tpl ane still nothing. Off cource ive tried to force compilation and clearing smarty compiling catalog.

 

Ive tried to install this on polish stable version 1.4.4.1 and latest official version from prestashop.com.

 

Please help me, im dissapointed, i saw module working on some other guys site and i crazy about this.

 

I will be very glady for help.

Share this post


Link to post
Share on other sites

My site is messed by installing this module...

 

I am using prestashop new theme of 1.4.6.2 ver.

 

1. Layered navigation module stops working

2. The alignment of sort by -- , show --products by page is altered (left aligned)

3. nothing happens by clicking on switch or list icons.

 

 

i have read the forum.

downloaded tpl_for_new_theme.zip & tpl_corregidos.zip

but nothing improved

 

 

Even if i unistall this module my problem remains the same.

 

Kindly anyone get my issue resolved or atleast get my site back to it original state.

 

thanx...

Share this post


Link to post
Share on other sites

 

This module works fine with default Prestashop thème, you must modify css if you want to use with new Prestashop theme or other personal themes.

 

 

Dear Sir

I am using new theme of 1.4.6.2 ver.

there is a alignment problem in these items

switch view ,

sort by---,

show--- products by page

 

these are not aligned horizontally in row.

 

can u pls tell me what code should i edit to rectify this problem

Share this post


Link to post
Share on other sites

I am using New theme ver 1.4.6.2

 

(in the upper grey bar of product list.)

these items are left aligned vertically.

but they need to be aligned horizontally in a row

 

Switch view

Sort by ----

show --- products per page

 

where as in lower bar of product list they are aligned horizontally but overlapping each other.

 

can anybody tell me pls which css file and what code should i edit to rectify this problem?

Share this post


Link to post
Share on other sites

i have tried mozilla firebug for global.css file. I able to align the lower horizontal bar (.sortPagiBar #nbrItemPage)

 

but I am unable to find the option to align the upper bar.

 

can anybody tell me pls which function needs to be edited to align the upper bar?

Share this post


Link to post
Share on other sites

Just thought I would pass on some info as far as the products per page go.

By default the standard is 10, 20, 50 however this can be changed to numbers that work with the grid mode and list mode.

You need to edit FrontController.php in the classes folder, change the numbers as below or any combination of 3 ie 9,18, 54 or 15, 30, 48.

As you can see I chose 12, 24, 57 for my products per page pagination, in this set up there are no blank areas at bottom of page in grid view.

 

Also be sure to go to preferences/products and change products per page to 12 ot what ever number you choose for the default value. (first number)

 

 

 

public function pagination($nbProducts = 12)

{

if (!self::$initialized)

$this->init();

 

$nArray = (int)(Configuration::get('PS_PRODUCTS_PER_PAGE')) != 12 ? array((int)(Configuration::get('PS_PRODUCTS_PER_PAGE')), 12, 24, 57) : array(12, 24, 57);

// Clean duplicate values

$nArray = array_unique($nArray);

asort($nArray);

$this->n = abs((int)(Tools::getValue('n', ((isset(self::$cookie->nb_item_per_page) AND self::$cookie->nb_item_per_page >= 12) ? self::$cookie->nb_item_per_page : (int)(Configuration::get('PS_PRODUCTS_PER_PAGE'))))));

$this->p = abs((int)(Tools::getValue('p', 1)));

  • Like 1

Share this post


Link to post
Share on other sites

Well I decided to give this module another shot and when I installed my main page loaded fine but as soon as I clicked on my products the whole left column went below the center column and the change view buttons did nothing.

So I did a little thinking :unsure: and remembered that I had added the pagination buttons to the top of my products page by adding {include file="$tpl_dir./pagination.tpl"} just below <!-- Products list --> at the top of products-list.tpl.

This mod gives you page buttons at top and bottom or product list, but as soon as I removed this line from the .TPL file the list or grid worked fine.

 

So now I have a choice one or the other but can't have both. :wacko:

 

Just thought I would post so if others read my post on how to add pagination to top of product view pages you will have this issue and its not this module.

Share this post


Link to post
Share on other sites

i have a problem with listorgrid module... i installed it and works fine, but now, my "block layered" module (to filter products) isnt working fine, and i know it's because listorgrid module since i tested it...

 

well, my block layered is installed and aparently works fine, but when u goes to a category and try to filter something, it starts "loading", and never stop/filter anything.

 

I hope u can help me! :)

Share this post


Link to post
Share on other sites

I do follow @Wippi on this problem, unfortunately the blocklayered doesnt work with listorgrid. Does anyone have an way to solve this problem ?

Those 2 modules are great for users.

Share this post


Link to post
Share on other sites

Could anyone help me to get this working on this shop:

 

www.solutionict.nl/upgrade

Prestashop 1.4.7

Custom theme Bought from add ons site.

 

I discovered that the module is installed and visible @ the hooks page but i cannot get it to view it on the pages.

 

Just got it working right now but the css is not right.

Could someone help me with that?

 

Hope to here from someone help trough modifing files or live teamviewer?

Share this post


Link to post
Share on other sites

I confirm that this module don´t is compatible with prestashop 1.5.0.9 default theme

If someone knows what is necessary to modify then say to us please

regards

Share this post


Link to post
Share on other sites

  • 4 weeks later...

Could anyone help me to get this working on this shop:

 

www.solutionict.nl/upgrade

Prestashop 1.4.7

Custom theme Bought from add ons site.

 

I discovered that the module is installed and visible @ the hooks page but i cannot get it to view it on the pages.

 

Just got it working right now but the css is not right.

Could someone help me with that?

 

Hope to here from someone help trough modifing files or live teamviewer?

Hi, i am using the same theme and facing the same problem as you. Have you managed to get it working? Thanks.

Share this post


Link to post
Share on other sites

  • 2 weeks later...

Hi, first...thanks to writer for this module!!!! And the other forum users for the assistance!

Now i have a little problem. Prestashop version is 1.4.8.2, i have correctly installed the module and i see the switch in the page but when i click on it the list dont switch to grid.

Sorry for my english :)

 

EDIT: i'have read the README file and i solved the problem :)

 

now i have another problem please see the attached image, how i solve it?

post-369356-0-30774200-1338721370_thumb.jpg

Edited by PEPPE83 (see edit history)

Share this post


Link to post
Share on other sites

Hi, I`ll contribute a little bit.

To have it work with layered navigation, put those lines:

 

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

 

 

in category.tpl right before and after product-list.tpl, so it looks like this:

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

{include file="$tpl_dir./product-list.tpl" products=$products}

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

and dont forget to remove them from product-sort un pagination .tpl files.

 

Also I removed div element, that`s around the switch button image, and (that`s why) modiffied js like this:

function listorgrid(el, event)
{
 event.preventDefault();
 var mode = el.hasClass('lg_grid');
 if (mode)
 {
el.removeClass('lg_grid');
el.parent().find('.listorgridcanvas').removeClass('lg_grid');
el.parent().find('ul').fadeOut("fast", function() { $(this).fadeIn("fast"); });
 }
 else
 {
el.addClass('lg_grid');
el.parent().find('.listorgridcanvas').addClass('lg_grid');
el.parent().find('ul').fadeOut("fast", function() {$(this).fadeIn("fast");});
 }
 jQuery.ajax({
	type: 'POST',
	url: baseDir + 'modules/listorgridswitch/listorgridswitch.php',
	async: false,
	cache: false,
	type : "POST",
	dataType : "json",
	data: { listorgridajax: true, listorgridmode: (mode?0:1) },
	success: function(jsonData)
	{
	  return;
	}
 });
 return false;
}
$(document).ready(function(){
 $("a.switch_but")
.toggle(
  function( event ){ listorgrid($(this), event); },
  function( event ){ listorgrid($(this), event); }
);
});

 

Next, you`ll need to modiffy a css file, to have grid view, when your html has condition ".lg_grid #product_list" vs list view, when there`s only "#product_list" . (you can simply try to find-and-replace the "ul.sw_view" with "div.lg_grid " - space after is true)

 

I think for basic this will work. For my needs I compleatelly modiffied every file.

Edited by Artx (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

  • 5 weeks later...
  • 2 weeks later...

Thanks a lot to the creator of this Module, Its workig perfect on my web page.

 

I have an issue... I know it doesnt deppend directly of the module... i need to set as default 20 products not 10, because with 10 products the page doesnt look good, looks like incomplete.

 

i have attached an screenshot to picture the situation.

 

Thanks, i hope anybody can help :)

 

Madh

 

to_solve.jpg

Share this post


Link to post
Share on other sites

Hi, I`ll contribute a little bit.

To have it work with layered navigation, put those lines:

 

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

 

 

in category.tpl right before and after product-list.tpl, so it looks like this:

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

{include file="$tpl_dir./product-list.tpl" products=$products}

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

and dont forget to remove them from product-sort un pagination .tpl files.

 

Also I removed div element, that`s around the switch button image, and (that`s why) modiffied js like this:

function listorgrid(el, event)
{
 event.preventDefault();
 var mode = el.hasClass('lg_grid');
 if (mode)
 {
el.removeClass('lg_grid');
el.parent().find('.listorgridcanvas').removeClass('lg_grid');
el.parent().find('ul').fadeOut("fast", function() { $(this).fadeIn("fast"); });
 }
 else
 {
el.addClass('lg_grid');
el.parent().find('.listorgridcanvas').addClass('lg_grid');
el.parent().find('ul').fadeOut("fast", function() {$(this).fadeIn("fast");});
 }
 jQuery.ajax({
	type: 'POST',
	url: baseDir + 'modules/listorgridswitch/listorgridswitch.php',
	async: false,
	cache: false,
	type : "POST",
	dataType : "json",
	data: { listorgridajax: true, listorgridmode: (mode?0:1) },
	success: function(jsonData)
	{
	  return;
	}
 });
 return false;
}
$(document).ready(function(){
 $("a.switch_but")
.toggle(
  function( event ){ listorgrid($(this), event); },
  function( event ){ listorgrid($(this), event); }
);
});

 

Next, you`ll need to modiffy a css file, to have grid view, when your html has condition ".lg_grid #product_list" vs list view, when there`s only "#product_list" . (you can simply try to find-and-replace the "ul.sw_view" with "div.lg_grid " - space after is true)

 

I think for basic this will work. For my needs I compleatelly modiffied every file.

 

Hi,

 

I'm trying to get listeorgrid and layered navigation to work but i'm not sure i'm doing it right.

 

After placing the lines, You write "and dont forget to remove them from product-sort un pagination .tpl files." What and where is this?

 

Further on, should i make a file for the css/grid view and kan i use your example.

 

Thanks for your time.

Share this post


Link to post
Share on other sites

Hi,

 

Here is working fine with my layered navigation, meaning I can switch from one view to the other.

 

But when, after switched to grid view, I click on the select form to sort products and the loading is completed correctly, the view is switched back to list (the grid icon remains active by the way).

 

This problem comes out even if I use the pagination.

 

module version: 1.9

prestashop version: 1.4.8.2

 

I recently upgraded ps from 1.4.2. It was working fine before the last upgrade.

I believe it should be something in blocklayered, as they changed it a lot.

 

Any idea?

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Thanks for this module. :)

 

I have downloaded and installed version 1.9.

I have version 1.4.8.3 of prestashop using a custom theme.

 

I have checked the product-sort.tpl and pagination.tpl and they have been patched correctly.

 

I can see the module in the BO and it is installed.

 

But i cannot get it to work at all.

I am new to this so i feel like i have missed a step somewhere. :unsure:

Any help would be appreciated.

Share this post


Link to post
Share on other sites

Hello. Working on the problem list display of 3 systems. As the filter http://filtersearchpro.co.uk

 

Transfer position can be a browser cookie.

 

Here's what the code is, but it is not working properly. I would be grateful for your help!

(function($) {
$(function() {
function createCookie(name,value,days) {
 if (days) {
  var date = new Date();
  date.setTime(date.getTime()+(days*24*60*60*1000));
  var expires = "; expires="+date.toGMTString();
 }
 else var expires = "";
 document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
 var nameEQ = name + "=";
 var ca = document.cookie.split(';');
 for(var i=0;i < ca.length;i++) {
  var c = ca[i];
  while (c.charAt(0)==' ') c = c.substring(1,c.length);
  if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
 }
 return null;
}
function eraseCookie(name) {
 createCookie(name,"",-1);
}

$('ul.product_view').each(function(i) {
 var cookie = readCookie('tabCookie'+i);
 if (cookie) $(this).find('li').eq(cookie).addClass('current').siblings().removeClass('current')
  .parents('#center_column').find('#product_list').addClass('list').removeClass('grid').addClass('text').eq(cookie).addClass('grid').removeClass('list').addClass('text').eq(cookie).addClass('text').removeClass('grid').addClass('list');
})
$('ul.product_view').delegate('li:not(.current)', 'click', function(i) {
 $(this).addClass('current').siblings().removeClass('current')
  .parents('#center_column').find('#product_list').removeClass('grid').addClass('list').removeClass('text').eq($(this).index()).addClass('grid').removeClass('list')

var cookie = readCookie('tabCookie'+i);
 if (cookie) $(this).find('#product_list').eq(cookie).removeClass('grid').addClass('list').siblings().removeClass('list').addClass('text')



 var ulIndex = $('ul.product_view').index($(this).parents('ul.product_view'));
 eraseCookie('tabCookie'+ulIndex);
 createCookie('tabCookie'+ulIndex, $(this).index(), 365);
})


})
})(jQuery)

Edited by Demos (see edit history)

Share this post


Link to post
Share on other sites

It works well, but can not remember the state of the grid and make a filter with blocklayered lost cookie and leave the grid to its original position.

I copied the file cookie.php in / override / classes and still not working.

I have List or Grid Switch v1.9 y Prestashop 1.4.9.0

 

 

 

Hi, I`ll contribute a little bit.

To have it work with layered navigation, put those lines:

 

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

 

 

in category.tpl right before and after product-list.tpl, so it looks like this:

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

{include file="$tpl_dir./product-list.tpl" products=$products}

{cycle name="clorg" values="prolog,epilog" assign="clorg"}{include file="$lorg_tpldir./modules/listorgridswitch/listorgridswitch.tpl" cycle=$clorg}

and dont forget to remove them from product-sort un pagination .tpl files.

 

Also I removed div element, that`s around the switch button image, and (that`s why) modiffied js like this:

function listorgrid(el, event)
{
 event.preventDefault();
 var mode = el.hasClass('lg_grid');
 if (mode)
 {
el.removeClass('lg_grid');
el.parent().find('.listorgridcanvas').removeClass('lg_grid');
el.parent().find('ul').fadeOut("fast", function() { $(this).fadeIn("fast"); });
 }
 else
 {
el.addClass('lg_grid');
el.parent().find('.listorgridcanvas').addClass('lg_grid');
el.parent().find('ul').fadeOut("fast", function() {$(this).fadeIn("fast");});
 }
 jQuery.ajax({
	type: 'POST',
	url: baseDir + 'modules/listorgridswitch/listorgridswitch.php',
	async: false,
	cache: false,
	type : "POST",
	dataType : "json",
	data: { listorgridajax: true, listorgridmode: (mode?0:1) },
	success: function(jsonData)
	{
	  return;
	}
 });
 return false;
}
$(document).ready(function(){
 $("a.switch_but")
.toggle(
  function( event ){ listorgrid($(this), event); },
  function( event ){ listorgrid($(this), event); }
);
});

 

Next, you`ll need to modiffy a css file, to have grid view, when your html has condition ".lg_grid #product_list" vs list view, when there`s only "#product_list" . (you can simply try to find-and-replace the "ul.sw_view" with "div.lg_grid " - space after is true)

 

I think for basic this will work. For my needs I compleatelly modiffied every file.

Share this post


Link to post
Share on other sites

Hi,

 

Here is working fine with my layered navigation, meaning I can switch from one view to the other.

 

But when, after switched to grid view, I click on the select form to sort products and the loading is completed correctly, the view is switched back to list (the grid icon remains active by the way).

 

This problem comes out even if I use the pagination.

 

module version: 1.9

prestashop version: 1.4.8.2

 

I recently upgraded ps from 1.4.2. It was working fine before the last upgrade.

I believe it should be something in blocklayered, as they changed it a lot.

 

Any idea?

 

Hello,

I have the same problem as you, have you found a solution?

I copied the file cookie.php in / override / classes and still not working.

Help me!!

Thank you

Edited by petete2008 (see edit history)

Share this post


Link to post
Share on other sites

Ya lo he solucionado :

Ir al fichero product-list.tpl y reemplazar la linea <ul id="product_list" class="clear">

por la siguiente : <ul id="product_list" class="{if $cookie->listorgridmode==0}clear{else}clear sw_view{/if}">

 

Hi petete, thank you for the solution provided, it solved my problem too!

Share this post


Link to post
Share on other sites

  • 3 weeks later...

Hi all.. This is indeed a great module! I believe I am having a css problem however and css is not my best skill. <_<

 

Could anyone help me out? Seems like an obvious fix if someone could look here:

http://74.117.145.11...?id_category=24

 

It seems to have disabled my sort by function as well.

Also could someone tell me exactly what css file needs editing? Thanks in advance you guys are awesome!

Edited by jmaybes (see edit history)

Share this post


Link to post
Share on other sites

  • 2 weeks later...

<p>

Ya lo he solucionado : Ir al fichero product-list.tpl y reemplazar la linea</p>

<ul class="clear" id="product_list">por la siguiente :

<li>

<ul class="{if $cookie->listorgridmode==0}clear{else}clear sw_view{/if}" id="product_list">

</ul>

</li>

<li>Si este si sirve definitivamente</li>

</ul>

 

Share this post


Link to post
Share on other sites

  • 4 weeks later...

Hello im with prestashop 1.4.8 i followed the readme , work perfect on product searches , news product but not on categories or normal product lists. I cleared smarty cache a compiled many times manually and autimatic but no luck.

 

Anyone have the same problem?

Share this post


Link to post
Share on other sites

Hello, don't work on 1.5.2 . Fatal error during installation.

It's very easy made the change for install in ps 1.5 but the problem is doesn't work with new theme, since ps 1.4 it doesn't work with new_theme.

Share this post


Link to post
Share on other sites