我在Shopify中找到全局變量的數據類型的難度令人難以置信。我的問題可能是一個範圍問題,但它們應該不難告訴我一種數據類型。他們的技術支持說主題作家應該回答它,主題作者說Shopify應該回答它。恕我直言,他們中的任何一個都應該能夠回答它。所以我非常感謝你能提供的任何智慧。Shopify:全球變量數據類型
我的客戶是一個批發商誰不會做$ 50.00以下的訂單。在總訂單(cart.total_price | money_with_currency)的變量中運行比較應該相當容易,但我的代碼完全不成功。該代碼還應允許零售商更改其順序並再次運行比較。我已經將各種可能的括號組合添加到變量和塊中,以防出現語法錯誤。
<div class="six columns cart-buttons">
{% if cart.total_price | money_with_currency < 50 %}
<div style="font-weight: bold; color: #900; margin-bottom: 15px;">Your order must be at least $50.00</div>
{% endif %}
{% if cart.total_price | money_with_currency > 50 %}
<input class="button nice" type="submit" value="{{settings.checkout_text}}" name="checkout" />
{% if additional_checkout_buttons %}
<em>or</em>
{{ content_for_additional_checkout_buttons }}
{% endif %}
{% endif %}
</div> <!-- end cart buttons div -->
令人難以置信! {%assign total_price = cart.total_price | money_without_currency |次數:1%}在嘗試其他組合後經受了數小時的挫折。 - 我認爲全局變量可以像其他變量一樣使用,但似乎Shopify變量還包含一些必須運行的處理,因此將結果賦給局部變量。 - 我相信Shopify是用Ruby編寫的,所以我想知道這個結構是Ruby還是Shopify? – Nora 2014-12-05 15:37:41