2013-06-10 3 views
1

Magento 매장이 http://www.harmonics.co.uk이고 제품에 PinIt 버튼이 있습니다.PinIt Pinterest Button 이미지가 표시되지 않습니다.

문제는 클릭하면 URL이 정확한 경우에도 쿼리 문자열의 미디어 특성에서 이미지를 가져 오지 않습니다. 내 이미지 및 제품 페이지의 PinIt 버튼을 생성하기 위해 다음 코드를 사용하고

:

<?php 
    $_helper = $this->helper('catalog/output'); 
    $_product = $this->getProduct(); 
    $image = $this->helper('catalog/image')->init($_product, $_product->getImageUrl(), 'image')->resize(150, 150); 
?> 

// PinIt Anchor 
<a class="pinterest" href="http://pinterest.com/pin/create/button/?url=<?php echo $_product->getProductUrl(); ?>&amp;media=<?php echo $image; ?>&amp;description=<?php echo $_product->getName(); ?>" title="Share on Pinterest">&nbsp;</a> 

그것은 작동하는 데 사용하지만 난 대표자 생각은 버튼의 작업 방식을 변경하지만 그럴 수 없어 방법을 참조하십시오. 생성 된 코드는 생성 된 URL이 % 3A 및/또는 % 2F로 바뀌는 것을 제외하면 거의 동일하게 보입니다.

문자열 바꾸기를 시도했지만이 방법도 작동하지 않습니다. 모든 아이디어가 있습니다. 건배.

답변

5

시도는이 일을

<a class="pinterest" href="http://pinterest.com/pin/create/button/?url=<?php echo urlencode($_product->getProductUrl()); ?>&amp;media=<?php echo urlencode($image); ?>&amp;description=<?php echo urlencode($_product->getName()); ?>" title="Share on Pinterest">&nbsp;</a> 
+0

<a class="pinterest" href="http://pinterest.com/pin/create/button/?url=<?php echo $_product->getProductUrl(); ?>&amp;media=<?php echo $image; ?>&amp;description=<?php echo $_product->getName(); ?>" title="Share on Pinterest">&nbsp;</a> 

교체. 이전에 urlencode를 사용했지만 미디어 속성에만 url 속성에 넣는 것을 잊어 버렸습니다. 고마워. –