View Issue Details

IDProjectCategoryView StatusLast Update
0006294OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2015-12-29 13:57
Reporterheinrich.franz 
PrioritynormalSeverityminorReproducibilityalways
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>
[{/if}]

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)
action=like&app_id=115665678479440&color_scheme=light&container_width=0&href=http%3A%2F%2Fdemoshop.oxid-esales.com%2Fprofessional-edition%2FKiteboarding%2FTrapez-ION-SOL-KITE-2011.html&layout=button_count&locale=en_US&sdk=joey"

cannonical url in page:
<link rel="canonical" href="http://demoshop.oxid-esales.com/professional-edition/Kiteboarding/Trapeze/Trapez-ION-SOL-KITE-2011.html">

Steps To Reproduce1) Open http://demoshop.oxid-esales.com/professional-edition/Kiteboarding/Trapeze/Trapez-ION-SOL-KITE-2011.html (Like button is there with some likes)
2) login https://demoshop.oxid-esales.com/professional-edition/admin/
3) open product 1401
4) add additionally parent category "Kiteboarding" as category
5) goto http://demoshop.oxid-esales.com/professional-edition/Kiteboarding/Trapez-ION-SOL-KITE-2011.html
6) like button is there, but there are 0 likes
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
MySQL VersionNot defined

Activities

leofonic

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();
        }
    }