- Posts: 12
- Thank you received: 2
OS Property support center
Pass Variables from details.html.tpl to listing.ph
- Thibaut
- Topic Author
- Offline
- New Member
-
Less
More
10 years 2 months ago - 10 years 2 months ago #59012
by Thibaut
Pass Variables from details.html.tpl to listing.ph was created by Thibaut
Hello,
I would like to pass variables to filter more the Related properties.
In details.html.tpl there is a line
echo $row->relate;
I would like to pass variables to be able to filter the results (by defaults, it shows related properties by location/distance)
in classes/listing.php would like to add search critera like
if($configClass == 1){
$sql .= "\n AND pr.city = '$property->city'";
}
My question how to pass variables from templates/****/details.html.tpl to classes/listing.php?
I tried to declare $configClass = 4; in details.html.php but didn't work.
Thx to let me know
I would like to pass variables to filter more the Related properties.
In details.html.tpl there is a line
echo $row->relate;
I would like to pass variables to be able to filter the results (by defaults, it shows related properties by location/distance)
in classes/listing.php would like to add search critera like
if($configClass == 1){
$sql .= "\n AND pr.city = '$property->city'";
}
My question how to pass variables from templates/****/details.html.tpl to classes/listing.php?
I tried to declare $configClass = 4; in details.html.php but didn't work.
Thx to let me know
Last edit: 10 years 2 months ago by Thibaut.
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13056
- Thank you received: 1696
10 years 2 months ago #59027
by Mr. Dam
Replied by Mr. Dam on topic Pass Variables from details.html.tpl to listing.ph
Hi Thibaut,
You don't need to pass that variables, because the variable: $configClass is global "array" variable and you can use it on any pages of OS Property
Thanks
Dam
You don't need to pass that variables, because the variable: $configClass is global "array" variable and you can use it on any pages of OS Property
Thanks
Dam
Please Log in or Create an account to join the conversation.
- Thibaut
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 12
- Thank you received: 2
10 years 2 months ago - 10 years 2 months ago #59041
by Thibaut
Replied by Thibaut on topic Pass Variables from details.html.tpl to listing.ph
Hi Dam,
thank you but
when I declare in details.html.php
and in classes/listing.php
It didn't work, like the variable not pass.
Do you know where the problem come?
Thx
thank you but
when I declare in details.html.php
Code:
$configClass['similar_price'] = 20000;
and in classes/listing.php
Code:
if(isset($configClass['similar_price'])){
$similar_price = $configClass['similar_price'];
$sql .= "\n AND pr.price like '$similar_price";
}
It didn't work, like the variable not pass.
Do you know where the problem come?
Thx
Last edit: 10 years 2 months ago by Thibaut.
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13056
- Thank you received: 1696
10 years 2 months ago #59132
by Mr. Dam
Replied by Mr. Dam on topic Pass Variables from details.html.tpl to listing.ph
Hi,
You should add that variable at file: components > com_osproperty > classes > listing.php
at function display.
By the way, the price is decimal number, so you must use <>, >=, <=, = in SQL, not use LIKE
Thanks
Dam
You should add that variable at file: components > com_osproperty > classes > listing.php
at function display.
By the way, the price is decimal number, so you must use <>, >=, <=, = in SQL, not use LIKE
Thanks
Dam
Please Log in or Create an account to join the conversation.
- Thibaut
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 12
- Thank you received: 2
10 years 2 months ago #59666
by Thibaut
Replied by Thibaut on topic Pass Variables from details.html.tpl to listing.ph
Hi,
thank you.
What do you mean by "You should add that variable at file: components > com_osproperty > classes > listing.php
at function display."
I tried to add the variable below
static function display($option,$task){
global $mainframe;
But it doesn't not work.
Thx for your help
thank you.
What do you mean by "You should add that variable at file: components > com_osproperty > classes > listing.php
at function display."
I tried to add the variable below
static function display($option,$task){
global $mainframe;
But it doesn't not work.
Thx for your help
Please Log in or Create an account to join the conversation.
- Mr. Dam
-
- Offline
- Administrator
-
Less
More
- Posts: 13056
- Thank you received: 1696
10 years 2 months ago #59681
by Mr. Dam
Replied by Mr. Dam on topic Pass Variables from details.html.tpl to listing.ph
Hi,
It should be
static function display($option,$task){
global $mainframe,$configClass;
$configClass = 20000;
Thanks
Dam
It should be
static function display($option,$task){
global $mainframe,$configClass;
$configClass = 20000;
Thanks
Dam
Please Log in or Create an account to join the conversation.
Moderators: Mr. Dam, Nguyen Phu Quan
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.