0

how can I get the store category url?

I know I can get the store direct url like this,

<a href="{{store direct_url="contacts"}}">Contact Us</a>

But what about the store's categories?

The categories I have in my store, such as 'Wines', 'Food', etc, so if I do this,

{{store direct_url="wines"}} // returns http://mystore/wine

I will get a 404 error page. Because the url should be like this,

http://mystore/wine.html

Any idea?

  • Simply try: {{store direct_url="wine.html"}} – MagePsycho Jun 7 '14 at 17:49
  • actually I need to remove .html from my url - is it possible? – laukok Jun 7 '14 at 17:53
  • Go to admin->System->Configuration ->Catalog ->Search Engine Optimizations -> delete “.html” from Product URL Suffix and Category URL Suffix, – MagePsycho Jun 7 '14 at 18:00
1

If you know the id of the category you get the url using widgets:

{{widget type="catalog/category_widget_link" template="catalog/category/widget/link/link_inline.phtml" id_path="category/8"}}

the value of template can be:

  1. catalog/category/widget/link/link_block.phtml
  2. catalog/category/widget/link/link_inline.phtml
0

I don't think there's a clean way to get a category URL w/o trailing slash.

I would do it like this:

{{store direct_url=""}}wines.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.