View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006536 | OXID eShop (all versions) | 1.01. Products (product, categories, manufacturer, promotions etc.) | public | 2016-11-02 12:29 | 2016-11-02 17:44 |
| Reporter | alfredbez | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Product Version | 4.10.1 / 5.3.1 | ||||
| Summary | 0006536: getLongDesc() doesn't return LongDesc outside Category | ||||
| Description | OxidEsales\Eshop\Application\Model\Category@getLongDesc does only work if you are currently on the category-page in the frontend. It is not possible to get a the LongDescription for a Category from e.g. the homepage. | ||||
| Steps To Reproduce | 1. enter a longdesc for a category 2. replace '<a [{if' with '<a data-longdesc="[{$ocat->getLongDesc()}]" [{if' in https://github.com/OXID-eSales/oxideshop_ce/blob/507e4a3bb8cb043f3e2514a3be795dd3afa79609/source/Application/views/azure/tpl/widget/header/categorylist.tpl#L29 3. open homepage and see empty data-longdesc attribute 4. go to the category-page in frontend and see the entered description as expected | ||||
| Additional Information | getShortDescription() works as expected (= outside the category) | ||||
| Tags | No tags attached. | ||||
| Theme | All | ||||
| Browser | All | ||||
| PHP Version | Not defined | ||||
| Database Version | Not defined | ||||
|
|
I created also a gist with demo-code: My Changes: https://gist.github.com/alfredbez/6e7e677643d048846648b998c562b2c8/revisions Output: https://gist.github.com/alfredbez/6e7e677643d048846648b998c562b2c8#gistcomment-1911943 |
|
|
The long description of categories is generally not used in standard Oxid Shops. The LongDesc is not displayed in the homepage due to hard-coded columns being fetched from oxcategories table in the database (https://github.com/OXID-eSales/oxideshop_ce/blob/master/source/Application/Model/CategoryList.php#L150). When oxlongdesc is required in categorylists, the method _getSqlSelectFieldsForTree() can be extended to include "$sTable.oxlongdesc as oxlongdesc" in the variable $sFieldList. |