View Issue Details

IDProjectCategoryView StatusLast Update
0003627OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2012-12-21 10:57
Reporterjkrug Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.5.7 revision 41909 
Fixed in Version4.6.6 revision 54646 
Summary0003627: getVariantListExceptCurrent() on easy variant wrong
DescriptionIf you are on a variant-child product of a single variant (no multi variants) it returns too much objects.
Steps To ReproduceGo to Demoshop and change template to "basic". Call this product http://demoshop.oxid-esales.com/community-edition/Kiteboarding/Zubehoer/Klebeband-DACRON-KITEFIX-weiss.html

You will see that below "Other variants of: Sticky Tape DACRON KITEFIX" the tape in color "black" is listed twice.
TagsProducts
Attached Files
black_type_variant.png (56,149 bytes)   
black_type_variant.png (56,149 bytes)   
exeptcurrent.jpg (126,679 bytes)   
exeptcurrent.jpg (126,679 bytes)   
oxid_varianten_bug3627.gif (23,836 bytes)   
oxid_varianten_bug3627.gif (23,836 bytes)   
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Relationships

related to 0002184 resolvedmindaugas.rimgaila error in spl implementation of Iterator 
has duplicate 0004705 closedjurate.baseviciene Variant appears twice 
has duplicate 0004710 closedjurate.baseviciene After clicking on first variant, the second variant is shown twice. 

Activities

dainius.bigelis

2012-02-23 08:10

reporter   ~0005792

Reminder sent to: jkrug

hi,

I checked that case on demoshop, but cannot see two same variants on this product as you said. Please check the screenshot what I made, to be sure that we are talking about the same place.
Or you are talking about the results of source code (what's not visible in the frontend)?

jkrug

2012-02-23 10:54

reporter   ~0005796

Hi Danius,
thanks for your quick reply. I attached a screenshot too. It just happends on pages of variants (children) not on the parent product.
Hope that helps.

stefan2

2012-02-27 14:24

reporter   ~0005819

Last edited: 2012-02-27 14:30

And its only happend to the first of all variants

use this for the quick riddle:
$oView->getVariantListExceptCurrent()|count gives the right value but the seconde variant is displayed twice...
[code]
    count($oList) = [{$oView->getVariantListExceptCurrent()|count}]
    <hr>
    [{foreach from=$oView->getVariantListExceptCurrent() item='oVariantProduct' name='list_variants'}]
        [{$smarty.foreach.list_variants.iteration}]. [{$oVariantProduct->oxarticles__oxtitle->value}] - [{$oVariantProduct->oxarticles__oxvarselect->value}]
        <hr>
    [{/foreach}]
[/code]

d3

2012-11-19 17:26

reporter   ~0007909

Solution: change details::getVariantListExceptCurrent() to following:

    public function getVariantListExceptCurrent()
    {
        $oList = $this->getVariantList();

        if (is_object($oList)) {
            $oList = $oList->getArray();
        }

        $sOxid = $this->getProduct()->getId();
        if (isset($oList[$sOxid])) {
            unset($oList[$sOxid]);
        }

        return $oList;
    }

aurimas.gladutis

2012-11-26 13:25

reporter   ~0007987

The problem is in oxlist class. The method rewind should look like this:
    public function rewind()
    {
        $this->_blRemovedActive = false;
        $this->_blValid = ( false !== reset( $this->_aArray ) );
    }