Custom fields zone - filter

  • Posts: 37
  • Thank you received: 0
10 years 2 weeks ago #178899

-- 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?

Attachments:
Last edit: 10 years 2 weeks ago by Vorov.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 2 weeks ago #179034

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,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 0
10 years 2 weeks ago #179039

Yes, multiple values I have completed.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 2 weeks ago #179077

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

		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]);
				}
			}
		}
By
		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;
		}
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,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: Vorov

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 0
10 years 2 weeks ago #179083

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.066 seconds
Powered by Kunena Forum