2017-09-27 8 views
-1

私は助けが必要です。私は製品のためにプレstashopのモジュールを持っています。 ここでは、ユニットの価格と選択した数量の合計が表示されます。付加価値税(VAT)モジュールのプレスタシップを追加

また、VATを含めた合計金額を表示する必要があります。私はそれを行うことはできません。

私は、私が

{ 

      var price = jsonData['price']; 
      var unitprice = jsonData['unitprice']; 
      var preutotaliva = jsonData['preutotaliva']; 
      //var stringtotal = unitprice + '<br/><span class="mp_our_price">(Total '+price+')</span>'; 
      var stringtotal = price; 
      $('#our_price_display').html(stringtotal); 
      if($('.mp_total_price').length) 
       $('.mp_total_price').html(price); 
      if($('.mp_unit_price').length){ 
       $('.mp_unit_price').html(unitprice); 
       if($('.mp_total_price_IVA').length) 
      $('.mp_total_price_IVA').html(preutotaliva); 

      } 

答えて

0

私は申し訳ありませんが、多分私はよく自分自身を説明していないの.tplコードを追加(合計)


   <div class="preu_total_IVA"> <span class="text_preu_IVA">IVA incluido:</span> <span id="mp_total_price_IVA"></span> <span style="font-weight:normal;">€</span></div> 

.TPLコードを追加します。私が必要とするのは、製品の価格に応じて、私はVATを計算します。

これはプレstashによってもたらされますが、私は製品ページにプレスタッシュを使用していません。 私はVATなしの価格x単位と合計価格を計算するモジュールを使用します。必要なのはVATで計算することです。

これは私がjavascriptでモジュールを持っているものです。

var price = jsonData['price']; 
 
\t \t \t \t var unitprice = jsonData['unitprice']; 
 
\t \t \t \t //var stringtotal = unitprice + '<br/><span class="mp_our_price">(Total '+price+')</span>'; 
 
\t \t \t \t var stringtotal = price 
 
\t \t \t \t $('#our_price_display').html(stringtotal); 
 
\t \t \t \t if($('.mp_total_price').length) 
 
\t \t \t \t \t $('.mp_total_price').html(price); 
 
\t \t \t \t if($('.mp_unit_price').length){ \t 
 
\t \t \t \t \t $('.mp_unit_price').html(unitprice); 
 
\t \t \t \t }

+0

私は(ちなみに「のvar stringtotal =価格」の後にタグを閉じる行方不明...)混乱して少しだけど...あなたはリンクを私に提供することができますか? VATを含むページの価格を表示したい場合は、.jsのモジュールtplファイルを変更する必要があります。 – Aurora

関連する問題