View Issue Details

IDProjectCategoryView StatusLast Update
0006294OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2015-12-29 13:57
Status acknowledgedResolutionopen 
Product Version4.9.6 / 5.2.6 
Target VersionFixed in Version 
Summary0006294: Facebook like button is not shown for cannonical page
DescriptionSee steps for reprod.

getCanonicalUrl() is used in like.tpl

[{if $oView->isActive('FbLike') && $oViewConf->getFbAppId()}]
    <fb:like href="[{if $parent != 'footer'}][{$oView->getCanonicalUrl()}][{else}][{$oViewConf->getCurrentHomeDir()}][{/if}]" layout="button_count" action="like" colorscheme="light"></fb:like>

but if you debug with dev tools, you see that like button doesn't get cannonical url (that is in available in source code of page, see below)

cannonical url in page:
<link rel="canonical" href="">

Steps To Reproduce1) Open (Like button is there with some likes)
2) login
3) open product 1401
4) add additionally parent category "Kiteboarding" as category
5) goto
6) like button is there, but there are 0 likes
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined



2015-12-29 13:57

reporter   ~0011396

You can extend oxwarticledetails with the following method:

    public function getCanonicalUrl(){
        $oActTopView = $this->getConfig()->getTopActiveView();
        if ($oActTopView){
            return $oActTopView->getCanonicalUrl();