"&" en lugar de "&" en el selector de idioma url
-
12-12-2019 - |
Pregunta
cuando el uso de magento selector de idiomas, la URL generada es:
a href="http://www.shop.com/index.php/bags/eastpak.html?___store=en&___from_store=default">
Versión Magento 1.7 se utiliza.
¿Cómo puedo convertir este &
a &?
Es de Magento Redirigir clase de razón para este error?
Solución
Parece ser correcta.Por favor, mira en https://stackoverflow.com/questions/3705591/do-i-encode-ampersands-in-a-href
Otros consejos
Es muy molesto, especialmente en productos de las páginas de la lista, cuando la url contiene todos los parámetros de búsqueda.
Para evitar esto, algunos cambios son necesarios dos archivos :
1) en Mage_Core_Controller_Varien_Action
bajo
protected function _redirectReferer($defaultUrl=null)
{
$refererUrl = $this->_getRefererUrl();
if (empty($refererUrl)) {
$refererUrl = empty($defaultUrl) ? Mage::getBaseUrl() : $defaultUrl;
}
$this->getResponse()->setRedirect($refererUrl);
return $this;
}
agregar
protected function _redirectRefererNoSpecialChars($defaultUrl=null)
{
$refererUrl = $this->_getRefererUrl();
$refererUrl = htmlspecialchars_decode($refererUrl, ENT_NOQUOTES);//this needs to be added
if (empty($refererUrl)) {
$refererUrl = empty($defaultUrl) ? Mage::getBaseUrl() : $defaultUrl;
}
$this->getResponse()->setRedirect($refererUrl);
return $this;
}
2) en Mage_Directory_CurrencyController
cambio $this->_redirectReferer(Mage::getBaseUrl());
con $this->_redirectRefererNoSpecialChars(Mage::getBaseUrl());