- Posts: 37
- Thank you received: 0
Custom fields zone - filter
11 years 10 months ago - 11 years 10 months ago #178899
by Vorov
Custom fields zone - filter was created by Vorov
-- HikaShop version -- : 2.3.4.
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : comodo dragon
Hi
In additional fields were created paragraph zone. (images 001)
In the filter, chose a single drop-down list. (image 002) Apply on - costom_feilds. Custom fields - my zone (image 001)
On the website filter does not show the list of zones.
It is possible to solve the problem?
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : comodo dragon
Hi
In additional fields were created paragraph zone. (images 001)
In the filter, chose a single drop-down list. (image 002) Apply on - costom_feilds. Custom fields - my zone (image 001)
On the website filter does not show the list of zones.
It is possible to solve the problem?
Last edit: 11 years 10 months ago by Vorov.
Please Log in or Create an account to join the conversation.
11 years 10 months ago #179034
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Custom fields zone - filter
Hi,
Do you have some zones in the "Shipping zones".
Because you are not listing countries or states ; you are listing the zone in the "shipping zones" type.
Regards,
Do you have some zones in the "Shipping zones".
Because you are not listing countries or states ; you are listing the zone in the "shipping zones" type.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 10 months ago #179039
by Vorov
Replied by Vorov on topic Custom fields zone - filter
Yes, multiple values I have completed.
Please Log in or Create an account to join the conversation.
11 years 10 months ago #179077
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Custom fields zone - filter
Hi,
Thanks for the report.
I reproduced the issue and I made a fix.
In the file "administrator/components/com_hikashop/classes/filter.php" please replace
By
It will load the zone values for the custom field and display them.
I test it in my local websites and the filters are working good.
Regards,
Thanks for the report.
I reproduced the issue and I made a fix.
In the file "administrator/components/com_hikashop/classes/filter.php" please replace
Code:
if(!empty($field->field_value)){
$field->field_value=explode("\n", $field->field_value);
$unset=array();
foreach($field->field_value as $key => $val){
$temp=explode("::", $val);
if(!empty($datas['products']) && !in_array($temp[0],$values)){
$unset[]=$key;
}else{
$field->field_value[$key]=array($temp[0],$temp[1]);
}
}
if(!empty($unset)){
foreach($unset as $u){
unset($field->field_value[$u]);
}
}
}
Code:
if(!empty($field->field_value)){
$field->field_value=explode("\n", $field->field_value);
$unset=array();
foreach($field->field_value as $key => $val){
$temp = explode("::", $val);
if(!empty($datas['products']) && !in_array($temp[0],$values)){
$unset[]=$key;
}else{
$field->field_value[$key]=array($temp[0],$temp[1]);
}
}
if(!empty($unset)){
foreach($unset as $u){
unset($field->field_value[$u]);
}
}
} else if($field->field_type == 'zone') {
$fieldClass = hikashop_get('class.field');
if(is_string($field->field_options))
$field->field_options = unserialize($field->field_options);
$fields = array($field);
$fieldClass->handleZone($fields, false, null);
$values = array();
foreach($field->field_value as $k => $obj) {
$values[] = array( $k, $obj->value );
}
$field->field_value = $values;
}
I test it in my local websites and the filters are working good.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: Vorov
Please Log in or Create an account to join the conversation.
11 years 10 months ago #179083
by Vorov
Replied by Vorov on topic Custom fields zone - filter
Thank you! You are God in programming. :woohoo: :evil:
Please Log in or Create an account to join the conversation.
Time to create page: 0.156 seconds