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

Let Customer choose number of products displayed on page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #31  
Old 07-09-2009, 03:55 PM
 
royng royng is offline
 

Advanced Member
  
Join Date: Sep 2008
Posts: 85
 

Default Re: Let Customer choose number of products displayed on page

I got it. it's simple!

Just use
<form method="POST" action="/store/change_ppp.php" id="pppForm">
Show products per page
<select name="ppp" onchange="this.form.submit()">
<option value="9" {if $products_per_page eq 9}selected{/if}>9</option>
<option value="12" {if $products_per_page eq 12}selected{/if}>12</option>
<option value="15" {if $products_per_page eq 15}selected{/if}>15</option>
<option value="18" {if $products_per_page eq 18}selected{/if}>18</option>
<option value="21" {if $products_per_page eq 21}selected{/if}>21</option>
<option value="24" {if $products_per_page eq 24}selected{/if}>24</option>
<option value="99" {if $products_per_page eq 99}selected{/if}>all</option>
</select>

</form>

in products.tpl
__________________
X-Cart DB Version: 4.1.11 GOLD
Reply With Quote
  #32  
Old 11-10-2009, 10:02 AM
 
presson83 presson83 is offline
 

Senior Member
  
Join Date: Sep 2008
Posts: 143
 

Default Re: Let Customer choose number of products displayed on page

Hi All,

This is a great mod and came in super handy. I modified it slightly to have a "view all" button outside of the drop-down menu. When you click it it will show the "all" option in the drop-down (for clarity's sake), otherwise it's not there. Here's the code and thanks Holub!

HTML Code:
<form method="POST" action="change_ppp.php" class="productsPerPage"> Show products per page <select name="ppp" onchange="javascript: this.form.submit();"> <option value="5" {if $products_per_page eq 5}selected{/if}>5</option> <option value="10" {if $products_per_page eq 10}selected{/if}>10</option> <option value="20" {if $products_per_page eq 20}selected{/if}>20</option> <option value="30" {if $products_per_page eq 30}selected{/if}>30</option> <option value="50" {if $products_per_page eq 50}selected{/if}>50</option> {if $products_per_page eq 100}<option value="100" {if $products_per_page eq 100}selected{/if}>all</option>{/if} </select> </form> <form method="POST" action="change_ppp.php" class="viewAll"> <input type="hidden" name="ppp" value="100" /> <input type="submit" value="view all" onclick="javascript: this.form.submit();"/> </form>
__________________
v 4.1.11, v 4.2
Reply With Quote
  #33  
Old 01-05-2010, 11:32 AM
 
kidroush kidroush is offline
 

Advanced Member
  
Join Date: Apr 2008
Posts: 80
 

Default Re: Let Customer choose number of products displayed on page

I have this search sort by feature on my site. However, the options to sort by are Product, Price or Default. This is fine but I want to change the word product to movies even though I want it to sort by the product still. The only thing I want to change is the label, not the function. Anyone know how?
__________________
Lance
X-Cart Gold Version 4.6.1
Reply With Quote
  #34  
Old 03-28-2010, 11:51 AM
 
Pyro Pyro is offline
 

X-Adept
  
Join Date: Nov 2009
Posts: 506
 

Default Re: Let Customer choose number of products displayed on page

Has any one tried this on 4.3.x?
__________________
Best Wishes,
James

4.5.2 Gold (work in progress)
Reply With Quote
  #35  
Old 04-06-2010, 11:51 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Let Customer choose number of products displayed on page

How can I get this to work in the manufacturers area as well?
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #36  
Old 04-28-2010, 02:42 AM
  FTI's Avatar 
FTI FTI is offline
 

Senior Member
  
Join Date: Oct 2009
Location: Plovdiv, Bulgaria
Posts: 153
 

Default Re: Let Customer choose number of products displayed on page

Hello Sir,
Looking through the X-cart forum I came across this topic.

I need the same thing but for manufacturers. I need a drop down menu with the manufacturers, that stands next to the search box on my website. So when the user chooses to search "mascara" for example, he can search only for mascara, maunfactured by Lancome. I badly need some help, and I will appreciate it.

Thanks in advance.
__________________
Version 4.2.3
X-Cart Gold

Version 4.3.1
X-Cart Gold
Reply With Quote
  #37  
Old 05-02-2010, 03:26 PM
 
Christofer Christofer is offline
 

eXpert
  
Join Date: Apr 2009
Location: Thessaloniki, Greece
Posts: 202
 

Default Re: Let Customer choose number of products displayed on page

works for 4.2.1? thank you
__________________
X-Cart Gold : 4.2.1 (on linux parallels plesk / mysql)
Php v5.2.9 (Zend: 2.2.0) - MySql v5.0.79 - LiteSpeed server
Modules : X-Offer & X-Aom & One page checkout
Product tabs & Product downloads & many more
Reply With Quote
  #38  
Old 06-07-2010, 12:31 PM
 
jlrentertainment jlrentertainment is offline
 

Newbie
  
Join Date: Mar 2010
Posts: 6
 

Default Re: Let Customer choose number of products displayed on page

I have something similar but not in dropdown format over here:

http://forum.x-cart.com/showthread.php?t=23796&page=6

It's working on 4.3.2.
__________________
X-Cart v4.3.1
Reply With Quote
  #39  
Old 06-13-2010, 06:46 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: Let Customer choose number of products displayed on page

I would love this option in 4.3.x

I did see the thread you posted above and Show All won't really work for my customer.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #40  
Old 08-18-2012, 05:16 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Let Customer choose number of products displayed on page

I've completed this for 4.3. I couldn't find this mentioned elsewhere so hopefully this isn't redundant.

New file change_ppp.php:

PHP Code:
<?php
if (!defined('XCART_SESSION_START') && $_SERVER['REQUEST_METHOD'] != 'POST') {
    
header('Location: home.php');
    die(
'Access denied');
}

require 
'./auth.php';
x_session_register('products_per_page');

if (
$_SERVER['REQUEST_METHOD'] == 'POST' && $ppp) {

    
$back $_SERVER['HTTP_REFERER'];
    if (!
$back)
        
$back '/home.php';

    if (
$ppp == 'all')
        
$ppp 32767;

    
$products_per_page = (int)$ppp;
    
x_session_save('products_per_page');

    
func_header_location($back);
}

if ((int)
$products_per_page 0)
    
$objects_per_page $config['Appearance']['products_per_page'] = $products_per_page;

$smarty->assign('products_per_page'$config['Appearance']['products_per_page']);

$pppList = array(
    
6,12,24,48,72,120,32767
);
$smarty->assign('pppList'$pppList)
?>

New file skin1/customer/change_ppp.tpl:

PHP Code:
<form method="post" action="{$xcart_web_dir}/change_ppp.php" style="float:right">
    
Show products per page
    
<select name="ppp" onchange="this.form.submit()">
        {foreach 
from=$pppList item=pli name=pli}
            <
option value="{if $smarty.foreach.pli.last}all{else}{$pli}{/if}"{if $products_per_page eq $pliselected{/if}>{if $smarty.foreach.pli.last}all{else}{$pli}{/if}</option>
        {/foreach}
    </
select>
</
form>
<
div class="clearing"></div

Add the following to home.php just below the auth.php line:

PHP Code:
if (!empty($cat))
    include 
$xcart_dir.'/change_ppp.php'

Add the following to the very end of skin1/customer/main/navigation.tpl:

PHP Code:
{include file="customer/change_ppp.tpl"

Add the following to .nav-pages in skin1/main.css:

Code:
float: left;
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
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 05:38 AM.

   

 
X-Cart forums © 2001-2020