// Warning is now displayed for shop without url
This commit is contained in:
+11
-1
@@ -869,4 +869,14 @@ class ShopCore extends ObjectModel
|
||||
{
|
||||
return (int)Db::getInstance()->getValue(sprintf('SELECT COUNT(*) FROM`'._DB_PREFIX_.'group_shop` WHERE `id_group_shop` = %d', (int)$id));
|
||||
}
|
||||
}
|
||||
|
||||
public static function getShopWithoutUrls($id_shop = false)
|
||||
{
|
||||
$without = array();
|
||||
$shops = self::getShops();
|
||||
foreach ($shops as $shop)
|
||||
if ((!$id_shop || $shop['id_shop'] == $id_shop) && empty($shop['domain']) && empty($shop['uri']))
|
||||
$without[] = $shop;
|
||||
return $without;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,20 @@ class AdminShopControllerCore extends AdminController
|
||||
);
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
$id_shop = ($this->context->shop->getContextType() == Shop::CONTEXT_SHOP ? $this->context->shop->id : false);
|
||||
$shops = Shop::getShopWithoutUrls($id_shop);
|
||||
if (count($shops))
|
||||
{
|
||||
$shop_url_configuration = '';
|
||||
foreach ($shops as $shop)
|
||||
$shop_url_configuration .= sprintf($this->l('No url is configured for shop: %s'), '<b>'.$shop['name'].'</b>').' <a href="'.$this->context->link->getAdminLink('AdminShopUrl').'&addshop_url&id_shop='.$shop['id_shop'].'">'.$this->l('click here').'</a><br />';
|
||||
$this->content .= '<div class="warn">'.$shop_url_configuration.'</div>';
|
||||
}
|
||||
parent::initContent();
|
||||
}
|
||||
|
||||
public function initList()
|
||||
{
|
||||
$this->addRowAction('edit');
|
||||
|
||||
Reference in New Issue
Block a user