View Issue Details

IDProjectCategoryView StatusLast Update
0000826OXID eShop (all versions)4.09. SEO, SEO URLpublic2012-12-10 13:35
Reporterdainius.bigelis Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.1.1 revision 18442 
Fixed in Version4.1.2 revision 18998 
Summary0000826: Parent-article title is not inherited for variant for SEO links generating
DescriptionCurrently the SEO links for variant-articles are generated using the product ID, like:
http://demoshop.oxid-esales.com/professional-edition/Geschenke/Wohnen/2077-01-orange.html
This is due to parent-article is not inherited for variant in SEO urls generating.
Please fix it so the title of parent-article also would be used for variant-articles SEO urls.
TagsNo tags attached.
Theme
BrowserAll
PHP Version5.2.6
Database Version5.0.33

Activities

arvydas_vapsva

2009-04-24 08:43

reporter   ~0000802

Last edited: 2009-04-24 08:43

New urls now looks like:

Parent:
http://shop/Geschenke/Wohnen/Tischlampe-SPHERE.html

Variants:
http://shop/Geschenke/Wohnen/Tischlampe-SPHERE-orange.html
http://shop/Geschenke/Wohnen/Tischlampe-SPHERE-rot.html
http://shop/Geschenke/Wohnen/Tischlampe-SPHERE-violett.html

Change in oxSeoEncoderArticle:

    /**
     * Product parent title cache
     *
     * @var array
     */
    protected static $_aTitleCache = array();

    /**
     * Returns seo title for current article (if oxtitle field is empty, oxartnum is used).
     * Additionally - if oxvarselect is set - title is appended with its value
     *
     * @param oxarticle $oArticle article object
     *
     * @return string
     */
    protected function _prepareArticleTitle( $oArticle )
    {
        $sTitle = '';

        // create title part for uri
        if ( !( $sTitle = $oArticle->oxarticles__oxtitle->value ) ) {
            // taking parent article title
            if ( ( $sParentId = $oArticle->oxarticles__oxparentid->value ) ) {

                // looking in cache ..
                if ( !isset( self::$_aTitleCache[$sParentId] ) ) {
                    $sQ = "select oxtitle from oxarticles where oxid = '{$sParentId}'";
                    self::$_aTitleCache[$sParentId] = oxDb::getDb()->getOne( $sQ );
                }
                $sTitle = self::$_aTitleCache[$sParentId];
            }
        }

        // variant has varselect value
        if ( $oArticle->oxarticles__oxvarselect->value ) {
            $sTitle .= ( $sTitle ? ' ' : '' ).$oArticle->oxarticles__oxvarselect->value . ' ';
        }

        // in case nothing was found - looking for number
        if ( !$sTitle ) {
            $sTitle .= $oArticle->oxarticles__oxartnum->value;
        }

        return $this->_prepareTitle( $sTitle . '.html' );
    }