- Posts: 38
- Thank you received: 0
Adding badges to compare view
- teamtmedia
-
Topic Author
- Offline
Less
More
10 years 8 months ago #227826
by teamtmedia
Adding badges to compare view was created by teamtmedia
-- url of the page with the problem -- : localhost
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.6.8
-- Browser(s) name and version -- : FF43
I have been trying to hack this one together but just can't. I would like to call the badges into the compare view. Could you give me the correct php so that I can drop it into that view.
Many thanks.
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.6.8
-- Browser(s) name and version -- : FF43
I have been trying to hack this one together but just can't. I would like to call the badges into the compare view. Could you give me the correct php so that I can drop it into that view.
Many thanks.
Please Log in or Create an account to join the conversation.
10 years 8 months ago #227855
by Xavier
Replied by Xavier on topic Adding badges to compare view
Hi,
So the code to display the badge is present in the view "product / show_block_img", you have to take it from there and add it in the "product / compare" view.
The default code is:
You have to adapt it with the correct variables, and add it right after the img html tag.
So the code to display the badge is present in the view "product / show_block_img", you have to take it from there and add it in the "product / compare" view.
The default code is:
Code:
if(!empty($this->element->badges))
$html .= $this->classbadge->placeBadges($this->image, $this->element->badges, '0', '0',false);
The following user(s) said Thank You: teamtmedia
Please Log in or Create an account to join the conversation.
- teamtmedia
-
Topic Author
- Offline
Less
More
- Posts: 38
- Thank you received: 0
10 years 8 months ago #227945
by teamtmedia
Replied by teamtmedia on topic Adding badges to compare view
I knew it would be there...somewhere but at the end of a day at the code-face I couldn't see the woods for the trees so turned to you guys as I knew you would know exactly where to lift it from. Nice one!
Please Log in or Create an account to join the conversation.
- teamtmedia
-
Topic Author
- Offline
Less
More
- Posts: 38
- Thank you received: 0
10 years 8 months ago #227949
by teamtmedia
Replied by teamtmedia on topic Adding badges to compare view
OK. That wasn't as easy as I thought. I'm just not pulling in the data from the field. I know that it is a separate table from the product table so I'm having an issue with the code. To be honest I do feel that this is an omission on this view as it would be logical to compare any relevant deals, discounts, etc when comparing the product. I would, and I'm sure I'm not alone, appreciate the right code to accomplish this.
I imagine that this would be a useful addition to the compare tool (which is an important part of any technical e-commerce solution).
Cheers
I imagine that this would be a useful addition to the compare tool (which is an important part of any technical e-commerce solution).
Cheers
Please Log in or Create an account to join the conversation.
10 years 8 months ago #227966
by nicolas
Replied by nicolas on topic Adding badges to compare view
Hi,
The badges are not loaded in that view so of course you can't just use the placeBadges function there like that.
You first need to load and add the badges to the products.
To do that, you can use that code:
$this->badgeClass->loadBadges($this->element);
The badges are not loaded in that view so of course you can't just use the placeBadges function there like that.
You first need to load and add the badges to the products.
To do that, you can use that code:
$this->badgeClass->loadBadges($this->element);
Please Log in or Create an account to join the conversation.
Time to create page: 0.150 seconds