- Posts: 52
- Thank you received: 4
Badges on Category Images
4 years 1 month ago #345333
by Ginius
Badges on Category Images was created by Ginius
-- url of the page with the problem -- :
www.autovakshop.nl
I know it's possible to place badges on products (in product view), but I also like to place badges on category images.
Is that possible?
I know it's possible to place badges on products (in product view), but I also like to place badges on category images.
Is that possible?
Please Log in or Create an account to join the conversation.
4 years 1 month ago #345336
by nicolas
Replied by nicolas on topic Badges on Category Images
Hi,
There is no option for that by default in HikaShop.
You could create a custom field of the table "category" and of the type "ajax image" so that you could add badge images to categories.
Then, with a bit of PHP code in a view override and a bit of CSS to place the image from the custom field on top of the category image on the listing, it should be doable. So with basic PHP/CSS skills, it should be possible.
Now, to have something more generic, like for example the possible to display several badges on a category, the possibility to have restrictions, like only display the badge if all the products in the category are out of stock, etc, that would be way more complex.
There is no option for that by default in HikaShop.
You could create a custom field of the table "category" and of the type "ajax image" so that you could add badge images to categories.
Then, with a bit of PHP code in a view override and a bit of CSS to place the image from the custom field on top of the category image on the listing, it should be doable. So with basic PHP/CSS skills, it should be possible.
Now, to have something more generic, like for example the possible to display several badges on a category, the possibility to have restrictions, like only display the badge if all the products in the category are out of stock, etc, that would be way more complex.
Please Log in or Create an account to join the conversation.
4 years 1 month ago #345367
by Ginius
Replied by Ginius on topic Badges on Category Images
Thanks Nicolas,
can't I reuse somethng like this on categories?
if(!empty($this->element->badges))
$html .= $this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0',false);
can't I reuse somethng like this on categories?
if(!empty($this->element->badges))
$html .= $this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0',false);
Please Log in or Create an account to join the conversation.
4 years 1 month ago #345369
by nicolas
Replied by nicolas on topic Badges on Category Images
Unfortunately, it's not that easy because the $this->element->badges variable is not available for a category because categories don't have badges in HikaShop normally.
Please Log in or Create an account to join the conversation.
4 years 2 weeks ago #345989
by joomleb
Replied by joomleb on topic Badges on Category Images
Hi guys,
+1 to have the "Badges feature" working also for Category
+1 to have the "Badges feature" working also for Category
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.062 seconds