<commit_before><?php

$items_response = $cash_admin->requestAndStore(
	array(
		'cash_request_type' => 'commerce', 
		'cash_action' => 'getitemsforuser',
		'user_id' => $cash_admin->effective_user_id,
	)
);

$orders_response = $cash_admin->requestAndStore(
	array(
		'cash_request_type' => 'commerce', 
		'cash_action' => 'getordersforuser',
		'user_id' => $cash_admin->effective_user_id,
		'max_returned' => 6
	)
);

// are we filtered? 
$filter_key = array_search('filter', $request_parameters);
if ($filter_key !== false) {
	$filter = $request_parameters[$filter_key + 1];
	if ($filter == 'week') {
		$cash_admin->page_data['filter_week'] = true;
	} else if ($filter == 'unfulfilled') {
		$cash_admin->page_data['filter_unfulfilled'] = true;
	} else {
		$cash_admin->page_data['no_filter'] = true;
	}
}

//Commerce connection or Items present?
$cash_admin->page_data['connection'] = AdminHelper::getConnectionsByScope('commerce') || $items_response['payload']; 


// Return Connection
$page_data_object = new CASHConnection(AdminHelper::getPersistentData('cash_effective_user'));
$settings_types_data = $page_data_object->getConnectionTypes('commerce');

$all_services = array();
$typecount = 1;
foreach ($settings_types_data as $key => $data) {
	if ($typecount % 2 == 0) {
		$alternating_type = true;
	} else {
		$alternating_type = false;
	}
	if (file_exists(ADMIN_BASE_PATH.'/assets/images/settings/' . $key . '.png')) {
		$service_has_image = true;
	} else {
		$service_has_image = false;
	}
	if (in_array($cash_admin->platform_type, $data['compatibility'])) {
		$all_services[] = array(
			'key' => $key,
			'name' => $data['name'],
			'description' => $data['description'],
			'link' => $data['link'],
			'alternating_type' => $alternating_type,
			'service_has_image' => $service_has_image<commit_msg>commerce filters working minus pagination<commit_after><?php
// are we filtered? 
$filter_key = array_search('filter', $request_parameters);
$filter = false;
if ($filter_key !== false) {
	$filter = $request_parameters[$filter_key + 1];
	if ($filter == 'week') {
		$cash_admin->page_data['filter_week'] = true;
	} else if ($filter == 'unfulfilled') {
		$cash_admin->page_data['filter_unfulfilled'] = true;
	} else {
		$cash_admin->page_data['no_filter'] = true;
	}
}

$items_response = $cash_admin->requestAndStore(
	array(
		'cash_request_type' => 'commerce', 
		'cash_action' => 'getitemsforuser',
		'user_id' => $cash_admin->effective_user_id,
	)
);

$order_request = array(
	'cash_request_type' => 'commerce', 
	'cash_action' => 'getordersforuser',
	'user_id' => $cash_admin->effective_user_id,
	'max_returned' => 11
);
if ($filter == 'unfulfilled') {
	$order_request['unfulfilled_only'] = 1;
}
if ($filter == 'week') {
	$order_request['since_date'] = time() - 604800;;
}

$orders_response = $cash_admin->requestAndStore(
	$order_request
);


//Commerce connection or Items present?
$cash_admin->page_data['connection'] = AdminHelper::getConnectionsByScope('commerce') || $items_response['payload']; 


// Return Connection
$page_data_object = new CASHConnection(AdminHelper::getPersistentData('cash_effective_user'));
$settings_types_data = $page_data_object->getConnectionTypes('commerce');

$all_services = array();
$typecount = 1;
foreach ($settings_types_data as $key => $data) {
	if ($typecount % 2 == 0) {
		$alternating_type = true;
	} else {
		$alternating_type = false;
	}
	if (file_exists(ADMIN_BASE_PATH.'/assets/images/settings/' . $key . '.png')) {
		$service_has_image = true;
	} else {
		$service_has_image = false;
	}
	if (in_array($cash_admin->platform_type, $data['compatibility'])) {
		$all_services[] = array(
			'key' => $key,
			'name' => $data['name'],
			'description' => $data['description'],
			'link' => $data['link'],
			'alternating_type' => $alternating_type,
			'service_has_image' => $service_has_image
{'fraction_non_alphanumeric': 0.17796830345544298, 'fraction_numerical': 0.004676539360872954, 'mean_word_length': 5.8021201413427566, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4552703', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1352, 'n_words': 230}