2017-12-13 3 views
0

기록 그것은 단지 내가젠토 최근 본 제품은,</p> <pre><code>{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}} </code></pre> <p>그러나 기본 젠토 최근 본 상품은 로그인 한 사용자 만 지원을 차단 CMS를 페이지에 차단 내가 기본 젠토의 1.9.x 최근 본 상품을 사용하고 사용자

에 로그인 할 때 내가 파일

/public_html/app/code/core/Mage/Reports/Block/Product/Abstract.php 

을 확인하고 그것은 라인 수 (138) 재미 보여 ction은 결과를 필터링하기 위해 제품 컬렉션에 대한 고객 ID를 설정합니다.

하지만 정상적인 사이트 방문자에게는 그런 종류의 ID가없는 것 같습니다.

if ($this->getCustomerId()) { 
         $this->_collection->setCustomerId($this->getCustomerId()); 
} 

누구든지 id를 위 또는 다른 방법으로 설정하여 최근에 본 제품을 얻는 방법을 알고 있습니다.

나는이 대답을 시도했지만 그것은 작동하지 않은 모든

How to get Recently View Product For Guest User In Magento

+0

그 코드를 사용해 본 후 알려 주실 수 있습니까? 어떤 오류가 있습니까? –

+0

오류가 발생하지 않고 응답 코드 –

+0

에 따라 "protected function _toHtml()"함수 내에서 해당 코드를 변경하면 아무 일도 일어나지 않습니다. –

답변

0

1 단계 : 관리자로 이동 -> CMS-> 페이지 -> AnyCmsPage

2 단계 : 이동 -> AnyCmsPage-> 디자인

3 단계 : 복사 PASE 레이아웃 업데이트 XML에 다음 코드

<reference name="content"> 
<block type="reports/product_viewed" name="home.reports.product.viewed" alias="product_viewed" template="reports/home_product_viewed.phtml" after="product_new"> 
    <action method="addPriceBlockType"> 
     <type>bundle</type> 
     <block>bundle/catalog_product_price</block> 
     <template>bundle/catalog/product/price.phtml</template> 
    </action> 
</block> 
</reference> 
+0

사용자가 사이트에 로그인해도 문제가 없지만 그렇지 않은 경우 제품을 표시하지 않습니다. –

관련 문제