Jump to content

(SOLUCIONADO)Enlazar categoria directamente con url externa


Recommended Posts

Hola a todos estoy intentando vincular las categorias de mi tienda principal con diferentes multitiendas que tengo creadas en prestashop. 

Uso la version 1.6 y mi web es www.santcugatexpress.com y uso la plantilla por defecto

Os cuento lo que he hecho pero no logro enlazarlo. 

 

He modificado los siguientes directorios: category-tree-branch.tpl

 

/themes/mi-plantilla/modules/blockcategories/

 

/themes/modules/blockcategories/

 

quedandome el codigo de la siguiente manera:

(el texto en rojo es la categoria y la url a donde quiero dirigir la subcategoria)

Luego he forzado compilacion y he vaciado el cache desde Parametros Avanzados.

Pero no he logrado que lo vincule

Por favor ayuda!! que estoy haciendo mal?????????

Mil Gracias!!!

 

{*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2014 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
 
<li {if isset($last) && $last == 'true'}class="last"{/if}>
<a href="{if $node.id=='65'}http://www.santcugatexpress.com/FarmaciaBeringuer/es/65-farmacia-beringues{else}{$node.link|escape:'htmlall':'UTF-8'}{/if}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:'htmlall':'UTF-8'}">{$node.name|escape:'htmlall':'UTF-8'}</a>
{if $node.children|@count > 0}
<ul>
{foreach from=$node.children item=child name=categoryTreeBranch}
{if $smarty.foreach.categoryTreeBranch.last}
{include file="$branche_tpl_path" node=$child last='true'}
{else}
{include file="$branche_tpl_path" node=$child last='false'}
{/if}
{/foreach}
</ul>
{/if}
</li>
 
Edited by santcugatexpress (see edit history)
Link to comment
Share on other sites

RewriteCond %{HTTP_HOST} ^tudominio\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.tudominio\.com$
RewriteRule ^urldecategoria$ "http\:\/\/www\.dominioaredirigir\.com\/carpeta\/" [R=301,L]

Debes colocar en tu htaccess estas lineas. Si me envias una de las que deseas redirigir te doy un ejemplo mas funcional y te explicomejor

Link to comment
Share on other sites

vale! genial

pues me.gustaria redirigir la sub categoria "Farmacia Beringuer" que tengo en la categoria Farmacias de mi web a www.google.com (por poner un ejemplo)

 

por otro lado no veo com acceder al htaccess, como accedo y donde debo de colocar el codigo. muchas gracias y perdona la inexperiencia

Link to comment
Share on other sites

el .htaccess es un archivo de texto .txt que está incluido en el directorio raiz donde tienes todos los archivos de la instalacion de prestashop, la redireccion tienes que colocarla

 

o encima de 

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

o debajo de 

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

Asi no perderás la informacion en caso de tener que regenerar el .htaccess

Link to comment
Share on other sites

RewriteCond %{HTTP_HOST} ^santcugatexpresstudominio\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.santcugatexpresstudominio\.com$
RewriteRule ^FarmaciaBeringuer\/es\/65\-farmacia\-beringues$ "http\:\/\/www\.google\.com\/" [R=301,L]

Debes colocar en tu htaccess estas lineas. Si me envias una de las que deseas redirigir te doy un ejemplo mas funcional y te explicomejor

 

Si no estoy mal deberia de quedar algo asi.

el .htaccess lo puede ver entrando por ftp deberia de estar en la raiz de el servidor

Link to comment
Share on other sites

Hola, 

Lo acabo de intentar pero no me funciona, 

quiero enlazar la subcategoria, farmacia Beringer con esta multitienda de prestashop

el enlace es este

http://www.santcugatexpress.com/FarmaciaBeringuer/es/

te pego tambien el codigo modificado a ver si me ayudas a donde esta el error

Muchas gracias!!!

 

RewriteCond %{HTTP_HOST} ^santcugatexpress\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.santcugatexpress\.com$
RewriteRule ^FarmaciaBeringuer\/es\/65\-farmacia\-beringues$ "http\:\/
 
# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this 
 
comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
 
<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
 
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
 
# Images
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg 
 
[L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/
 
$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}
 
img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %
 
{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %
 
{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %
 
{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]
 
+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]
 
+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2
 
$3.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
 
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^FarmaciaBeringuer$ /FarmaciaBeringuer/ [L,R]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^FarmaciaBeringuer/(.*) /$1 [L]
 
# Images
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg 
 
[L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/
 
$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}
 
img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %
 
{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %
 
{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %
 
{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]
 
+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]
 
+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2
 
$3.jpg [L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
 
# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^.*$ - [NC,L]
RewriteCond %{HTTP_HOST} ^www.santcugatexpress.com$
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>
 
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/x-font-woff .woff
 
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
ExpiresByType font/opentype "access plus 1 year"
ExpiresByType font/ttf "access plus 1 year"
ExpiresByType font/otf "access plus 1 year"
ExpiresByType application/x-font-ttf "access plus 1 year"
ExpiresByType application/x-font-otf "access plus 1 year"
</IfModule>
 
FileETag INode MTime Size
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/html text/css text/javascript 
 
application/javascript application/x-javascript
</IfModule>
</IfModule>
 
#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404
 
# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this 
 
comment when .htaccess will be generated again
Link to comment
Share on other sites


RewriteCond %{HTTP_HOST} ^santcugatexpress\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.santcugatexpress\.com$
RewriteRule ^FarmaciaBeringuer\/es\/65\-farmacia\-beringues$ "http\:\/\/www\.santcugatexpress\.com\/FarmaciaBeringuer\/es\/" [R=301,L]

 

 

Cuentame que tal te fue

Link to comment
Share on other sites

nada, no logro enlazarlo! :(

 

este es el codigo que he pegado 

 

RewriteCond %{HTTP_HOST} ^santcugatexpress\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.santcugatexpress\.com$
RewriteRule ^FarmaciaBeringuer\/es\/65\-farmacia\-beringues$ "http\:\/
 
\/www\.santcugatexpress\.com\/FarmaciaBeringuer\/es\/" [R=301,L]
# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this 
 
comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
 
<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
Link to comment
Share on other sites

Pegalo asi a ver.

 

<IfModule mod_rewrite.c>

 

SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
 
RewriteCond %{HTTP_HOST} ^santcugatexpress\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.santcugatexpress\.com$
RewriteRule ^FarmaciaBeringuer\/es\/65\-farmacia\-beringues$ "http\:\/
 
\/www\.santcugatexpress\.com\/FarmaciaBeringuer\/es\/" [R=301,L]

</IfModule>

 

o verifica desde cpanel puedes crear redirecciones

Link to comment
Share on other sites

  • 2 weeks later...

Te funcionó?? Me interesaría hacerlo pero para enlazar la categoría directamente al loggin

 Ve al archivo category.tpl y dejas asi esta parte mas o menos

{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
 {if $category->id == 8}     {Tools::redirect('index.php?controller=authentication')}   {/if}

Cambia el 8 por el id de la categoria que quierás redireccionar

 

 

Para redireccionar a cualquier otra pagina asi:

{if $category->id == 8}   {Tools::redirect('http://www.google.es')}{/if}
Edited by ventura (see edit history)
Link to comment
Share on other sites

Gracias Antonio, pero no consigo que me redirija, se queda en blanco ahora... lo he puesto asi:

{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
 {if $category->id == 35}     {Tools::redirect('http://flamencoazahara.com/es/mi-cuenta')}{/if}

No sé si tendrá que ver, pero es una subcategoría lo que quiero enlazar... 

Link to comment
Share on other sites

Gracias Antonio, pero no consigo que me redirija, se queda en blanco ahora... lo he puesto asi:

{include file="$tpl_dir./errors.tpl"}
{if isset($category)}
 {if $category->id == 35}     {Tools::redirect('http://flamencoazahara.com/es/mi-cuenta')}{/if}

No sé si tendrá que ver, pero es una subcategoría lo que quiero enlazar... 

 

 

 

En ese caso prueba con:

 {if $subcategory.id_category == 35}   {Tools::redirect('index.php?controller=authentication')} {/if}
Link to comment
Share on other sites

No lo consigo, debo ser realmente torpe jajaja

 

Mira, esta es mi web http://flamencoazahara.com, donde pone Vest. Señora en el menu, abajo te salen dos subcategorias, en la de arriba Nueva temporada, te sale una que es para registrarse (ya que las que van ahi realmente solo las ven los registrados)

A ver si es por algo de esa configuración por lo que no me sale...

Link to comment
Share on other sites

  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...