本文整理汇总了PHP中Shop::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Shop::add方法的具体用法?PHP Shop::add怎么用?PHP Shop::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shop
的用法示例。
在下文中一共展示了Shop::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createShop
public function createShop($shop_name)
{
// Create default group shop
$shop_group = new ShopGroup();
$shop_group->name = 'Default';
$shop_group->active = true;
if (!$shop_group->add()) {
$this->setError($this->language->l('Cannot create group shop') . ' / ' . Db::getInstance()->getMsgError());
return false;
}
// Create default shop
$shop = new Shop();
$shop->active = true;
$shop->id_shop_group = $shop_group->id;
$shop->id_category = 2;
$shop->id_theme = 1;
$shop->name = $shop_name;
if (!$shop->add()) {
$this->setError($this->language->l('Cannot create shop') . ' / ' . Db::getInstance()->getMsgError());
return false;
}
Context::getContext()->shop = $shop;
// Create default shop URL
$shop_url = new ShopUrl();
$shop_url->domain = Tools::getHttpHost();
$shop_url->domain_ssl = Tools::getHttpHost();
$shop_url->physical_uri = __PS_BASE_URI__;
$shop_url->id_shop = $shop->id;
$shop_url->main = true;
$shop_url->active = true;
if (!$shop_url->add()) {
$this->setError($this->language->l('Cannot create shop URL') . ' / ' . Db::getInstance()->getMsgError());
return false;
}
return true;
}
示例2: init_shop_header
$sql = 'SELECT distinct LOWER(TRIM(sil.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ')) AS id, TRIM(sil.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ') AS name
FROM `' . _DB_PREFIX_ . 'sellerinfo_lang` sil
WHERE sil.id_lang = ' . $context->cookie->id_lang . ' AND LENGTH(TRIM(sil.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ')) > 0
ORDER BY sil.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ' ASC
';
} else {
$sql = 'SELECT distinct LOWER(TRIM(si.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ')) AS id, TRIM(si.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ') AS name
FROM `' . _DB_PREFIX_ . 'sellerinfo` si
ORDER BY si.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ' ASC
';
}
break;
}
if (empty($sql)) {
return array();
}
return Db::getInstance()->ExecuteS($sql);
}
public static function init_shop_header()
{
$main_shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
Context::getContext()->smarty->assign(array('is_agilemultipleshop_installed' => 1, 'header_logo_mode' => intval(Configuration::get('ASP_HEADER_LOGO_MODE')), 'base_dir_default' => $main_shop->getBaseURL(), 'seller_shop_name' => Context::getContext()->shop->name, 'id_shop_owner' => Shop::$id_shop_owner, 'seller_logo_url' => isset(Shop::$sellerinfo) ? SellerInfo::get_seller_logo_url_static(Shop::$sellerinfo->id) : ''));
}
public static function clear_blockcategory_cache()
{
@session_start();
if (!isset($_SESSION['id_shop_owner'])) {
$_SESSION['id_shop_owner'] = 0;
}
if ($_SESSION['id_shop_owner'] != Shop::$id_shop_owner) {
$_SESSION['id_shop_owner'] = Shop::$id_shop_owner;
Context::getContext()->smarty->clearAllCache();
}
}
public static function get_rewrite_rules()
{