protected function controlDeleteProductCompare(array &$result, $product_id)
    {
        if (empty($result['redirect'])) {
            $segments = explode(',', $this->path());
            if (isset($segments[0]) && $segments[0] === 'compare' && !empty($segments[1])) {
                $ids = array_filter(array_map('trim', explode(',', $segments[1])), 'ctype_digit');
                unset($ids[array_search($product_id, $ids)]);
                $result['redirect'] = $segments[0] . '/' . implode(',', $ids);
            }
        }
    }
protected function controlDeleteProductCompare(array &$result, $product_id)
    {
        if (empty($result['redirect'])) {
            $segments = explode(',', $this->path());
            if (isset($segments[0]) && $segments[0] === 'compare' && !empty($segments[1])) {
                $ids = array_filter(array_map('trim', explode(',', $segments[1])), 'ctype_digit');
                unset($ids[array_search($product_id, $ids)]);
                $result['redirect'] = $segments[0] . '/' . implode(',', $ids);
            }
        }
    }
protected function controlDeleteProductCompare ( array & $ result , $ product_id ) { if ( empty ( $ result [ 'redirect' ] ) ) { $ segments = explode ( ',' , $ this -> path ( ) ) ; if ( isset ( $ segments [ 0 ] ) && $ segments [ 0 ] === 'compare' && ! empty ( $ segments [ 1 ] ) ) { $ ids = array_filter ( array_map ( 'trim' , explode ( ',' , $ segments [ 1 ] ) ) , 'ctype_digit' ) ; unset ( $ ids [ array_search ( $ product_id , $ ids ) ] ) ; $ result [ 'redirect' ] = $ segments [ 0 ] . '/' . implode ( ',' , $ ids ) ; } } }
Controls result after a product has been deleted from comparison
@param array $result
@param integer $product_id
Controls result after a product has been deleted from comparison