Fórum OpenCart Brasil

Por um e-commerce livre, confiável e profissional

#8098
fabioppg escreveu:
Msan2011,

Te dei a vara e a isca...
Agora eu posso até te orientar aonde você pode ir para alterar seus links (à pesca). por exemplo:

Mudando os links do módulo Carrinho:
Abra o arquivo: catalog\controller\module\cart.php , na linha 17 e 18:

Altere de:
Código: Selecionar todos
		
         $this->data['view'] = HTTP_SERVER . 'index.php?route=checkout/cart';
         $this->data['checkout'] = HTTPS_SERVER . 'index.php?route=checkout/shipping';
Para:
Código: Selecionar todos
        $this->data['view'] = HTTP_SERVER . 'carrinho';
        $this->data['checkout'] = HTTPS_SERVER . 'finalizar';
Simples assim ...

Com as outras páginas e módulos é a mesma coisa...
Lembre-se que os links sempre ficam dentro do diretório controller.

Exemplo:
URL da página: http://www.seusite.com.br/index.php?rou ... ckout/cart[/b]

Procure o arquivo:
catalog\controller\checkout\cart.php
Cara,
Você não me deu o peixe! Mais sim a "muqueca" prontinha!!!!
Muito obrigado por sua atenção! Melhor do que isso não tem... Ficou muito bom agora!!!
Parabéns a todos que contribuem com este fórum! Em especial ao nosso amigo: "fabioppg"!!!
#8700
estou usando a versão 1.5.1.1 e o código não estava funcioanando, não sei se é pq o meu site está dentro de uma pasta (/loja) ou se é incopatibilidade mesmo.
fiz as seguintes modificações e deu certo
Código: Selecionar todos
$uri = substr(str_replace(strrchr($this->request->server['REQUEST_URI'], '?'), '', $this->request->server['REQUEST_URI']),1 );
$uri = (substr($uri, -1)=='/')? $uri = substr($uri, 0, strrpos($uri, '/')) : $uri;
		
if(substr_count($uri, '/') > 0){
	$uri  = explode('/', $uri);
}

if(isset($uri[2])){
	$uri = $uri[1].'/'.$uri[2];
}else{
	$uri = $uri[1];
}
		
// Só irá retornar algo se a queryString "Route" nao estiver setada.
if((!isset($this->request->get['route'])) AND (trim($uri[1]) <> '')){
	if(array_key_exists($uri[1], $this->pages)){
		$this->request->get['route'] = $this->pages[$uri[1]]; // evita incompatibilidade com outros módulos que usam a QueryString "route"
		return $this->forward($this->pages[$uri[1]]);
	}
}
desculpa se fiz algo errado, sou novo no mundo do opencart
#9308
Outra forma é utilizar o htaccess para redirecionar a url antiga para nova!
Eu utilizo htaccess para redirecionar url no site http://pastaepizza.com.br/home que é um catalogo online.
Como exemplo, eu modifiquei o controller contact.php que fica localizado em catalog\controller\information\contact.php
Imagem



Htaccess:
RewriteEngine On
RewriteBase /

RewriteRule ^fale-conosco/?$ index.php?route=information/contact [NC,L]
RewriteRule ^fale-conosco/enviado/?$ index.php?route=information/contact/success [NC,L]
RewriteRule ^mapa-do-site/?$ index.php?route=information/sitemap [NC,L]
RewriteRule ^home/?$ index.php?route=common/home [NC,L]



RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)\?*$ index.php?_route_=$1 [L,QSA]

A única dificuldade é modificar os arquivos manualmente, mais funciona! :D
#9340
keijers escreveu:i can't get it to work.
I've installed the route.php and added the line to index.php but nothing happens.
i've installed opencart in a subdirectory, so maybe that's the problem?

i'm using 1.4.9.5

can somebody help me out?

thanks
You enabled. Htaccess file?
#9345
Manoel Vidal escreveu:
keijers escreveu:i can't get it to work.
I've installed the route.php and added the line to index.php but nothing happens.
i've installed opencart in a subdirectory, so maybe that's the problem?

i'm using 1.4.9.5

can somebody help me out?

thanks
You enabled. Htaccess file?
yes it's enabled in the backoffice and i renamed it to .htaccess on the server
#9348
keijers escreveu:
Manoel Vidal escreveu:
keijers escreveu:i can't get it to work.
I've installed the route.php and added the line to index.php but nothing happens.
i've installed opencart in a subdirectory, so maybe that's the problem?

i'm using 1.4.9.5

can somebody help me out?

thanks
You enabled. Htaccess file?
yes it's enabled in the backoffice and i renamed it to .htaccess on the server
Have you tested if it works the url seo?
#9349
Manoel Vidal escreveu:[
Have you tested if it works the url seo?
The 'normal' build in seo url works. So if i open a category page it's like http://www.mywebsite.com/category/product-name . But after i install this mod I still see the index.php?route=common/home and index.php?route=account/account.

I guess it has to do something with the subfolder where my shop is installed. It's now http://www.mywebsite.com/1/
So i guess i have to edit the code somewhere, but i don't know how?
#9353
keijers escreveu:
Manoel Vidal escreveu:[
Have you tested if it works the url seo?
The 'normal' build in seo url works. So if i open a category page it's like http://www.mywebsite.com/category/product-name . But after i install this mod I still see the index.php?route=common/home and index.php?route=account/account.

I guess it has to do something with the subfolder where my shop is installed. It's now http://www.mywebsite.com/1/
So i guess i have to edit the code somewhere, but i don't know how?
I'll do a test using a subfolder and give you feedback ;)
#9356
Manoel Vidal escreveu:
keijers escreveu:
Manoel Vidal escreveu:[
Have you tested if it works the url seo?
The 'normal' build in seo url works. So if i open a category page it's like http://www.mywebsite.com/category/product-name . But after i install this mod I still see the index.php?route=common/home and index.php?route=account/account.

I guess it has to do something with the subfolder where my shop is installed. It's now http://www.mywebsite.com/1/
So i guess i have to edit the code somewhere, but i don't know how?
I'll do a test using a subfolder and give you feedback ;)
thanks! I was also trying to get it right but i don't get any further.
Hope you can find the problem!