X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   General questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=66)
-   -   Clean URL and Category id (https://forum.x-cart.com/showthread.php?t=77039)

Ed B. 07-14-2019 11:36 AM

Clean URL and Category id
 
Hello, I am trying to write a module which adds an output to a catalogue page of certain categories (should this be in the forum "Modifying designs and features"?).
The problem is that if I enable clean URL $_GET['category_id'] doesn't give the Category id. Would there be any solution for this?



Thank you very much in advance.

cflsystems 07-14-2019 03:16 PM

Re: Clean URL and Category id
 
Why are you using $_GET? Use XC way - \XLite\Core\Request::getInstance()->category_id

Ed B. 07-14-2019 11:14 PM

Re: Clean URL and Category id
 
Oh, that works fine, thank you. As a matter of fact, I had "tried" it and somehow I kept making syntax errors wrapping it, so I had given away the idea :oops: But calling this method directly, things do work.


All times are GMT -8. The time now is 01:03 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.