diff --git a/application/modules/default/views/helpers/BuildProductUrl.php b/application/modules/default/views/helpers/BuildProductUrl.php index e60c584f3..adab2053e 100644 --- a/application/modules/default/views/helpers/BuildProductUrl.php +++ b/application/modules/default/views/helpers/BuildProductUrl.php @@ -1,94 +1,94 @@ . **/ class Default_View_Helper_BuildProductUrl { /** * @param $product_id * @param string $action * @param array $params * @param bool $withHost * @param string $scheme * * @return string */ public function buildProductUrl($product_id, $action = '', $params = null, $withHost = false, $scheme = null) { if (empty($product_id)) { return ''; } /** @var Zend_Controller_Request_Http $request */ $request = Zend_Controller_Front::getInstance()->getRequest(); $baseurl = ''; $host = ''; if ($withHost) { // $member_host = Zend_Registry::get('config')->settings->member->page->server; // $http_host = Zend_Registry::get('config')->settings->member->product->server; // set http_host to product server // // if (false === strpos($request->getHttpHost(), $member_host)) { $http_host = $request->getHttpHost(); // } $http_scheme = isset($scheme) ? $scheme : $request->getScheme(); $host = $http_scheme . '://' . $http_host; } $storeId = null; if (false === isset($params['store_id'])) { if ($request->getParam('domain_store_id')) { $storeId = 's/' . $request->getParam('domain_store_id') . '/'; } } else { $storeId = "s/{$params['store_id']}/"; unset($params['store_id']); } - + /* //20190710 ronald: removed to stay in context, if set in store config $storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null; if(null != $storeConfig && $storeConfig->stay_in_context == false) { $baseurl = Zend_Registry::get('config')->settings->client->default->baseurl_product; } else { $baseurl = "{$host}{$storeId}"; - } + }*/ $url_param = ''; if (is_array($params)) { array_walk($params, create_function('&$i,$k', '$i="$k/$i/";')); $url_param = implode('/', $params); } if ($action != '') { $action = $action . '/'; } - //return "{$host}/{$storeId}p/{$product_id}/{$action}{$url_param}"; + return "{$host}/{$storeId}p/{$product_id}/{$action}{$url_param}"; - return "{$baseurl}/p/{$product_id}/{$action}{$url_param}"; + //return "{$baseurl}/p/{$product_id}/{$action}{$url_param}"; } } \ No newline at end of file