Originally Posted by
gigi3
So, I just uploaded another fresh copy of edit_orders.php and it is giving me the 'white screen' when I attempt to add a coupon. It seems it is not the changes I have made.
I am receiving the same error message in the logs:
Any help would be greatly appreciated!
My copy of /YOUR_ADMIN/includes/functions/extra_functions/edit_orders_functions.php has the following code block added, just above the function declaration for eo_debug_action_level_list:
Code:
//-bof-20140423-lat9-forum bugfix
if(!function_exists('validate_for_category')) {
function validate_for_category($product_id, $coupon_id) {
global $db;
$retVal = 'none';
$productCatPath = zen_get_product_path($product_id);
$catPathArray = array_reverse(explode('_', $productCatPath));
$sql = "SELECT count(*) AS total
FROM " . TABLE_COUPON_RESTRICT . "
WHERE category_id = -1
AND coupon_restrict = 'Y'
AND coupon_id = " . (int)$coupon_id . " LIMIT 1";
$checkQuery = $db->execute($sql);
foreach ($catPathArray as $catPath) {
$sql = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "
WHERE category_id = " . (int)$catPath . "
AND coupon_id = " . (int)$coupon_id;
$result = $db->execute($sql);
if ($result->recordCount() > 0 && $result->fields['coupon_restrict'] == 'N') return true;
if ($result->recordCount() > 0 && $result->fields['coupon_restrict'] == 'Y') return false;
}
if ($checkQuery->fields['total'] > 0) {
return false;
} else {
return 'none';
}
}
}
if(!function_exists('validate_for_product')) {
function validate_for_product($product_id, $coupon_id) {
global $db;
$sql = "SELECT * FROM " . TABLE_COUPON_RESTRICT . "
WHERE product_id = " . (int)$product_id . "
AND coupon_id = " . (int)$coupon_id . " LIMIT 1";
$result = $db->execute($sql);
if ($result->recordCount() > 0) {
if ($result->fields['coupon_restrict'] == 'N') return true;
if ($result->fields['coupon_restrict'] == 'Y') return false;
} else {
return 'none';
}
}
}
//-eof-20140423-lat9
Bookmarks