2014-06-27 98 views
0

我已經設法將其他開放圖標記添加到我們的Magento頭部,但沒有運氣顯示價格。如何添加og:價格:等於Magento

分頁符,如果我添加代碼,如:

元屬性= 「OG:價格:量」 內容= 「?貨幣($ finalPrice,真,假);>」/

的價格也需要被剝離的貨幣符號。

頁例如: http://www.discountdisplays.co.uk/html/contemporary-bar-stool.html

任何幫助將非常感激。

SOLUTION

我設法使用下面的代碼,以獲得正確的價格:

<meta property="og:price:amount" content="<?php echo Mage::registry('product')->getFinalPrice(); ?>" /> 
+0

'分頁符'不是一個好問題描述。如果你能找到其他有用的信息,請查看你的'/ path/to/magento/var/log /'和'exception.log'或'system.log'。另外,你確定你寫了'content =「currency($ finalPrice,...);?>」'?這是錯誤的,可能已經是你的錯誤的來源。試試'content =「<?= currency($ finalPrice,true,false);?>」'代替。 –

回答

0

試試

Mage::registry('current_product')->getFinalPrice(); ?> 

而不是

Mage::registry('product')->getFinalPrice(); ?> 

這將讓目前的產品。

0

使用下面的一次

$_coreHelper = Mage:;helper('core'); 

    $finalPrice= $_coreHelper->currency(Mage::registry('current_product') 
->getFinalPrice(),false,true); 

此代碼會給你porduct量

相關問題