本文整理匯總了PHP中ShopUrl::getURL方法的典型用法代碼示例。如果您正苦於以下問題:PHP ShopUrl::getURL方法的具體用法?PHP ShopUrl::getURL怎麽用?PHP ShopUrl::getURL使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ShopUrl
的用法示例。
在下文中一共展示了ShopUrl::getURL方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getConfigFieldsValues
public function getConfigFieldsValues()
{
$this->setContext();
$languages = Language::getLanguages(false);
$shop_url = new ShopUrl((int) Configuration::get('PS_SHOP_DEFAULT'));
$base_url = $shop_url->getURL(Configuration::get('PS_SSL_ENABLED'));
$login_data = unserialize(Configuration::get('MOBASSISTANTCONNECTOR'));
$data = array('mobassistantconnector_login' => $this->login_data['login'], 'mobassistantconnector_password' => $this->login_data['password'], 'mobassistantconnector_tracknum_message_lng_all' => Configuration::get('MOBASSISTANTCONNECTOR_TN_LNG'), 'mobassistantconnector_qrcode' => '', 'mobassistantconnector_qr_description' => 'Store URL and access details (login and password) for Mobile Assistant Connector are encoded
in this QR code. Scan it with special option available on connection settings page of Prestashop Mobile Assistant application to
autofill access settings and connect to your Prestashop store.', 'mobassistantconnector_qr_data' => call_user_func('base64_encode', Tools::jsonEncode($this->getDataToQr())), 'mobassistantconnector_devices' => '', 'mobassistantconnector_base_url' => $base_url, 'mobassistantconnector_key' => hash('sha256', $login_data['login'] . $login_data['password'] . _COOKIE_KEY_));
foreach ($languages as $lang) {
$data['mobassistantconnector_tracknum_template_text'][$lang['id_lang']] = Configuration::get('MOBASSISTANTCONNECTOR_TN_TEXT', $lang['id_lang']);
}
return $data;
}
示例2: getAgileSellerLink
public function getAgileSellerLink($id_seller, $alias = NULL, $id_lang = NULL)
{
if (!$id_seller) {
return '';
}
include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
$sellerinfo = new SellerInfo(SellerInfo::getIdBSellerId($id_seller));
$id_shopurl = Shop::get_main_url_id($sellerinfo->id_shop);
$shopurl = new ShopUrl($id_shopurl);
$url = $shopurl->getURL() . $this->getLangLink();
if (Module::IsInstalled('agilemultipleshop')) {
include_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php";
if ((int) Configuration::get('ASP_SHOP_URL_MODE') == AgileMultipleShop::SHOP_URL_MODE_DOMAIN) {
return $url;
}
}
if ($this->allow) {
return $url;
} else {
return _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . 'index.php?controller=agileseller&id_seller=' . (int) $id_seller;
}
}
示例3: hookActionObjectUpdateAfter
public function hookActionObjectUpdateAfter($params)
{
if (isset($params['object']) && !empty($params['object'])) {
$object = $params['object'];
$type = get_class($object);
if (!in_array($type, array('Product', 'Manufacturer', 'Supplier', 'Category', 'CMS', 'CMSCategory'))) {
// Ok not our job
return;
}
$shops = $this->getShopsIds();
$link = new Link();
$redirect_list = array();
// Incremental way, it's a bugfix, for supplier for example
$shop_urls = array();
$shop_urls[] = 'https:';
$shop_urls[] = 'http:';
foreach ($shops as $id_shop) {
$shop = new ShopUrl($id_shop);
$shop_urls[] = str_replace(array('http://', 'https://'), '', $shop->getURL(true));
$shop_urls[] = str_replace(array('http://', 'https://'), '', $shop->getURL(false));
}
$shop_urls = array_unique($shop_urls);
foreach ($shops as $id_shop) {
// foreach langs, foreach shops ...
$langs = Language::getLanguages(false, $id_shop, true);
foreach ($langs as $id_lang) {
switch ($type) {
case 'Manufacturer':
$old_link = $link->getManufacturerLink($object, null, null, null, $id_lang, $id_shop);
break;
case 'Supplier':
$old_link = $link->getSupplierLink($object, null, null, null, $id_lang, $id_shop);
break;
case 'CMS':
$old_link = $link->getCMSLink($object, null, null, $id_lang, $id_shop);
break;
case 'Product':
$old_link = $link->getProductLink($object, null, null, null, $id_lang, $id_shop);
break;
case 'Category':
$old_link = $link->getCategoryLink($object, null, $id_lang, null, $id_shop);
break;
case 'CMSCategory':
$old_link = $link->getCMSCategoryLink($object, null, $id_lang, $id_shop);
break;
default:
// UFO
break;
}
// Escape shops urls, it's a multishop relative approach
$old = str_replace($shop_urls, '', $old_link);
$old = '/' . ltrim($old, '/');
// Avoid duplicates, simplify complex mapings
$md5 = md5($old);
if (!isset($redirect_list[$md5])) {
$redirect_list[$md5]['old'] = $old;
$redirect_list[$md5]['shops'][] = $id_shop;
} elseif (!in_array($id_shop, $redirect_list[$md5]['shops'])) {
$redirect_list[$md5]['shops'][] = $id_shop;
}
}
}
if (!empty($redirect_list)) {
foreach ($redirect_list as $redirect) {
foreach ($redirect['shops'] as $id_shop) {
$this->checkConflict($redirect['old'], $id_shop);
}
}
}
}
}