| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Products Per Page with Great Features | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Products Per Page with Great Features
Hello Folks. Happy New Year! Here is a gift for you. This customization will allow you the get the following features for Products Per Page:
1) Customer can change how many products wants to see in a category (if input box is available) 2) Customer can select to View All products in a category (if selection menu and option View All are available) 3) XC Administrator can easy manage enable/disable selection menu, change input box, View All option. By default both selection menu and input box are available, but you can do changes with a few clicks in Admin -> Appearance. 4) Variants for number of products per page can be changed as you want. You can enter one after other in a textarea box in Admin -> Appearance by pressing Enter button. Take in consideration how many columns for products are on a row (if you have 3, your variants of products per page should be multiply by 3). And also what is the default value (normally it should be the first value in selection menu). (!!) It is silly to see in default XC Gold listing 3 products on a row (Offers and Products), but in selection menu values are multiply by 5 and default per page is 10. Think deeply people are not smart. If they see one product remaining on the last row they could think the listing is over. So, be careful setting up the numbers. Let's start the customization. We have to do 3 steps: changing two files content, add a few options in DB and add a few selectors in CSS main file. CHANGING THE FILES CONTENT (search.php and per_page.tpl) In file [XC-Dir]/include/search.php find this part of the code (in v4.5.4 Gold+ it is around Line 1087) replace this PHP Code:
PHP Code:
In file [XC_Dir]/skin/common_files/customer/main/per_page.tpl replace the whole file content. As you can see I let the original code in place. replace original PHP Code:
with this one PHP Code:
ADDING THE OPTIONS IN DATABASE Execute the following SQL queries: 1) For Appearance section Code:
2) For easy changing option texts when using Webmaster Mode Code:
ADDING SELECTORS IN CSS In file [XC_Dir]/skin/common_files/css/main.css change this PHP Code:
with this PHP Code:
For results see the attachments. A few thoughts 1) You have the freedom to use them together, or one of them as you wish. Just check/uncheck the options in Admin -> Appearance. 2) As you can see for "View All" option I am using the total number of products in that category instead of numbers like 999, 2000 as I saw as solutions in this Forum (it is not wrong but this one is an elegant way in my opinion). By default XC calculates this and assigns it to smarty variable $total_items. 3) For changing the box content just input a number and click outside or press Enter. 4) If you set up the number bigger than total number of products in that category, after reloading the page it will see the total number of products instead of the number you entered (for avoiding confusion). 5) For selection menu I created a few nice features when working together with input box. If the number is bigger than total number of products in that category it shows View All, if you enter a number which is different than variant number you will see it in selection (e.g. 1 per page). This value will disappear if you choose from selection other variant. Changing this will change the input box content. Selection menu won't show all variants if the total number of products is exceed (e.g. if total number is 33 and you have variants ( 12, 24, 36, 48 ) only 12, 24 will appear - another elegant way in my opinion). Once you do these small changes cleanup your website cache (in my case it worked without cleaning up). If you visit again you should find the new results (see the attachments). Do not forget to backup the data before starting modification. >> If you like this customization please click [Thanks] button for this post. Having lots of [Thanks] hope Qualiteam will take in consideration inserting this customization into future versions. Have a great year!
__________________
X-Cart Next: Business 5.2 (learning and testing) X-Cart Classic: Gold and Gold Plus 4.7 Lots of Modules and Customizations OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions) You can catch my ideas here: http://ideas.x-cart.com |
|||||||||
|
#2
|
|||||||||
|
|||||||||
Re: Products Per Page with Great Features
"Next in Dallas": Products list layouts settings.
- We have to do something with that silly "Sort By" feature. As it is now it is like a relic from ancient times ("XC and the Lost Ark"). - We have to do something to change the layout with a click of a button from Grid, List, Compact list, ...
__________________
X-Cart Next: Business 5.2 (learning and testing) X-Cart Classic: Gold and Gold Plus 4.7 Lots of Modules and Customizations OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions) You can catch my ideas here: http://ideas.x-cart.com |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|