Jump to content

Question about Friendly URL and paste dialog


Recommended Posts

Hi everyone

 

need some suggestion about change friendly url in rc3

 

main category

from

=> http://prestashop/1-ipod

to

===> http://prestashop/ipod or

===> http://prestashop/category/ipod

 

sub category

from

=> http://prestashop/2-head-set

to

===> http://prestashop/ipod/head-set or

===> http://prestashop/category/ipod/head-set

 

manufacturer

from

=> http://prestashop/1_Apple

to

===> http://prestashop/manufacturer/apple

 

Suppliers

from

=> http://prestashop/1__AppleStore

to

===> http://prestashop/supplier/appleStore

 

product page

from

=> http://prestashop/1-ipod-nano.html

to

===> http://prestashop/ipod-nano.html or

===> http://prestashop/ipod/ipod-nano.html

 

 

in  add new product text area, when using ctrl-v, its always open pop up dialog, can we disable it, like homepage editorial

 

sorry for my bad english

 

thx a lot.

Link to comment
Share on other sites

just wanna share my trial and error result  ;D

 

product page

from

=> http://prestashop/1-ipod-nano.html

to

=> http://prestashop/ipod-nano-1.html

 

 

edit .htaccess file in your presta root directory

 

replace

RewriteRule ^([a-zA-Z0-9-]*)-([0-9]+).html(.*)$ product.php?id_product=$2$3 [L,E]

 

with

#back up for product page url

#RewriteRule ^([a-zA-Z0-9-]*)-([0-9]+).html(.*)$ product.php?id_product=$2$3 [L,E]

 

RewriteRule ^([a-zA-Z0-9-]*)-([0-9]+).html(.*)$ product.php?id_product=$2$3 [L,E]

 

 

edit /classes/Link.php

public function getProductLink($id_product, $alias = NULL, $ean13 = NULL)

{

if (!isset($this->allow)) $this->allow = 0;

if (is_object($id_product))

return ($this->allow == 1)?(__PS_BASE_URI__.intval($id_product->id).'-'.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'.html') :

(_PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product->id));

elseif ($alias)

return ($this->allow == 1)?(__PS_BASE_URI__.intval($id_product).'-'.$alias.($ean13 ? '-'.$ean13 : '').'.html') :

(_PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product));

else

return _PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product);

}

 

replace with

// backup for product page url

/*

public function getProductLink($id_product, $alias = NULL, $ean13 = NULL)

{

if (!isset($this->allow)) $this->allow = 0;

if (is_object($id_product))

return ($this->allow == 1)?(__PS_BASE_URI__.intval($id_product->id).'-'.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'.html') :

(_PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product->id));

elseif ($alias)

return ($this->allow == 1)?(__PS_BASE_URI__.intval($id_product).'-'.$alias.($ean13 ? '-'.$ean13 : '').'.html') :

(_PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product));

else

return _PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product);

}

*/

//product page url begin

public function getProductLink($id_product, $alias = NULL, $ean13 = NULL)

{

if (!isset($this->allow)) $this->allow = 0;

if (is_object($id_product))

return ($this->allow == 1)?(__PS_BASE_URI__.$id_product->link_rewrite.($id_product->ean13 ? '-'.$id_product->ean13 : '').'-'.intval($id_product->id).'.html') :

(_PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product->id));

elseif ($alias)

return ($this->allow == 1)?(__PS_BASE_URI__.$alias.($ean13 ? '-'.$ean13 : '').'-'.intval($id_product).'.html') :

(_PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product));

else

return _PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product);

}

//product page url end

 

not yet try to category, manufaturer and supplayer, but i think, all of them using the same way.

 

but i really wish to be

http://prestashop/product-name.html or category-name/product-name.html

http://prestashop/main-category-name

http://prestashop/main-category-name/sub-category-name

http://prestashop/manufacturer/manufacturer-name

http://prestashop/supplier/supplier-name

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...