eCommerce
Social and Community Suite
Content Management
RSS Extensions
VirtueMart Extensions
(0)
|
Login
|
Register
|
Lost Password?
Username:
Password:
Home
Our Products
Joomla 1.7.x
(23)
& J!1.6.x
Joomla 1.5.x
(28)
Joomla 1.0.x
(17)
Factory Club Extensions
(7)
Drupal, Elxis, MODx
(6)
Windows Gadgets for J!
(11)
Free Templates
(4)
All Products
(92)
Documentation
Tweets
Forum
Contact Us
Terms & Conditions
How to Buy Guide
Customers FAQ's
Updates & Upgrades
About Us
Latest Tweets
Join us at the Joomladay UK!
The Factory Extensions Joomla Compatibility Chart
Love Factory 2.4 for Joomla 1.7
Love Factory - Memberships [VIDEO]
Love Factory - Custom Fields Integration [VIDEO]
Love Factory - Google Maps Integration [VIDEO]
Love Factory - Administrator Guide [VIDEO]
Love Factory - Memberships
Collection Factory for Joomla 1.6 with CB support
Reverse Auction Factory 1.5.9
Home
Help
Search
Login
Register
The Factory
>
Forum
>
eCommerce Factory Suite
for Joomla CMS.
>
Ads Factory
>
Search between 2 numbers???
Pages: [
1
]
« previous
next »
Print
Author
Topic: Search between 2 numbers??? (Read 586 times)
autorec
Newbie
Posts: 27
Tu aduci masina. Noi o aratam lumii!
Search between 2 numbers???
«
on:
September 07, 2010, 12:05:14 am »
How do I create a search between 2 numbers?
Like search by a price range or by year...
But I want the user to input the numbers for the search.
EX: Search between 1000 EUR and 2000 EUR
Do you understand what I am asking?
Thank you in advance!!!
Logged
Factory Staff 02
The Factory Staff
Hero Member
Posts: 1912
Re: Search between 2 numbers???
«
Reply #1 on:
September 07, 2010, 12:33:59 pm »
Hi,
Adding new filters requires 3 steps : adding the field boxes in the search form, geting the filter and creating the database filter to it.
In this particular case:
1.
Add to t_search.tpl somewhere in the form
Price Range
<input type="textbox" name="price_start" />
<input type="textbox" name="price_end" />
2.Edit com_adsman/models/adsman.php setFiltersList() method
and add:
In the case:
" if ($reset != "all") "
$filters["price_start"] = JRequest::getVar('price_start', $app->getUserStateFromRequest('com_adsman.price_start','price_start'));
$filters["price_end"] = JRequest::getVar('price_end', $app->getUserStateFromRequest('com_adsman.price_end','price_end'));
and on else:
$app->setUserState('com_adsman.price_start', '');
$app->setUserState('com_adsman.price_end', '');
3.
In the same model file in the buildFiltersQuery() method
add before:
$this->setState( "where", $where );
these:
if (!empty($filters["price_start"])) {
$where[] = " a.askprice >= '" . $filters["price_start"] . "' ";
}
if (!empty($filters["price_end"])) {
$where[] = " a.askprice <= '" . $filters["price_end"] . "' ";
}
Cheers,
Sorin
Logged
The Factory's Development Team member.
autorec
Newbie
Posts: 27
Tu aduci masina. Noi o aratam lumii!
Re: Search between 2 numbers???
«
Reply #2 on:
March 20, 2011, 06:11:20 pm »
I have added the search between 2 numbers and it is working!
Thank you very much for that.
But when I do the search I can not remove the filter!
The reset filter button for the search doesn't appear.
It appears for the other filters, but for the new filter it doesn't appear.
Can you help me with this?
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Forum
-----------------------------
=> News & Announcements
===> Community News
===> General Discussion
===> Unlisted Products
=> eCommerce Factory Suite
for Joomla CMS.
===> Auction Factory
===> Reverse Auction Factory
===> Raffle Factory
===> Collection Factory
===> Ads Factory
===> Media Mall Factory
=> Social & Community Factory Suite
for Joomla CMS.
===> jAnswers Factory
===> Love Factory
===> Chat Factory
===> Deluxe Blog Factory
===> HOT or NOT Deluxe Factory
===> Photo Battle Factory
===> HOT or NOT Factory
=> Content Management Suite
for Joomla CMS.
===> Advertisement Factory
===> Briefcase Factory
===> eBook Factory
===> Article Factory Manager
===> Content Image Factory
=> RSS Factory Suite
for Joomla CMS.
===> rss Factory PRO
===> rss Factory
===> rss to Image Factory
===> rss Context Factory
=> VirtueMart Extensions & Payment Facilities
===> VM Factory Reports
===> VM Factory Orders & Reviews
===> VM Tree Factory
===> VM ePayment Factory
=> Miscellaneous Extensions & Modules
for Joomla.
===> eBay Factory Module
===> Top Movies Factory
===> Exchange Rates Factory
===> Factory Calculators
===> Lava Factory Menu
===> Feedback Factory
===> Awards Factory
=> Other CMS Extensions
===> DRUPAL Extensions & Modules
===> ELXIS Extensions & Modules
===> MODx Extensions & Modules
=> Windows Gadgets
=> Template Factory
===> Joomla Business Template #01
===> Joomla Business Template #02
Loading...