src/ShopBundle/objects/db/TShopVariantDisplayHandler/TShopVariantDisplayHandler.class.php
public static function GetArticleMatchingCurrentSelection(TdbShopArticle &$oParentArticle, $bOnlyIfAPartialSelectionExists = true)
    {
        $aActiveSelection = TdbShopVariantDisplayHandler::GetActiveVariantTypeSelection(true);
        if (!$bOnlyIfAPartialSelectionExists || (is_array($aActiveSelection) && count($aActiveSelection))) {
            return $oParentArticle->GetVariantFromValues($aActiveSelection);
        } else {
            return null;
        }
    }
public static function GetArticleMatchingCurrentSelection(TdbShopArticle &$oParentArticle, $bOnlyIfAPartialSelectionExists = true)
    {
        $aActiveSelection = TdbShopVariantDisplayHandler::GetActiveVariantTypeSelection(true);
        if (!$bOnlyIfAPartialSelectionExists || (is_array($aActiveSelection) && count($aActiveSelection))) {
            return $oParentArticle->GetVariantFromValues($aActiveSelection);
        } else {
            return null;
        }
    }
public static function GetArticleMatchingCurrentSelection ( TdbShopArticle & $ oParentArticle , $ bOnlyIfAPartialSelectionExists = true ) { $ aActiveSelection = TdbShopVariantDisplayHandler :: GetActiveVariantTypeSelection ( true ) ; if ( ! $ bOnlyIfAPartialSelectionExists || ( is_array ( $ aActiveSelection ) && count ( $ aActiveSelection ) ) ) { return $ oParentArticle -> GetVariantFromValues ( $ aActiveSelection ) ; } else { return null ; } }
return the first article matchin the current selection given a parent article
this can be usefull if a user has selected color but not size for a clothing article and you
want to display the images of the color variant.

@param TdbShopArticle $oParentArticle
@param bool           $bOnlyIfAPartialSelectionExists - set to true if you also want to fetch the first variant if no
user selection (such as color) exists

@return TdbShopArticle
return the first article matchin the current selection given a parent article this can be usefull if a user has selected color but not size for a clothing article and you want to display the images of the color variant .