View Issue Details

IDProjectCategoryView StatusLast Update
0002762OXID eShop (all versions)3.1. Design, GUI, UXpublic2011-05-12 14:34
Reportertjungcl Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version4.5.0 revision 34568 
Summary0002762: empty brands in slider and by-brand not affected by "hide empty categories" option
DescriptionIn the demo data there are a few brands without any products assigned to them.
Those brands (Mauirippers,Big-Matsol) are shown in the brand-slider as well as in the brand-overview /by-brand/.

From frontends point of view the brands are very like categories, so of course you could just deactivate them, but it would be appropriate if they where hidden when the option blDontShowEmptyCategories is true.

BTW: the option perfShowActionCatArticleCnt affects brands.
TagsNo tags attached.
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

Mitmacher

2011-05-12 12:30

reporter   ~0004548

Yes, for me that's a known problem and therefore I integrated this functionality into a free extension some time ago, see this:
http://www.oxid-esales.com/de/exchange/extensions/show-manu
(only manu_oxmanufacturerlist.php for this topic)

But it is also my opinion that it would be much better to get this as a standard oxid feature because it makes sense somehow. You only have to add 5 lines of code to get this working and this is what I came up with (works with oxid 4.3/4.4/4.5):

    public function loadManufacturerList()
    {
        $sLangAdd = '';
        if (oxView::getShopVersion() < '4.5.0')
            $sLangAdd = oxLang::getInstance()->getLanguageTag();

        $oBaseObject = $this->getBaseObject();

        $sFieldList = $oBaseObject->getSelectFields();
        $sViewName = $oBaseObject->getViewName();
        $this->getBaseObject()->setShowArticleCnt( $this->_blShowManufacturerArticleCnt );

        $sWhere = '';
        if ( !$this->isAdmin() ) {
            $sWhere = $oBaseObject->getSqlActiveSnippet();
            $sWhere = $sWhere?" where $sWhere and ":' where ';
            $sWhere .= "{$sViewName}.oxtitle{$sLangAdd} != '' ";

            if ($this->getConfig()->getConfigParam('blDontShowEmptyCategories')) {
                $sArtTable = getViewName('oxarticles');
                $sWhere .= "AND {$sViewName}.oxid IN (SELECT oxmanufacturerid FROM {$sArtTable} ";
                $sWhere .= "WHERE {$sArtTable}.oxshopid=".oxDb::getDb()->quote($this->getConfig()->getShopId())." AND oxactive=1)";
            }
        }

        $sSelect = "select {$sFieldList} from {$sViewName} {$sWhere} order by {$sViewName}.oxtitle{$sLangAdd}";
        $this->selectString( $sSelect );
    }

Mitmacher

2011-05-12 12:57

reporter   ~0004549

According to the BTW-note:
I am not sure, but it could have something to do with this(?):
https://bugs.oxid-esales.com/view.php?id=2871

dainius.bigelis

2011-05-12 14:33

reporter   ~0004555

Reminder sent to: tjungcl

Hi,

To solve that case, best would be to add separate option for "Hide empty Brands". But we cannot include this into standard eShop because it would slowdown the performance: it would need to check the amount of products for each Brand each time.
So this case can be solved by including such feature as a module for eShop. And I think there is one already created, please check in OXID Exchange. I will post the link here later, if will find one.

Anyway - that's a good idea and would be nice to have for some smaller shops for sure.

Best regards,