- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想除以 {{ item.price |没有货币的货币 }} 提高 1.21。我正在隐藏输入值中调用 item.price。
<input type="hidden" name="PRODUCT_PRICE_{{ forloop.index }}" value="{{ item.price |
money_without_currency }}">
When I do the below, it shows the value as "100/1.21" as my test product is 100. Makes sense since HTML doesn't do math.
<form name="addToFavorites" method="post" action="contoso.com">
<input type="hidden" name="PARTNER_KEY" value="34234234234234">
<input type="hidden" name="TOTAL_DOMESTIC_SHIPPING_CHARGE" value="0">
{% for item in cart.items %}
<input type="hidden" name="PRODUCT_ID_{{ forloop.index }}" value="{{ item.sku }}">
<input type="hidden" name="PRODUCT_NAME_{{ forloop.index }}" value="{{ item.title }}">
<input type="hidden" name="PRODUCT_PRICE_{{ forloop.index }}" value="({{ item.price |
money_without_currency }}/1.21)">
<input type="hidden" name="PRODUCT_Q_{{ forloop.index }}" value="{{ item.quantity }}">
<input type="hidden" name="PRODUCT_SHIPPING_{{ forloop.index }}" value="">
<input type="hidden" name="PRODUCT_CUSTOM_1_{{ forloop.index }}" value="{{ item.variant.title }}">
<input type="hidden" name="PRODUCT_CUSTOM_2_{{ forloop.index }}" value="">
<input type="hidden" name="PRODUCT_CUSTOM_3_{{ forloop.index }}" value="">
{% endfor %}
</form>
当我尝试使用 Javascript 时,它仍然只是发布方程 100/1.21 而不是解决方案
<script>
var withoutTax = {{ item.price | money_without_currency }} / 1.21
var euPrice = "name=\"PRODUCT_PRICE_{{ forloop.index }}\" value=\"+withoutTax+\""
window.onload = function() {
//when the document is finished loading, replace everything
//between the <a ...> </a> tags with the value of splitText
document.getElementById("euPrice").innerHTML=euPrice;
}
</script>
<form name="addToFavorites" method="post" action="https://foo.com">;
<input type="hidden" name="PARTNER_KEY" value="987979879879879">
<input type="hidden" name="TOTAL_DOMESTIC_SHIPPING_CHARGE" value="0">
<input type="hidden" name="ORDER_CURRENCY" value="EUR">
{% for item in cart.items %}
<input type="hidden" name="PRODUCT_ID_{{ forloop.index }}" value="{{ item.sku }}">
<input type="hidden" name="PRODUCT_NAME_{{ forloop.index }}" value="{{ item.title }}">
<input type="hidden" id="euPrice">
<input type="hidden" name="PRODUCT_Q_{{ forloop.index }}" value="{{ item.quantity }}">
<input type="hidden" name="PRODUCT_SHIPPING_{{ forloop.index }}" value="">
<input type="hidden" name="PRODUCT_CUSTOM_1_{{ forloop.index }}" value="{{ item.variant.title }}">
<input type="hidden" name="PRODUCT_CUSTOM_2_{{ forloop.index }}" value="">
<input type="hidden" name="PRODUCT_CUSTOM_3_{{ forloop.index }}" value="">
{% endfor %}
</form>
我的最终目标是购买 100 美元的产品,打折 21%,然后插入请在发布信息之前帮忙将商品价格除以 1.21。
最佳答案
您可以使用divided_by
数学过滤器:
{{ item.price | divided_by: 1.21 | money_without_currency }}
关于javascript - 在shopify中划分item.price,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26737527/
我想创建一个 sql 查询,为 2 个不同的查询一起返回结果。例如,我想要以下形式的结果:产品名称, avg(price), min(price), max(price), avg(order), m
我找不到 itemprop s 表示 schema.org 上有两种价格的产品。 价格类型有: 旧价 全新 Markdown 我无法想象,没有适合的 schema.org 标记,但经过长时间的搜索,我
我正在尝试更改 Magento 中的“特价”和“正常价格”措辞。我已经尝试编辑 Mage_Catalogue.csv、重新上传并清除缓存,但无济于事。我还在整个站点内对“常规”和“特殊”文本进行了巨大
考虑下表: sp100_id _date open close bullishness ----------------------------------------------
我试图显示某些产品变体的价格比较,但我不知道如何仅在大于零的变体的价格比较时显示它。它显示的是 0.00 美元价格的比较。 它使用 JavaScript 来动态更新价格。这是代码: 当我有一个原
我需要一些帮助来在 xml 中构建这一行。对于谷歌内容 API 我想要得到的结果是 25 目前我的代码输出这一行 25这是不正确的。 这是我的代码 b = Nokogiri::XML::Builder
我想在产品详细信息页面的价格框中显示带有名称的自定义选项价格。 我也试过这个链接但没有成功this is link i use 所以请给我建议任何解决方案。 最佳答案 首先你必须按下按钮 calcul
我想除以 {{ item.price |没有货币的货币 }} 提高 1.21。我正在隐藏输入值中调用 item.price。 When I do the below, it shows the va
因此,我想验证用户在文本字段中输入的价格: 条件(或限制): 值应始终大于零 值不能包含负号“-” 值不能多次包含小数点。还值不应以小数点开头 此外,我必须记住,这也应该适用于移动设备,因为该应用程
我使用分级价格,并对 1 到 4 之间的数量设定了固定价格,对超过 4 的数量设定了每件商品的价格。 我想修改我的购物车,为数量 >= 1 && 数量 <=4 的商品设置固定价格 我该怎么做? 这是我
Google In-app payment API 中有没有办法从应用中设置商品的价格? 我想在我的应用程序中创建一个捐赠我的应用程序按钮。会有一些预定义的捐赠金额(例如 1 美元、5 美元、10 美
我有一个数据库,其中有一列名为“价格” - 在此列中,价格四舍五入到小数点后 5 位,例如 62.083333 - 我想运行命令将“price”列中的每个值更改为仅 2 位小数,例如 62.08 是否
我的数据库中有一个名为“价格”的字段,它设置为 varchar。它包含美元符号和逗号。 我的数据库中的值是这样的: 100,000 美元 625,005 美元 115,990 美元 2,450,000
我有一个基本的 html 表单,它使用 PHP 向页面添加一些数据。我想使这个表单字段成为“价格”字段。我的 HTML 是: 如何修复此字段,以便用户无法输入随机字母、美元符号、破折号或其他奇怪的格
我试过这段代码,但没有给出解决方案。不使用引导表。我如何管理每项服务的点数。价格如何出现在适当的列中以及点数如何自动管理。 Title Rates
它们是一种将字符串格式化为 $ 价格的内置方式,例如12345.45 转换为 $12,345.45? 最佳答案 假设您使用的是 Cocoa(或只是 Foundation),您可以使用 NSNumber
我正在尝试获取 UniswapV2 上一对的价格:这是我的代码: pragma solidity ^0.5.1; import '@uniswap/v2-core/contracts/interfac
我正在寻找一种替代方法 template/catalog/product/price.phml在一个特定位置使用,并继续在所有其他位置使用现有的 price.phtml 文件。 为了进一步解释,我需要
我正在使用 VBScript(经典 ASP)和 SQL Server;我正在尝试在网站上设置一个部分,您可以在其中查看特定价格水平的产品数量。像这样的东西: $50 - $100 (4) $100 -
鉴于以下价格列表,我试图弄清楚如何仅规范化/提取数字。 INPUT DESIRED_OUTPUT CA$1399.00 1399.00 $1399.11 1399
我是一名优秀的程序员,十分优秀!