مرجع متغيرات وعوامل تصفية Liquid لتطبيق Shopify Order Printer

يمكنك استخدام Liquid لإنشاء قوالبك المخصصة باستخدام تطبيق Shopify Order Printer. باستخدام Liquid، يمكنك إنشاء قوالب نصية وعرضها استنادًا إلى البيانات الفريدة لكل طلب.

مراجع Liquid المدرجة في هذه الصفحة هي امتداد للإصدار مفتوح المصدر من Liquid ومصممة للاستخدام في تطبيق Shopify Order Printer. لعرض المعلومات بناءً على سمات order (الطلب) وshop (المتجر)، يمكنك استخدام قائمة الكائنات، والعلامات، وعوامل التصفية من هذا المرجع لتخصيص قوالبك. يمكنك أيضًا استخدام وثائق Admin GraphQL API لمعرفة التفاصيل حول حقول الكائنات.

استخدام المتغيرات والسمات

في قوالب Shopify Order Printer، كائنات البيانات الأساسية هي order وshop. يمكنك استخدام order.variable_name للوصول إلى سمات الطلب.

يمكن الوصول إلى سمات الطلب الشائعة الاستخدام التالية دون البادئة order.:

  • line_items
  • tax_lines
  • fulfillments
  • transactions
  • discounts
  • refunds
  • shipping_methods
  • customer

على سبيل المثال، إذا كنت ترغب في الوصول إلى متغير العناصر (line items)، فيمكنك استخدام line_items أو order.line_items.

متغيرات Liquid المتاحة في Shopify Order Printer

تتوفر الفئات التالية. تُدرج السمات بالترتيب الأبجدي.

الطلب

تتوفر سمات الطلب التالية في تطبيق Shopify Order Printer:

  • attributes
  • b2b
  • billing_address
  • cancel_reason
  • cancel_reason_label
  • cancelled
  • cancelled_at
  • cart_level_discount_applications
  • checkout_id
  • checkout_payment_collection_url
  • company
  • company_location
  • confirmation_number
  • created_at. الوقت الذي تمت فيه معالجة الطلب. وهو يساوي order.processed_at من GraphQL API. استخدم عامل التصفية date لتنسيق الطابع الزمني، على سبيل المثال باستخدام {{ order.created_at | date: "%B %e, %Y" }}.
  • customer
  • discounts. مهملة لأنه لا يتم تسجيل جميع أنواع الخصومات وتفاصيلها. تم استبدال الخاصية order.discounts بـ order.discount_applications.
  • discounts_amount. مهملة لأنه لا يتم تسجيل جميع أنواع الخصومات وتفاصيلها. تم استبدال الخاصية order.discounts بـ order.total_discounts.
  • discount_applications
  • discounts_savings. مهملة لأنه لا يتم تسجيل جميع أنواع الخصومات وتفاصيلها. تم استبدال الخاصية order.discounts بـ -.
  • email
  • fees
  • financial_status
  • financial_status_label
  • fulfilled_line_items
  • fulfillment_aborted
  • fulfillment_status
  • fulfillments
  • gateway
  • id
  • item_count
  • landing_site
  • landing_site_ref
  • line_items
  • line_items_subtotal_price
  • location
  • metafields
  • name
  • net_payment
  • note
  • order_name
  • order_number
  • order_status_url
  • payment
  • payment_details
  • po_number
  • refunds
  • requires_shipping
  • shipping_address
  • shipping_method
  • shipping_methods
  • shipping_price
  • shop
  • shop_name
  • subtotal_price
  • tags
  • tax_lines
  • tax_price
  • tip_line_items
  • total_discounts
  • total_duties
  • total_landed_cost_additional_fees
  • total_net_amount
  • total_outstanding
  • total_price
  • total_refunded_amount
  • total_tip
  • transactions
  • unacceptable_risks
  • unfulfilled_line_items
  • unique_gateways
  • user
  • void_transactions

المتجر

راجع القائمة التالية لسمات المتجر المتوفرة في تطبيق Shopify Order Printer:

  • accepts_gift_cards
  • account_owner
  • allows_discounts
  • checkout
  • checkout_requires_confirmation_step
  • collections_count
  • contact_information
  • currency
  • customer_accounts_enabled
  • customer_accounts_optional
  • description
  • domain
  • email
  • email_accent_color
  • email_logo_url
  • email_logo_width
  • email_marketing
  • enabled_currencies
  • enabled_locales
  • enabled_payment_types
  • features
  • id
  • latitude
  • legal_notice
  • longitude
  • metafields
  • money_format
  • money_with_currency_format
  • name
  • password_message
  • permanent_domain
  • phone
  • policies
  • privacy_policy
  • products_count
  • refund_policy
  • secure_url
  • shipping_policy
  • subscription_policy
  • terms_of_sale
  • terms_of_service
  • types
  • url

عنصر الطلب

راجع القائمة التالية لسمات عنصر الطلب المتوفرة في Shopify Order Printer:

  • aggregated_update
  • applied_discounts. مهملة لعدم توفر جميع أنواع الخصومات والتفاصيل. تم استبدال الخاصية line_item.discounts بـ line_item.discount_allocations.
  • current_quantity
  • discount_allocations
  • discounts. مهملة لعدم توفر جميع أنواع الخصومات والتفاصيل. تم استبدال الخاصية line_item.discounts بـ line_item.discount_allocations.
  • final_line_price
  • final_price
  • fulfillment
  • fulfillment_service
  • gift_card
  • grams
  • groups
  • id
  • image
  • index
  • item_updates
  • json_filter
  • key
  • line_level_discount_allocations
  • line_level_total_discount
  • line_price. مهملة لعدم تضمين الخصومات الناتجة عن الخصومات التلقائية وأكواد الخصم. تم استبدال الخاصية line_item.line_price بـ line_item.final_line_price.
  • message
  • options_with_values
  • original_line_price
  • original_price
  • price. مهملة لعدم تضمين الخصومات الناتجة عن الخصومات التلقائية وأكواد الخصم. تم استبدال الخاصية line_item.price بـ line_item.final_price.
  • product
  • product_id
  • properties
  • quantity
  • refunded_quantity
  • requires_shipping
  • selling_plan_allocation
  • sku
  • successfully_fulfilled_quantity
  • tax_lines
  • taxable
  • title
  • total_discount. مهملة لعدم تضمين الخصومات الناتجة عن الخصومات التلقائية وأكواد الخصم. تم استبدال الخاصية line_item.total_discount بـ line_item.line_level_total_discount.
  • unit_price
  • unit_price_measurement
  • url
  • url_to_remove
  • variant
  • variant_id
  • vendor

التنفيذ

راجع القائمة التالية لسمات التنفيذ المتوفرة في Shopify Order Printer:

  • created_at. استخدم عامل التصفية date لتنسيق الطابع الزمني، على سبيل المثال باستخدام {{ fulfillment.created_at | date: "%B %e, %Y" }}.
  • estimated_delivery_at
  • fulfillment_line_items
  • item_count
  • line_items
  • requires_shipping
  • tracking_company
  • tracking_number
  • tracking_numbers
  • tracking_url
  • tracking_urls
  • updated_at

العنوان

راجع القائمة التالية لسمات العنوان المتاحة في تطبيق Shopify Order Printer:

  • address1
  • address2
  • city
  • company
  • country
  • country_code
  • country_upper
  • errors
  • first_name
  • id
  • last_name
  • name
  • phone
  • province
  • province_code
  • street
  • summary
  • translated_country_name
  • translated_province_name
  • url
  • zip

العميل

راجع القائمة التالية لسمات العميل المتاحة في تطبيق Shopify Order Printer:

  • accepts_marketing
  • account_activation_url
  • addresses
  • addresses_count
  • b2b?
  • default_address
  • email
  • first_name
  • has_account
  • id
  • last_name
  • last_order
  • metafields
  • name
  • new_address
  • orders
  • orders_count
  • payment_methods
  • phone
  • reset_password_url
  • subscribe_url
  • tags
  • tax_exempt
  • total_spent

DiscountApplication

راجع القائمة التالية لسمات DiscountApplication المتاحة في تطبيق Shopify Order Printer:

  • target_selection
  • target_type
  • title
  • total_allocated_amount
  • type
  • value_type
  • value

طباعة الخصومات

يمكن تطبيق الخصومات على الطلب بالكامل أو على عناصر سطر محددة:

  • خصومات على مستوى الطلب: تُطبق على الطلب بالكامل. يمكنك عرض هذه الخصومات بشكل منفصل في الأسفل عند طباعة فاتورة طلبك.
  • خصومات على مستوى عنصر السطر: تُطبق على عناصر فردية. يمكنك ذكر هذه الخصومات عند طباعة تفاصيل كل عنصر على حدة في قسم عناصر السطر.

يمكنك الوصول إلى معلومات الخصومات باستخدام المتغيرات التالية:

  • الوصول إلى جميع الخصومات المطبقة على الطلب أو أي من عناصر السطر الخاصة به من خلال القيمة order.total_discounts والمجموعة order.discount_applications.
  • الوصول إلى خصومات عناصر السطر من خلال القيمة line_item.line_level_total_discount أو المجموعة line_item.line_level_discount_allocations.
  • الوصول إلى سعر عنصر السطر كما كان قبل تطبيق أي خصومات من خلال القيمة line_item.original_price.
  • الوصول إلى السعر النهائي لعنصر السطر بعد تطبيق جميع خصومات مستوى عنصر السطر ذات الصلة من خلال القيمة line_item.final_price.
  • تساوي القيمتان line_item.original_line_price و line_item.final_line_price القيمتين line_item.original_price و line_item.final_price مضروبتين في line_item.quantity.
  • الوصول إلى الخصومات على مستوى الطلب من خلال المجموعة order.cart_level_discount_applications.

مثال على كتلة برمجية لطباعة الخصومات على مستوى عنصر السطر:

{% for line_item in order.line_items %}
  <tr>
    <td>{{ line_item.quantity }}</td>
    <td>{{ line_item.title }}
    {% if line_item.line_level_discount_allocations.size > 0 %}
      <span class="subduedText">
        {% for discount_allocation in line_item.line_level_discount_allocations %}
        <br>{{ discount_allocation.discount_application.title }} (-{{ discount_allocation.amount | money }})
        {% endfor %}
      </span>
    {% endif %}
    </td>
    <td style="text-align: right;">
      {% if line_item.original_price != line_item.final_price %}
        <span class="subduedText"><s>{{ line_item.original_price | money }}</s></span>
      {% endif %}
      {{ line_item.final_price | money }}
    </td>
  </tr>
{% endfor %}

مثال على كتلة برمجية لطباعة الخصومات على مستوى الطلب:

{% for discount_application in order.cart_level_discount_applications %}
<tr>
  <td colspan="2" style="text-align: right;">{% if discount_application.title %}<span class="subduedText">{{ discount_application.title }}</span>{% endif %}</td>
  <td style="text-align: right;">-{{ discount_application.total_allocated_amount | money }}</td>
</tr>
{% endfor %}

DiscountAllocation

راجع القائمة التالية لسمات DiscountAllocation المتاحة في تطبيق Shopify Order Printer:

  • amount
  • discount_application

الخصم

راجع القائمة التالية لسمات الخصم المتاحة في تطبيق Shopify Order Printer:

  • amount
  • code
  • free_shipping_discount
  • id
  • savings
  • title
  • total_amount
  • total_savings

منتج

راجع القائمة التالية لسمات المنتج المتاحة في Shopify Order Printer:

  • as_json
  • available
  • collections
  • compare_at_price
  • compare_at_price_max
  • compare_at_price_min
  • compare_at_price_varies
  • content
  • created_at
  • description
  • featured_image
  • featured_media
  • first_available_variant
  • gift_card?
  • handle
  • has_only_default_variant
  • id
  • images
  • json_filter
  • media
  • metafields
  • object_type
  • options
  • options_by_name
  • options_with_values
  • price
  • price_max
  • price_min
  • price_varies
  • published_at
  • requires_selling_plan
  • selected_or_first_available_selling_plan_allocation
  • selected_or_first_available_variant
  • selected_selling_plan
  • selected_selling_plan_allocation
  • selected_variant
  • selling_plan_groups
  • tags
  • template_suffix
  • title
  • type
  • url
  • variants
  • vendor

متغير

راجع القائمة التالية لسمات المتغير المتاحة في Shopify Order Printer:

  • as_json
  • available
  • barcode
  • compare_at_price
  • featured_image
  • featured_media
  • id
  • image
  • incoming
  • inventory_management
  • inventory_policy
  • inventory_quantity
  • json_filter
  • metafields
  • next_incoming_date
  • option1
  • option2
  • option3
  • options
  • price
  • product
  • requires_selling_plan
  • requires_shipping
  • selected_selling_plan_allocation
  • selling_plan_allocations
  • sku
  • store_availabilities
  • taxable
  • title
  • unit_price
  • unit_price_measurement
  • url
  • weight
  • weight_in_unit
  • weight_unit

استرداد الأموال

راجع القائمة التالية لسمات استرداد الأموال المتاحة في Shopify Order Printer:

  • amount
  • created_at
  • id
  • note
  • refund_line_items
  • restock
  • transactions

بند الشحن

راجع القائمة التالية لسمات بند الشحن المتاحة في Shopify Order Printer:

  • handle
  • id
  • original_price
  • price. تم الإيقاف لأن السعر لم يتضمن خصومات على مستوى الطلب. تم استبدال الخاصية shipping_line.price بـ shipping_line.price_with_discounts.
  • price_with_discounts
  • tax_lines
  • title

بند الضريبة

راجع القائمة التالية لسمات بند الضريبة المتاحة في Shopify Order Printer:

  • price
  • rate
  • rate_percentage
  • title

معاملة

راجع القائمة التالية لسمات المعاملة المتاحة في Shopify Order Printer:

  • amount
  • buyer_pending_payment_instructions
  • buyer_pending_payment_notice
  • created_at
  • gateway
  • gateway_display_name
  • id
  • kind
  • name
  • payment_details
  • receipt
  • show_buyer_pending_payment_instructions
  • status
  • status_label

حقل وصفي

حقل وصفي مرفق بكائن أصل. للتعرف على كيفية الوصول إلى حقل وصفي في كائن معين، راجع الوصول إلى الحقول الوصفية.

تدعم الحقول الوصفية أنواع بيانات متعددة، والتي تحدد نوع المعلومات المخزّنة في الحقل الوصفي. للوصول إلى الحقول الوصفية، يتكون مسار الوصول للحقول الوصفية من طبقتين:

  • مساحة الاسم - مجموعة من الحقول الوصفية لمنع التعارضات،
  • المفتاح - اسم الحقل الوصفي.

بناءً على ذلك، يمكنك الوصول إلى كائن الحقل الوصفي بالصيغة التالية: {{ resource.metafields.namespace.key }}.

التسمية: <object>.metafields.<namespace>.<key>. على سبيل المثال، order.metafields.shipping.express_delivery_status.

الأنواع:

  • سلسلة
  • مصفوفة - استخدم [ ] للفهرسة. على سبيل المثال، order.metafield.shipping.express_delivery_status[0]
  • عدد صحيح
  • قيمة منطقية
  • تاريخ

ملاحظة: نوع الكائن الوصفي غير مدعوم.

الكائنات التي تدعم الحقول الوصفية:

  • طلب
  • عميل
  • منتج
  • متغير
  • موقع

عوامل تصفية Liquid المتوفرة في Shopify Order Printer

الاستخدام

لتطبيق عوامل التصفية على مخرجات، أضف عامل التصفية وأي معلمات خاصة به داخل محددات الأقواس المتعرجة للمخرجات {{ }}، مسبوقة بحرف الشريط العمودي |. في المثال أدناه، product هو الكائن، وtitle هي الخاصية الخاصة به، وupcase هو عامل التصفية الذي يتم تطبيقه:

{{ product.title | upcase }}

إذا كانت قيمة product.title هي Health potion، فستكون المخرجات من عامل التصفية upcase هي HEALTH POTION.

راجع قسم عوامل التصفية في مرجع Liquid لقوالب Shopify للحصول على تفاصيل حول كيفية استخدام عوامل تصفية Liquid.

عوامل التصفية التي يتم تطبيقها على كائنات العناوين

  • format_address

للاطلاع على أمثلة الاستخدام، راجع وثائق Liquid لقوالب Shopify الخاصة بعامل التصفية format_address.

عوامل التصفية التي يتم تطبيقها على أي نص / سلسلة

  • camelcase
  • camelize
  • encode_url_component
  • format_code
  • handle
  • highlight
  • pad_spaces
  • paragraphize
  • pluralize
  • url_escape
  • url_param_escape

للاطلاع على أمثلة الاستخدام، راجع وثائق Liquid لقوالب Shopify الخاصة بـ عوامل تصفية السلاسل.

عوامل التصفية التي يتم تطبيقها على الأرقام التي تشير إلى مبالغ مالية

  • money
  • money_with_currency
  • money_without_currency
  • money_without_trailing_zeros

يستخدم Shopify Order Printer خيارات تنسيق العملة الخاصة بإشعارات البريد الإلكتروني المكونة في مسؤول Shopify لتنسيق المبالغ المالية. يمكنك تغيير تنسيق العملة. اضبط قيم البريد الإلكتروني مع العملة والبريد الإلكتروني بدون العملة في مسؤول Shopify لتغيير تنسيق عوامل تصفية المبالغ المالية في Shopify Order Printer.

للاطلاع على أمثلة الاستخدام، راجع وثائق Liquid لقوالب Shopify الخاصة بـ عوامل تصفية المبالغ المالية.

عوامل التصفية التي يتم تطبيقها لتحويل الكائنات إلى json

  • json

للاطلاع على أمثلة الاستخدام، راجع وثائق Liquid لقوالب Shopify الخاصة بـ عوامل تصفية json.

عوامل التصفية التي يتم تطبيقها على الأرقام التي تشير إلى أوزان

  • weight
  • weight_with_unit

للاطلاع على أمثلة الاستخدام، راجع وثائق Liquid لقوالب Shopify الخاصة بعامل التصفية الوزن مع الوحدة.

عوامل التصفية التي يتم تطبيقها على العلامات

  • highlight_active_tag
  • link_to_add_tag
  • link_to_remove_tag
  • link_to_tag

للاطلاع على أمثلة الاستخدام، راجع وثائق Liquid لقوالب Shopify الخاصة بـ عوامل تصفية العلامات.

عوامل التصفية التي يتم تطبيقها على عناوين URL

  • article_img_url
  • asset_img_url
  • asset_url
  • cdn_asset_url
  • collection_img_url
  • file_img_url
  • file_url
  • global_asset_url
  • image_url
  • img_tag
  • img_url
  • link_to
  • payment_icon_png_url
  • payment_type_img_url
  • payment_type_svg_tag
  • placeholder_svg_tag
  • product_img_url
  • script_tag
  • shopify_asset_url
  • stylesheet_tag

للحصول على أمثلة استخدام لعوامل تصفية الوسائط المدعومة، راجع وثائق Liquid لقوالب Shopify الخاصة بـ عوامل تصفية الوسائط.

عوامل التصفية التي يتم تطبيقها على المجموعات

  • link_to_type
  • link_to_vendor
  • sort_by
  • url_for_type
  • url_for_vendor
  • within

للحصول على أمثلة عن الاستخدام، راجع وثائق Liquid لسمات Shopify الخاصة بـ فلاتر المجموعات.