21 $guestStatuses = Option::get(
"sale",
"allow_guest_order_view_status",
"");
22 $guestStatuses = ($guestStatuses <>
'') ? unserialize($guestStatuses, [
'allowed_classes' =>
false]) : array();
23 return (is_array($guestStatuses) && in_array($order->getField(
'STATUS_ID'), $guestStatuses) && Option::get(
"sale",
"allow_guest_order_view") ===
'Y');
38 $scheme = $context->getRequest()->isHttps() ?
'https' :
'http';
39 $siteData = SiteTable::getList(array(
40 'filter' => array(
'LID' => $order->getSiteId()),
42 $site = $siteData->fetch();
44 $paths = unserialize(Option::get(
"sale",
"allow_guest_order_view_paths"), [
'allowed_classes' =>
false]);
45 $path = htmlspecialcharsbx($paths[$site[
'LID']]);
47 if (isset($path) && mb_strpos($path,
'#order_id#'))
49 $accountNumber = urlencode(urlencode($order->getField(
'ACCOUNT_NUMBER')));
50 $path = str_replace(
'#order_id#', $accountNumber,$path);
51 if (mb_strpos($path,
'/') !== 0)
56 $path .= (mb_strpos($path,
'?')) ?
'&' :
"?";
57 $path .=
"access=".$order->getHash();
64 return $scheme.
'://'.$site[
'SERVER_NAME'].$path;