2015-02-17 92 views
1

我在哪裏可以找到NetSuite中'salespricehtml'或'addtocarthtml'的代碼?我在哪裏可以在NetSuite中找到'salespricehtml'的代碼?

我想在我的網站的產品頁面上添加Schema.org Microdata,尤其是價格,但數量和價格正在使用標籤/名稱'salespricehtml'在網站上顯示,如<%=getCurrentAttribute('item','salespricehtml')%>。如果您可以提供幫助,將不勝感激! :)

+0

對此有任何更新,Ron?我也在尋找salesPriceHTML,但出於不同的原因。不幸的是,下面的答案實際上並不能回答你原來的問題。 – John 2015-10-12 15:57:16

回答

0

這裏是我的代碼:

<div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> 
      <h3>   
       <span itemprop="priceCurrency" content="AUD">$</span><span itemprop="price" content="<%=getCurrentAttribute("item","salesPrice")%>"> 
       <script language="javascript"> 
        salesPriceRaw('<%=getCurrentAttribute("item","salesPrice")%>');     
       </script> 
       </span> 
       <small> 
       <script language="javascript"> 
        gstHtml('<%=getCurrentAttribute("item","salestaxcode")%>'); 
       </script> 
       </small> 
       <span itemprop="availability" content="In stock"></span> 
      </h3> 
      </div> 

在頭部下面的腳本來格式化納稅信息,並儘可能接近使用微標準的規定儘可能:

<script type="text/javascript"> 
    function salesPriceRaw (salesPrice) { 
    var price = salesPrice.replace('$', ''); 
    document.write(price); 
    } 
    function gstHtml (gst) { 
    if (gst == 'GST:TS-AU') { 
    document.write(' + GST '); 
    } else { 
     document.write('(GST Exempt) '); 
    } 
    } 
</script> 

這是一個黑客真的,但它的工作原理。本質上你應該從你的getCurrentAttribute標籤中移除html部分。希望這可以幫助!

相關問題