Artikeldetailansicht / Variantenbilder

Hi zusammen,

hab jetzt mal die Artikeldetailansicht dahingehend verändert, dass nur noch Varianten
mit dem Hauptbild angezeigt werden. Funktioniert soweit wirklich super, allerdings wird beim Ändern der multidimensionalen Variante nicht das jeweilige Artikeldetailbild mitgeswitcht…

So sieht also die Detailansicht im Template aus:


<!-- inc/product.tpl -->

[{*
<div class="hl">[{$product-category->getIconUrl()}]</div>
*}]

[{if $head}]
    <div id='smallHeader[{if $testHeader}]_[{$testHeader}][{/if}]' class="h3 clb [{if $head}] head[{/if}] [{$size|default:''}]">
    [{if $head_link}]<a id='headerTitleLink_[{$testid}]' href='[{$head_link}]' [{if $oView->noIndex()}] rel='nofollow'[{/if}]>[{/if}]
        [{$head}]
        [{if $head_link}]</a>[{/if}]
    [{if $head_desc}] <small id='headerDesc_[{$testid}]'>[{'$head_desc'|strip_tags}]</small>[{/if}]
    </div>
[{/if}]


[{if $showMainLink}]
    [{assign var='_productLink' value=$product->getMainLink()}]
[{else}]
    [{assign var='_productLink' value=$product->getLink()}]
[{/if}]

[{* x1 *}]
[{if $size=='x1'}]
<div class='x1_product'>

<form name="tobasket.[{$testid}]" action="[{$oViewConf->getSelfActionLink()}]" method="post">
    
    <a class='product_link product_title' href='[{$_productLink}]'>
        <span class='product_variant'>[{if $product->oxarticles__oxvarselect->value}]<b>Variante:</b> [{$product->oxarticles__oxvarselect->value|html_entity_decode|replace:"|":", "}][{/if}]</span>
        <div class='clearer'></div>
    </a>

    <p><img src="[{$product->getIconUrl() }]" alt="[{ $variant->oxarticles__oxtitle->value|strip_tags }] [{ $product->oxarticles__oxvarselect->value|default:'' }]" /></p>


    <div>[{ oxmultilang ident="INC_PRODUCTITEM_ARTNOMBER2" }] [{ $product->oxarticles__oxartnum->value }]</div>
    <div class="flag [{if $product->getStockStatus() == -1}]red[{elseif $product->getStockStatus() == 1}]orange[{elseif $product->getStockStatus() == 0}]green[{/if}]"></div>
    
    [{oxhasrights ident='SHOWSHORTDESCRIPTION'}]
    <div class='product_short_description'>
        [{$product->oxarticles__oxshortdesc->value|html_entity_decode|html_entity_decode}]
    </div>
    [{/oxhasrights}]
    

    <div class='buy_block'>

        <div class='product_price'>
            [{oxhasrights ident='SHOWARTICLEPRICE'}]
            [{if $product->getFPrice()}]
                [{$product->getFPrice()|replace:"ab":"<span class='ab'>ab</span>"}] <span class='currency'>[{$currency->sign}]</span>
            [{/if}]
            [{/oxhasrights}]
        </div>

        <div class='link_versandkosten'>[{ oxmultilang ident="DETAILS_PLUSSHIPPING" }]<a rel='nofollow' href='[{$oViewConf->getBaseDir()}]info/versand-und-kosten.html' >[{ oxmultilang ident="DETAILS_PLUSSHIPPING2" }]</a></div>


    
        [{oxhasrights ident='TOBASKET'}]
        [{if !$product->isNotBuyable()}]
            <div>
                <label>[{oxmultilang ident='DETAILS_QUANTITY'}]</label> <input type="text" name="am" value="1" size="3" />   
                <input class='button warenkorb_button' type="submit" value="[{oxmultilang ident="INC_PRODUCTITEM_ADDTOCARD2"}]" onclick="oxid.popup.load();" />
            </div>
        [{/if}]
        [{/oxhasrights}]


        [{* sonderpreis link *}]
        <div class='sonderpreis_container'>
        [{if $product->oxarticles__oxblfixedprice->value == '0'}]
            <a class='sonderpreis_button' href='[{$_productLink}]#preisalarm_link' rel='nofollow' >[{ oxmultilang ident='DETAILS_PRICEALARM' }]</a>
        [{/if}]
        </div>
        
    </div>


    [{* Details button *}]


    <div class="details_description_button"><a href="[{$_productLink}]" title="Produktbeschreibung aktualisieren">aktualisieren Sie die<br /> Produktbeschreibung!</a></div>

    <!-- hidden -->
    <div class='hidden'>
        
        [{$oViewConf->getHiddenSid()}]
        [{$oViewConf->getNavFormParams()}]
        <input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
        [{if $owishid}]
            <input type="hidden" name="owishid" value="[{$owishid}]">
        [{/if}]
        [{if $toBasketFunction}]
            <input type="hidden" name="fnc" value="[{$toBasketFunction}]">
        [{else}]
            <input type="hidden" name="fnc" value="tobasket">
        [{/if}]
        
        <input type="hidden" name="aid" value="[{$product->oxarticles__oxid->value}]">
        
        [{if $altproduct}]
            <input type="hidden" name="anid" value="[{$altproduct}]">
        [{else}]
            <input type="hidden" name="anid" value="[{$product->oxarticles__oxnid->value}]">
        [{/if}]
        
        [{if $recommid}]
            <input type="hidden" name="recommid" value="[{$recommid}]">
        [{/if}]
        
        <input type="hidden" name="pgNr" value="[{$pageNavigation->actPage-1}]">        
        <input id="am_[{$testid}]" type="hidden" name="am" value="1">
        
        

        
    </div><!-- / hidden -->
    
    
    
    
    
    <div class='clearer'></div>

</form>
</div>
[{/if}][{* / x1 *}]



Hier wird in der variant_selector.tpl das Bild ausgegeben, dieses müsste
natürlich jetzt pro Farbe geändert werden…


[{*if $oView->isMdVariantView()*}]

  <div class="picture">
    <img src="[{ $oView->getActPicture() }]" id="product_img" class="photo" alt="[{ $product->oxarticles__oxtitle->value|strip_tags }] [{ $product->oxarticles__oxvarselect->value|default:'' }]">
  </div>

  <div style="display: none">
  [{foreach from=$oView->getVariantList() name=variants item=variant_product}]     
    <div id=mdvariant_[{$variant_product->getId()}]>
      [{include file="inc/x1_product.tpl" product=$variant_product size="x1" altproduct=$product->getId() isfiltering=false class=lastinlist testid="Variant_"|cat:$variant_product->oxarticles__oxid->value}]
    </div>
  [{/foreach}]
    <div id=mdvariant_[{$product->getId()}]>
      [{include file="inc/x1_product.tpl" product=$product size="x1" altproduct=$product->getId() isfiltering=false class=lastinlist testid="Variant_"|cat:$variant_product->oxarticles__oxid->value}]
    </div>
  </div>

    <div id="md_variant_selector">
        [{oxvariantselect value=$product->getMdVariants() separator=" " artid=$product->getId() parentVarName=$product->oxarticles__oxvarname->rawValue}]
    </div>   

    <div id="md_variant_box"></div>
    <div id="colors"></div>
    
  [{oxscript add="oxid.mdVariants.mdAttachAll();"}]
  [{oxscript add="oxid.mdVariants.showMdRealVariant();"}]

[{*/if*}]

Hat mir hierfür vielleicht jemand einen Tip?

Vielen Dank und allerbeste Grüße vom Chris

Hab das hier gelöst:

http://www.oxid-esales.com/forum/showthread.php?t=5944&page=3

Beste Grüße vom Chris