Jump to content

Make product links to category page instead of product page, Is it possible??


Muhammad Mustafa
 Share

Recommended Posts

I am trying to achieve this without any success, lets assume I have the product A which is in category 1 whenever product A links appear in Prestashop (i.e: featured products, new products, cart ...etc) the link refer you to product's A page, I want to change it so whenever you click that link you forwarded to category 1 instaed
Is it possible?? any idea how to achieve this??

Share this post


Link to post
Share on other sites

  • 4 weeks later...

I found my way out, in case anyone wanna do it, just go to classes/link.php
find and replace getCategoryLink function with this one

   public function getCategoryLink($id_category, $alias = NULL)
   {
       if (is_object($id_category))
           return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$id_category->link_rewrite.'/') : 
           (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.intval($id_category->id));
       if ($alias)
           return ($this->allow == 1) ? (_PS_BASE_URL_.__PS_BASE_URI__.$alias.'/') :
           (_PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.intval($id_category));
       return _PS_BASE_URL_.__PS_BASE_URI__.'category.php?id_category='.intval($id_category);
   }



update associated .htaccess and bingo ;)

Share this post


Link to post
Share on other sites

  • 9 months later...

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More