product_quantity needs to be float in filter

  • Posts: 35
  • Thank you received: 0
9 years 1 week ago #198802

-- HikaShop version -- : 2.33
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.35
-- Browser(s) name and version -- : Chrome Mac

Hi everybody,

I was just creating a mass action to un-publish products with no stock and the filter didn't work using the integer 0 in the filter.

It works if you use the float 0.0 in the filter.


Regards,

Edward

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

  • Posts: 13201
  • Thank you received: 2322
9 years 1 week ago #198826

Hi,

Thanks for the report, please edit the file "plugins/hikashop/massaction_product/massaction_product.php" and replace the function "onProcessProductMassFilterproductColumn" by:

	function onProcessProductMassFilterproductColumn(&$elements,&$query,$filter,$num){
		if(empty($filter['type']) || $filter['type']=='all') return;
		if(!isset($this->massaction))$this->massaction = hikashop_get('class.massaction');
		if(count($elements)){
			foreach($elements as $k => $element){
				if(isset($element->$filter['type'])){
					$in = $this->massaction->checkInElement($element, $filter);
					if(!$in) unset($elements[$k]);
				}
			}
		}else{
			$db = JFactory::getDBO();
			if($filter['value'] == 0 || !empty($filter['value']) || (empty($filter['value']) && in_array($filter['operator'],array('IS NULL','IS NOT NULL')))){
				$query->where[] = $this->massaction->getRequest($filter,'hk_product');
			}
		}
	}

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

Time to create page: 0.070 seconds
Powered by Kunena Forum