Jump to content

problem with friendly URL


Recommended Posts

  • 1 month later...

Even I was facing same problem. And I've a solution 2...

open classes/Link.php and find this:

   public function getProductLink($id_product, $alias = NULL, $category = NULL, $ean13 = NULL)
   {
        if (!isset($this->allow)) $this->allow = 0;
       if (is_object($id_product))
           return ($this->allow == 1)?(_PS_USE_SSL_.__PS_BASE_URI__.$id_product->category.'/'.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_USE_SSL_.__PS_BASE_URI__.($category ? ($category.'/') : '').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);
   }



and replace with this:

   public function getProductLink($id_product, $alias = NULL, $category = NULL, $ean13 = NULL)
   {
        if (!isset($this->allow)) $this->allow = 0;
       //there was an error in line no. 46. when clean url is enabled. fixed on May 19 2009
       if (is_object($id_product))
           return ($this->allow == 1)?(_PS_USE_SSL_.__PS_BASE_URI__.($category ? ($id_product->category.'/') : '').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_USE_SSL_.__PS_BASE_URI__.($category ? ($category.'/') : '').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);
   }



Enjoy!
Regards,
Marghoob Suleman

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 months later...
  • 3 months later...
  • 3 months later...

I tried Marhgoob's code above but it did not work for me. My express-order page is showing the "Web address is not available" once I've entered all the billing and shipping address info and selected "next". Can anyone help with this?

Update: My issue was related to using an e-mail that was already in the DB when attempting to checkout as a guest. Solved!

Link to comment
Share on other sites

  • 9 months later...
  • 3 months later...

Hi Thanks for that worked perfect on presta shop ves 1.3 final. I must point out when you do this fix regenerate the acess file. As it did not work untill I did this for some strange reason. Also if you are copying the above make sure you close the comment about the fix with // at the end.

Link to comment
Share on other sites

(_PS_USE_SSL_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product->id));
If your products keep saying products dont exist try this (_PS_BASE_URI_.__PS_BASE_URI__.'product.php?id_product='.intval($id_product->id));

Happy moding:D

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
...Simply login your store admin page and follow Preferences > Seo&URLs;in this page you may see a lot of rules. delete all rules and save settings. Works like charm.

 

Thanks so much, that was surly the correct fix (charm) for me! I'm so happy now :)

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
×
×
  • Create New...