de-vraag
  • 質問
  • タグ
  • ユーザー
通知:
報酬:
登録
登録すると、質問に対する返答やコメントが通知されます。
ログイン
すでにアカウントをお持ちの方は、ログインして新しい通知を確認してください。
追加された質問、回答、コメントには報酬があります。
さらに
ソース
編集
 Pibble
Pibble
質問

cartthrob算術における低変数

こんにちは、これを得るためのposibilityはありますか?


{exp:cartthrob:arithmetic expression="{option_price_numeric} -({option_price_numeric} * {exp:low_variables:single var='early_bird_discount'}/100)"}

この例では、{exp:low_variables:single var = 'early_bird_discount'}は30です 私は "未定義の変数"エラーが出てきて、これが正しいことを知っていますが、私はこの正確な結果がどのように正確に得られるかはわかりません

Update:

Rob Sanchezの最初のオプションを使用すると、次のようなエラーが表示されます:式の未解析EEタグ、解析順序を確認します埋め込みテンプレートの複数のタグにネストされている可能性があります。


{exp:channel:entries channel="events" require_entry="yes" entry_id="{embed:entry_id}"}
  {exp:cartthrob:item_options entry_id="{entry_id}"}
    {categories show_group="24"}
      {options}
        {if option_value == "{embed:option}"}

          {if category_id =="160"}
            {if "{event_early_bird_date format='%U'}" >= "{current_time format='%U'}" && "{exp:low_variables:single var='siteA:early_bird_discount'}" >"{embed:another_discount}"}
{!-- ##### --}
              {exp:cartthrob:arithmetic expression="{option_price_numeric} -({option_price_numeric} * {early_bird_discount}/100)"}
{!-- ##### --}
            {if:else}
              {exp:cartthrob:arithmetic expression="{option_price_numeric} -({option_price_numeric} * {embed:another_discount}/100) + {embed:membrr_price}"}
            {/if}
          {if:elseif category_id =="161"}
            [....]
          {/if}
          [...]

        {/if}
      {/options}
    {/categories}
  {/exp:cartthrob:item_options}
{/exp:channel:entries}

更新2

私は考えている問題を理解しました。 early_bird_discountはsiteAの低い変数ですが、この変数をsiteBで使用しようとしていますので、{early_bird_discount}を使用するとここでは機能しません。 siteBのsiteAからグローバル変数を取得する可能性はありますか?

0 2014-02-11T12:36:14+00:00 1
 Pibble
Pibble
編集された質問 14日 2月 2014 в 11:54
ExpressionEngine
math
low-variables
cartthrob
Vagmi Mudumbai
11日 2月 2014 в 1:17
2014-02-11T13:17:12+00:00
さらに
ソース
編集
#56794081

あなたは2つのことを試すことができます:

1つは、この特定の低変数を早期解析として(変数設定で)設定することです。それで、あなたはこれを次のように呼び出すことができます:

{exp:cartthrob:arithmetic expression="{option_price_numeric} -({option_price_numeric} * {early_bird_discount}/100)"}

あるいは、算術タグにparse = "inward"を追加することもできます:

{exp:cartthrob:arithmetic parse="inward" expression="{option_price_numeric} -({option_price_numeric} * {exp:low_variables:single var='early_bird_discount'}/100)"}
2
0
質問の追加
カテゴリ
すべて
技術情報
文化・レクリエーション
生活・芸術
科学
プロフェッショナル
事業内容
ユーザー
すべて
新しい
人気
1
Roxana Elizabeth CASTILLO Avalos
登録済み 1週間前
2
Hideo Nakagawa
登録済み 1週間前
3
Sergiy Tytarenko
登録済み 1週間前
4
shoxrux azadov
登録済み 1週間前
5
Koreets Koreytsev
登録済み 2週間前
© de-vraag :年
ソース
expressionengine.stackexchange.com
ライセンス cc by-sa 3.0 帰属