【问题标题】:Drupal and Ubercart - buy products including and excluding taxDrupal 和 Ubercart - 购买含税和不含税的产品
【发布时间】:2010-11-01 11:07:13
【问题描述】:

我正在开发一个在英国使用的电子商务网站,我被要求让用户购买含税或不含税的产品

我稍微修改了AAC 模块,以显示包含或不包含增值税的价格,具体取决于通过“查看包含/不包含的价格”链接设置的 cookie,但当然,每当将产品添加到购物车时,价格是数据库中的价格 - 即包括增值税。

有没有人知道任何巧妙的技巧或模块可以让我做到这一点?

【问题讨论】:

    标签: drupal e-commerce ubercart


    【解决方案1】:

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

    如果有人需要,这里是用于获取全价并计算出较低的免增值税价格的代码/公式:

    (我的版本中 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");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-08
      • 1970-01-01
      相关资源
      最近更新 更多