代码之家  ›  专栏  ›  技术社区  ›  jsims281

Drupal和Ubercart-购买含税和不含税的产品

  •  0
  • jsims281  · 技术社区  · 17 年前

    我正在开发一个在英国使用的电子商务网站,并被要求 .

    AAC

    有人知道有什么巧妙的技巧或模块可以让我做到这一点吗?

    1 回复  |  直到 6 年前
        1
  •  0
  •   jsims281    17 年前

    我们决定只查看不含增值税的价格,而不能以不含增值税的价格购买。

    如果有人需要,以下是用于获取完整价格和计算较低免增值税价格的代码/公式:

    (在我的版本中,uc_aac.module的第217-222行-您需要一个类为“排除增值税”的div)。

    //Get the updated price, minus VAT
    new_val = parseFloat(updated_price.substr(1));
    new_val = (100/115) * new_val;
    new_val = Math.round(new_val*Math.pow(10,2))/Math.pow(10,2);
    
    $(".excluding_VAT").html("£"+new_val+" exc VAT");