sh404 SEF question

  • Posts: 32
  • Thank you received: 0
13 years 5 months ago #21310

Was curious to know how to edit some of the URL's.

Currently, it looks like the URL's are going to:

domain.com/category/product/show/item.......

Is there a way to remove the product/show?

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13410
  • MODERATOR
13 years 5 months ago #21323

You could use sh404sef aliases to modify the URLs to what you want.
Otherwise, you would have to edit the file components/com_hikashop/sef_ext.php and add the code
if($query=='product' && $query=='show'){
unset($query);
unset($query);
}

after the code:
unset($query);

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 0
13 years 5 months ago #21362

Do I need to add this specifically to a certain spot in the file?

I just added it towards the bottom. Sorry not much php experience.



unset($query);
if(!empty($query)){
foreach($query as $name => $value){
$segments[] = $name.':'.$value;
}
}
if($query=='product' && $query=='show'){
unset($query);
unset($query);
}
unset($query);
return implode('/',$segments);
}
}



Did I add it in correctly?

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13410
  • MODERATOR
13 years 5 months ago #21368

No. You added the code:
if($query=='product' && $query=='show'){
unset($query);
unset($query);
}
unset($query);


I told you to add only the code:
if($query=='product' && $query=='show'){
unset($query);
unset($query);
}

I also told you to add that code after the code:
unset($query);

Please Log in or Create an account to join the conversation.

  • Posts: 32
  • Thank you received: 0
13 years 5 months ago #21371

Sorry Nicolas,

Got it, but still getting an error. Understand I may have to use the alias but don't want to do that manually for each one.

Also getting a product/listing in the url for category listings. Is there a way to fix that?


Here is the code now:

unset($query);
if($query=='product' && $query=='show'){
unset($query);
unset($query);
}
if(!empty($query)){
foreach($query as $name => $value){
$segments[] = $name.':'.$value;
}
}
return implode('/',$segments);
}
}



Site: www.dribbleduds.com

I purged URL's, deleted cache and still getting the url.


Hope I still did it right.

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13410
  • MODERATOR
13 years 5 months ago #21374

That should have done it. I don't have other suggestions for that.

You could try a similar modification for the category listings:
if($query=='category' && $query=='listing'){
unset($query);
unset($query);
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum