// Context part 29

This commit is contained in:
tDidierjean
2011-08-08 13:17:12 +00:00
parent 2b71b8be68
commit 0310674fe0
40 changed files with 195 additions and 360 deletions
+13 -21
View File
@@ -358,20 +358,18 @@ class TrustedShopsRating extends AbsTrustedShops
public function displayInformationsPage()
{
global $cookie;
$link = '';
if (strtolower(Language::getIsoById((int)$cookie->id_lang)) == 'de')
if (strtolower(Context::getContext()->language->iso_code) == 'de')
$link = '<p><b><a style="text-decoration: underline; font-weight: bold; color: #0000CC;" target="_blank" href="https://www.trustedshops.de/shopbetreiber/kundenbewertung_anmeldung.html?partnerPackage=PrestaShop&ratingProduct=RATING_PRO&et_cid=14en&et_lid=29069" target="_blank">Jetzt bei Trusted Shops anmelden!</a></b></p><br />';
if (strtolower(Language::getIsoById((int)$cookie->id_lang)) == 'en')
if (strtolower(Context::getContext()->language->iso_code) == 'en')
$link = '<p><b><a style="text-decoration: underline; font-weight: bold; color: #0000CC;" target="_blank" href="http://www.trustedshops.com/merchants/membership.html?shopsw=PRESTA&et_cid=53&et_lid=3361" target="_blank">Apply now!</a></b></p><br />';
if (strtolower(Language::getIsoById((int)$cookie->id_lang)) == 'fr')
if (strtolower(Context::getContext()->language->iso_code) == 'fr')
$link = '<p><b><a style="text-decoration: underline; font-weight: bold; color: #0000CC;" target="_blank" href="http://www.trustedshops.fr/marchands/tarifs.html?shopsw=PRESTA&et_cid=53&et_lid=3362" target="_blank">Enregistrement Trusted Shops</a></b></p><br />';
return '<fieldset>
<legend><img src="'.__PS_BASE_URI__.'modules/'.self::$module_name.'/logo.gif" alt="" />'.$this->l('Learn More').'</legend>
<img src="'._MODULE_DIR_.self::$module_name.'/img/ts_rating_'.$this->_getAllowedIsobyId($cookie->id_lang).'.jpg" />
<img src="'._MODULE_DIR_.self::$module_name.'/img/ts_rating_'.$this->_getAllowedIsobyId(Context::getContext()->language->id).'.jpg" />
<h3>'.$this->l('Trusted Shops Customer Rating').'</h3>
<p>'.$this->l('For online buyers, positive and verifiable customer ratings are an important indication of an online shop\'s trustworthiness. The required software is already included in Prestashop, so you can start collecting customer ratings in your online shop too. Integration is easy with just a few clicks.').'</p>
@@ -392,31 +390,27 @@ class TrustedShopsRating extends AbsTrustedShops
public function getApplyUrl()
{
global $cookie;
$lang = $this->_getAllowedIsobyId($cookie->id_lang);
$lang = $this->_getAllowedIsobyId(Context::getContext()->language->id);
return $this->apply_url_base[$lang].'?partnerPackage='.self::PARTNER_PACKAGE.'&shopsw='.self::SHOP_SW.'&website='.
urlencode(_PS_BASE_URL_.__PS_BASE_URI__).'&firstName='.urlencode($cookie->firstname).'&lastName='.
urlencode($cookie->lastname).'&email='.urlencode(Configuration::get('PS_TAB0_SHOP_EMAIL')).'&language='.strtoupper(Language::getIsoById((int)($cookie->id_lang))).
urlencode(_PS_BASE_URL_.__PS_BASE_URI__).'&firstName='.urlencode(Context::getContext()->customer->firstname).'&lastName='.
urlencode(Context::getContext()->customer->lastname).'&email='.urlencode(Configuration::get('PS_TAB0_SHOP_EMAIL')).'&language='.strtoupper(Context::getContext()->language->iso_code).
'&ratingProduct=RATING_PRO'.$this->apply_url_tracker[$lang];
}
public function getRatingUrl($id_order = '')
{
global $cookie;
$buyer_email = '';
if ($cookie->isLogged())
if (Context::getContext()->cookie->isLogged())
{
if (empty($id_order) && !empty($cookie->id_customer))
$id_order = $this->_getLastOrderId($cookie->id_customer);
if (empty($id_order) && !empty(Context::getContext()->customer->id))
$id_order = $this->_getLastOrderId(Context::getContext()->customer->id);
$buyer_email = $cookie->email;
$buyer_email = Context::getContext()->customer->email;
}
return $this->getRatingUrlWithBuyerEmail((int)($cookie->id_lang), $id_order, $buyer_email);
return $this->getRatingUrlWithBuyerEmail(Context::getContext()->language->id, $id_order, $buyer_email);
}
public function getRatingUrlWithBuyerEmail($id_lang, $id_order = '', $buyer_email = '')
@@ -460,9 +454,7 @@ class TrustedShopsRating extends AbsTrustedShops
public function getWidgetFilename()
{
global $cookie;
return self::$module_name.'/cache/'.Configuration::get('TS_TAB0_ID_'.(int)($cookie->id_lang)).'.gif';
return self::$module_name.'/cache/'.Configuration::get('TS_TAB0_ID_'.(int)Context::getContext()->language->id).'.gif';
}
public function hookOrderConfirmation($params)