示例#1
0
    public static function getMainShopDomainSSL()
    {
        if (!self::$main_domain_ssl) {
            $sql = 'SELECT domain_ssl
					FROM ' . _DB_PREFIX_ . 'shop_url
					WHERE main = 1
						AND id_shop=' . Context::getContext()->shop->id;
            self::$main_domain_ssl = Db::getInstance()->getValue($sql);
        }
        return self::$main_domain_ssl;
    }
示例#2
0
 public static function resetMainDomainCache()
 {
     self::$main_domain = array();
     self::$main_domain_ssl = array();
 }
示例#3
0
 /**
  * Generate preview URL
  *
  * @param object $product
  * @param bool $preview
  *
  * @return string preview url
  */
 public function getPreviewUrl($product, $preview = true)
 {
     $context = \ContextCore::getContext();
     $id_lang = \ConfigurationCore::get('PS_LANG_DEFAULT', null, null, $context->shop->id);
     if (!\ShopUrlCore::getMainShopDomain()) {
         return false;
     }
     $is_rewrite_active = (bool) \ConfigurationCore::get('PS_REWRITING_SETTINGS');
     $preview_url = $context->link->getProductLink($product, $product->link_rewrite[$context->language->id], \CategoryCore::getLinkRewrite($product->id_category_default, $context->language->id), null, $id_lang, (int) $context->shop->id, 0, $is_rewrite_active);
     if (!$product->active && $preview) {
         $preview_url = $this->getPreviewUrlDeactivate($preview_url);
     }
     return $preview_url;
 }