Quantcast
Channel: OXID Community Forum
Viewing all articles
Browse latest Browse all 6951

Make product variant selection as images

$
0
0
Hello, I'm new here on the forum :)

As far as I've seen OXID CE has (v4.8.3) no way for the variants selection on the product detail template to be displayed as variant images, or am I wrong?

The customer for whom I develop a theme wants a selection of the variants to be presented as an image for each variant.

The code I have used and modified until now is in "widget/product/selectbox.tpl" template file.

Ex. code:
PHP Code:

[{foreach from=$oSelections item=oSelection}]
                    <
li class="[{if $oSelection->isDisabled()}]js-disabled disabled[{/if}]">
                        <
a data-selection-id="[{$oSelection->getValue()}]" href="[{$oSelection->getLink()}]"
                           
class="[{if $oSelection->isActive()}]selected[{/if}]">[{$oSelection->getName()}]</a>
                        [{*<
img class="img-responsive" src="[{$oSelection->getImageUrl()}]" alt="Image"/>*}]
                        <
div class="debug hidden">
                            [{
$oSelection|var_dump}]
                        </
div>
                    </
li>
                [{/foreach}] 

The problem is that the "oSelection" object, doesn't have and image URL attribute. I need it badly though. Is there a way to get out one or more images for the variant?

Thanks in advance

Viewing all articles
Browse latest Browse all 6951

Trending Articles