本文整理汇总了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);
}
}
}
}
}