1

I am trying to grab the category ID from the last segment to use in a redirect back to that category page but nothing is showing up.

My main page is http://domain.com/store/shop/C28, then you click to view a single entry.

the entry is http://domain.com/store/product_detail/158

where 158 is the entry_id to display a dynamic entry showing one product.

In my redirect (after adding the product to a cart) I want to go back to http://domain.com/store/shop/C28

I have tried to use this in my add to cart but nothing is parsing for the seg2cat

return="http://hookingrugs.com/store/shop/C{last_segment_category_id}"}

When I view source I just see http://hookingrugs.com/store/shop/C"

with no ID.

Even if I just place {last_segment_category_id} on the page outside of any other tags I still get nothing. Why does low seg2cat not pick up on the last entry ID.

4
  • Have you tried passing {last_segment_category_id} as an embedded variable?
    – CreateSean
    Jan 23 '14 at 17:39
  • how would I do that? Shouldn't it work just on the page not inside of any tags? Is my issue that I am using <a href="{entry_id_path='store/product_detail/'}"> Jan 23 '14 at 17:41
  • Is the category group which this category belongs to enabled? CP Home > Extensions > Low Seg2Cat > Extension Settings
    – Sobral
    Jan 23 '14 at 18:53
  • IT was set to ALL Jan 23 '14 at 19:07
4

Low Seg2Cat doesn't pick-up category information associated with channel entry IDs in the URL - it picks up category information associated with category URL titles in the URL.

So, it is working, but it doesn't do what you thought it might do.

6
  • that is what I was guessing entry_id vs url_title Jan 23 '14 at 17:56
  • So if I am on this page domain.com/store/shop/C28 Shouldn't I be able to use: {last_segment_category_name} {last_segment_category_description} Jan 23 '14 at 18:25
  • Yes, you should. Jan 23 '14 at 18:48
  • doesn't work with C28 but DOES work when using category_url_title as the segment.. Problem is low seg2cat does not offer {last_segment_category_url_title} Jan 23 '14 at 19:06
  • this was my only option return="domain.com/store/shop/category{categories}{category_url_title}{/categories}"} Jan 23 '14 at 19:10

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.