Skip to content

Magento 2.3.4 couldn't get category image name #27168

@Aravindh468

Description

@Aravindh468

Preconditions (*)

  1. Magento 2.3.4

Steps to reproduce (*)

  1. Create a Category and add an image to that category.
  2. I need to display the category image of few categories based on id in homepage. So i have try to use the code in frontend as below,
$category->getImageUrl()

$category->getImage()
  1. But it returns the tmp path image of that category.
  2. I have even tried using the above codes for getting category image name in vendor/magento/module-catalog/view/frontend/templates/category/image.phtml but end up with getting wrong result.

Expected result (*)

  1. $category->getImageUrl() - It should return full path of category image(localhost/ver1/pub/media/catalog/category/imagename.jpg)

  2. $category->getImage()- It should return only the name of category image(imagename.jpg)

Actual result (*)

  1. Both the code returns temporary(tmp) path image of the category (/localhost/ver1/pub/media/catalog/tmp/category/imagename.jpg)

2.Couldn't get the filename of the category image separately.

Metadata

Metadata

Labels

Component: BackendComponent: ImageIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedReported on 2.3.4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions