View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003627 | OXID eShop (all versions) | 1.01. Products (product, categories, manufacturer, promotions etc.) | public | 2012-02-22 21:21 | 2012-12-21 10:57 |
Reporter | jkrug | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.5.7 revision 41909 | ||||
Fixed in Version | 4.6.6 revision 54646 | ||||
Summary | 0003627: getVariantListExceptCurrent() on easy variant wrong | ||||
Description | If you are on a variant-child product of a single variant (no multi variants) it returns too much objects. | ||||
Steps To Reproduce | Go 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. | ||||
Tags | Products | ||||
Attached Files | |||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
related to | 0002184 | resolved | mindaugas.rimgaila | error in spl implementation of Iterator |
has duplicate | 0004705 | closed | jurate.baseviciene | Variant appears twice |
has duplicate | 0004710 | closed | jurate.baseviciene | After clicking on first variant, the second variant is shown twice. |
|
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)? |
|
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. |
|
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] |
|
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; } |
|
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 ) ); } |