Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Customer chooses between multi column OR normal list view product listings

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-12-2008, 06:47 PM
  Christopher728's Avatar 
Christopher728 Christopher728 is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: CA
Posts: 46
 

Default Customer chooses between multi column OR normal list view product listings

Does anybody know how, or know of a mod, to modify the product listing page to give the customer a choice between the normal "list" view and the multi column thumbnail view? Ideally I would like to set up buttons/icons which customers can click on to switch views, but a drop down/select box could work too.

If anyone's unclear about what I mean circuitcity.com has their product listing pages setup this way and really like it, so take a look at that.

Thanks in advance

EDIT: This cart is v4.1.11
__________________
X-cart versions 4.1.11, 4.1.9 & 4.1.8
Reply With Quote
  #2  
Old 10-15-2008, 06:45 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Customer chooses between multi column OR normal list view product listings

Quote:
Originally Posted by Christopher728
Does anybody know how, or know of a mod, to modify the product listing page to give the customer a choice between the normal "list" view and the multi column thumbnail view? Ideally I would like to set up buttons/icons which customers can click on to switch views, but a drop down/select box could work too.

If anyone's unclear about what I mean circuitcity.com has their product listing pages setup this way and really like it, so take a look at that.

Thanks in advance

Try to do this (but first make backup file auth.php):

1. Insert into the file "auth.php" after next lines:

PHP Code:
x_session_register("logout_user");
x_session_register("session_failed_transaction");
x_session_register("add_to_cart_time");

x_session_register("always_allow_shop");
x_session_register("search_data"); 

next code:

PHP Code:
x_session_register("product_per_row");
if ((
$product_per_row>=0)&&($product_per_row<4)&&($product_per_row!="")) {    
    
$config["Appearance"]["products_per_row"] = intval($product_per_row);



2. Create new file "change.php" in x-cart root folder with next code:

PHP Code:
<?php
    
require "./auth.php";

    
x_session_register("product_per_row");

    
$id intval($_GET["per_row"]);
    
    if ((
$id>=0)&&($id<4)) $product_per_row $id;
    
x_session_save();

    
$referrer $_SERVER['HTTP_REFERER'];
    
func_header_location($referrer);
?>

3. Add in some tpl (head, customer/home or ...) links for a choice between the normal "list" view and the multi column thumbnail view
(or change it on select box or images or what you needs):

PHP Code:
<a href="change.php?per_row=0">0 per/row</a
<
a href="change.php?per_row=1">1 per/row</a
<
a href="change.php?per_row=2">2 per/row</a
<
a href="change.php?per_row=3">3 per/row</a


That all
Reply With Quote
  #3  
Old 10-15-2008, 08:36 AM
  Christopher728's Avatar 
Christopher728 Christopher728 is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: CA
Posts: 46
 

Default Re: Customer chooses between multi column OR normal list view product listings

SWEET! I will give that a try as soon as I can and post my results.

Am I correct in assuming that the 0 per row option will result in the normal list view?

Thanks so much, you're awesome.
__________________
X-cart versions 4.1.11, 4.1.9 & 4.1.8
Reply With Quote
  #4  
Old 10-15-2008, 09:05 AM
  Christopher728's Avatar 
Christopher728 Christopher728 is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: CA
Posts: 46
 

Default Re: Customer chooses between multi column OR normal list view product listings

It works perfectly!

Only thing is it seems to default to the list view upon initial page load, is there any you can think of to make it default to the thumbnail view?

Thanks for your help!
__________________
X-cart versions 4.1.11, 4.1.9 & 4.1.8
Reply With Quote
  #5  
Old 10-16-2008, 12:12 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Customer chooses between multi column OR normal list view product listings

Quote:
Originally Posted by Christopher728
It works perfectly!

Only thing is it seems to default to the list view upon initial page load, is there any you can think of to make it default to the thumbnail view?

Thanks for your help!

change php code in the file "auth.php" to this:

PHP Code:
x_session_register("product_per_row");

if ((
$product_per_row>=0)&&($product_per_row<4)&&($product_per_row!="")) {
    
    
$config["Appearance"]["products_per_row"] = intval($product_per_row);

Reply With Quote
  #6  
Old 10-16-2008, 12:37 AM
  Christopher728's Avatar 
Christopher728 Christopher728 is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: CA
Posts: 46
 

Default Re: Customer chooses between multi column OR normal list view product listings

Thanks Yurij, but now it seems to be stuck on multi column and won't allow me to switch to list view.

Do you have any other ideas?
__________________
X-cart versions 4.1.11, 4.1.9 & 4.1.8
Reply With Quote
  #7  
Old 10-16-2008, 12:51 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Customer chooses between multi column OR normal list view product listings

Quote:
Originally Posted by Christopher728
Thanks Yurij, but now it seems to be stuck on multi column and won't allow me to switch to list view.

Do you have any other ideas?

Try to change option "Display products list in multiple columns (1-3) (leave empty to use standard format): " in admin area to "0" or empty.
Reply With Quote
  #8  
Old 10-16-2008, 01:10 AM
  Christopher728's Avatar 
Christopher728 Christopher728 is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: CA
Posts: 46
 

Default Re: Customer chooses between multi column OR normal list view product listings

Thanks, that seems to have done the trick!
__________________
X-cart versions 4.1.11, 4.1.9 & 4.1.8
Reply With Quote
  #9  
Old 06-26-2009, 10:18 AM
 
royng royng is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 85
 

Default Re: Customer chooses between multi column OR normal list view product listings

Wow, It's works great. Yurji, You are awesome! Do you know how to add View all and <Pre / Next> to the product page?
__________________
X-Cart DB Version: 4.1.11 GOLD
Reply With Quote
  #10  
Old 07-07-2009, 04:59 PM
 
royng royng is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 85
 

Default Re: Customer chooses between multi column OR normal list view product listings

Quote:
Originally Posted by Christopher728
Thanks, that seems to have done the trick!


Can I see how is it? what is you web site address?

And is auth.php same as auth.tpl? is the located in the root folder?
__________________
X-Cart DB Version: 4.1.11 GOLD
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:43 AM.

   

 
X-Cart forums © 2001-2020