Shopify Order Printer માટે Liquid વેરિયેબલ્સ અને ફિલ્ટર્સનો સંદર્ભ
તમે Shopify Order Printer ઍપનો ઉપયોગ કરીને તમારા પોતાના કસ્ટમ ટેમ્પ્લેટ્સ બનાવવા માટે Liquid નો ઉપયોગ કરી શકો છો. Liquid સાથે, તમે ટેક્સ્ટ ટેમ્પ્લેટ્સ બનાવી શકો છો અને દરેક ઑર્ડરના અનન્ય ડેટાના આધારે તેમને રેન્ડર કરી શકો છો.
આ પેજ પર સૂચિબદ્ધ liquid સંદર્ભો એ Liquid ના ઓપન-સોર્સ વર્ઝન નું એક્સટેન્શન છે અને તેનો ઉદ્દેશ્ય Shopify Order Printer ઍપ પર ઉપયોગ કરવા માટે છે. order અને shop વિશેષતાઓના આધારે માહિતીને રેન્ડર કરવા માટે, તમે તમારા ટેમ્પ્લેટ્સને કસ્ટમાઇઝ કરવા માટે આ સંદર્ભમાંથી ઑબ્જેક્ટ્સ, ટૅગ અને ફિલ્ટર્સની સૂચિનો ઉપયોગ કરી શકો છો. ઑબ્જેક્ટ ફીલ્ડ્સ વિશે વિગતો જાણવા માટે તમે Admin GraphQL API ડૉક્સ નો પણ ઉપયોગ કરી શકો છો.
આ પેજ પર
વેરિયેબલ્સ અને વિશેષતાઓનો ઉપયોગ કરવો
Shopify Order Printer ના ટેમ્પ્લેટ્સમાં, મુખ્ય ડેટા ઑબ્જેક્ટ્સ order અને shop છે. ઑર્ડરની વિશેષતાઓને ઍક્સેસ કરવા માટે તમે order.variable_name નો ઉપયોગ કરી શકો છો.
સામાન્ય રીતે ઉપયોગમાં લેવાતી નીચેની ઑર્ડરની વિશેષતાઓને order. પ્રીફિક્સ વિના ઍક્સેસ કરી શકાય છે:
line_itemstax_linesfulfillmentstransactionsdiscountsrefundsshipping_methodscustomer
ઉદાહરણ તરીકે, જો તમે લાઇન આઇટમ્સ વેરિયેબલ ઍક્સેસ કરવા માગતા હો, તો તમે line_items અથવા order.line_items નો ઉપયોગ કરી શકો છો.
Shopify Order Printer માં ઉપલબ્ધ Liquid વેરિયેબલ્સ
નીચેના ક્લાસ ઉપલબ્ધ છે. વિશેષતાઓને મૂળાક્ષરોના ક્રમમાં સૂચિબદ્ધ કરવામાં આવી છે.
ઑર્ડર
Shopify Order Printer માં નીચેની ઑર્ડર વિશેષતાઓ ઉપલબ્ધ છે:
attributesb2bbilling_addresscancel_reasoncancel_reason_labelcancelledcancelled_atcart_level_discount_applicationscheckout_idcheckout_payment_collection_urlcompanycompany_locationconfirmation_numbercreated_at. ઑર્ડર પ્રોસેસ કરવામાં આવ્યો હોય તે સમય. આ GraphQL API માંથીorder.processed_atસમાન છે. ટાઇમસ્ટેમ્પને ફોર્મેટ કરવા માટેdateફિલ્ટરનો ઉપયોગ કરો, ઉદાહરણ તરીકે{{ order.created_at | date: "%B %e, %Y" }}સાથે.customerdiscounts. બધા ડિસ્કાઉન્ટ પ્રકારો અને વિગતો કૅપ્ચર ન થતા હોવાથી, આને નાપસંદ કરવામાં આવ્યું છે.order.discountsપ્રૉપર્ટીનેorder.discount_applicationsવડે બદલવામાં આવી છે.discounts_amount. બધા ડિસ્કાઉન્ટ પ્રકારો અને વિગતો કૅપ્ચર ન થતા હોવાથી, આને નાપસંદ કરવામાં આવ્યું છે.order.discountsપ્રૉપર્ટીનેorder.total_discountsવડે બદલવામાં આવી છે.discount_applicationsdiscounts_savings. અપ્રચલિત છે કારણ કે તમામ ડિસ્કાઉન્ટના પ્રકારો અને વિગતો કૅપ્ચર કરવામાં આવતી નથી.order.discountsપ્રોપર્ટીને-દ્વારા બદલવામાં આવી છે.emailfeesfinancial_statusfinancial_status_labelfulfilled_line_itemsfulfillment_abortedfulfillment_statusfulfillmentsgatewayiditem_countlanding_sitelanding_site_refline_itemsline_items_subtotal_pricelocationmetafieldsnamenet_paymentnoteorder_nameorder_numberorder_status_urlpaymentpayment_detailspo_numberrefundsrequires_shippingshipping_addressshipping_methodshipping_methodsshipping_priceshopshop_namesubtotal_pricetagstax_linestax_pricetip_line_itemstotal_discountstotal_dutiestotal_landed_cost_additional_feestotal_net_amounttotal_outstandingtotal_pricetotal_refunded_amounttotal_tiptransactionsunacceptable_risksunfulfilled_line_itemsunique_gatewaysuservoid_transactions
Shop
Shopify Order Printer માં ઉપલબ્ધ Shop વિશેષતાઓની નીચેની સૂચિની સમીક્ષા કરો:
accepts_gift_cardsaccount_ownerallows_discountscheckoutcheckout_requires_confirmation_stepcollections_countcontact_informationcurrencycustomer_accounts_enabledcustomer_accounts_optionaldescriptiondomainemailemail_accent_coloremail_logo_urlemail_logo_widthemail_marketingenabled_currenciesenabled_localesenabled_payment_typesfeaturesidlatitudelegal_noticelongitudemetafieldsmoney_formatmoney_with_currency_formatnamepassword_messagepermanent_domainphonepoliciesprivacy_policyproducts_countrefund_policysecure_urlshipping_policysubscription_policyterms_of_saleterms_of_servicetypesurl
LineItem
Shopify Order Printer માં ઉપલબ્ધ હોય તેવી લાઇન આઇટમ વિશેષતાઓની નીચેની સૂચિનો રિવ્યૂ કરો:
aggregated_updateapplied_discounts. નાપસંદ કરવામાં આવ્યું છે કારણ કે તમામ ડિસ્કાઉન્ટ પ્રકારો અને વિગતો ઉપલબ્ધ નથી.line_item.discountsપ્રોપર્ટીનેline_item.discount_allocationsદ્વારા બદલવામાં આવી છે.current_quantitydiscount_allocationsdiscounts. નાપસંદ કરવામાં આવ્યું છે કારણ કે તમામ ડિસ્કાઉન્ટ પ્રકારો અને વિગતો ઉપલબ્ધ નથી.line_item.discountsપ્રોપર્ટીનેline_item.discount_allocationsદ્વારા બદલવામાં આવી છે.final_line_pricefinal_pricefulfillmentfulfillment_servicegift_cardgramsgroupsidimageindexitem_updatesjson_filterkeyline_level_discount_allocationsline_level_total_discountline_price. નાપસંદ કરવામાં આવ્યું છે કારણ કે સ્વચાલિત ડિસ્કાઉન્ટ અને ડિસ્કાઉન્ટ કોડનાં ડિસ્કાઉન્ટનો સમાવેશ કરવામાં આવ્યો નથી.line_item.line_priceપ્રોપર્ટીનેline_item.final_line_priceદ્વારા બદલવામાં આવી છે.messageoptions_with_valuesoriginal_line_priceoriginal_priceprice. નાપસંદ કરવામાં આવ્યું છે કારણ કે સ્વચાલિત ડિસ્કાઉન્ટ અને ડિસ્કાઉન્ટ કોડનાં ડિસ્કાઉન્ટનો સમાવેશ કરવામાં આવ્યો નથી.line_item.priceપ્રોપર્ટીનેline_item.final_priceદ્વારા બદલવામાં આવી છે.productproduct_idpropertiesquantityrefunded_quantityrequires_shippingselling_plan_allocationskusuccessfully_fulfilled_quantitytax_linestaxabletitletotal_discount. નાપસંદ કરવામાં આવ્યું છે કારણ કે સ્વચાલિત ડિસ્કાઉન્ટ અને ડિસ્કાઉન્ટ કોડનાં ડિસ્કાઉન્ટનો સમાવેશ કરવામાં આવ્યો નથી.line_item.total_discountપ્રોપર્ટીનેline_item.line_level_total_discountદ્વારા બદલવામાં આવી છે.unit_priceunit_price_measurementurlurl_to_removevariantvariant_idvendor
ફુલફિલમેન્ટ
Shopify Order Printer માં ઉપલબ્ધ હોય તેવી ફુલફિલમેન્ટ વિશેષતાઓની નીચેની સૂચિનો રિવ્યૂ કરો:
created_at. ટાઇમસ્ટેમ્પ ફોર્મેટ કરવા માટેdateફિલ્ટરનો ઉપયોગ કરો, ઉદાહરણ તરીકે{{ fulfillment.created_at | date: "%B %e, %Y" }}સાથે.estimated_delivery_atfulfillment_line_itemsitem_countline_itemsrequires_shippingtracking_companytracking_numbertracking_numberstracking_urltracking_urlsupdated_at
સરનામું
Shopify Order Printer માં ઉપલબ્ધ હોય તેવી સરનામાની વિશેષતાઓની નીચેની સૂચિનો રિવ્યૂ કરો:
address1address2citycompanycountrycountry_codecountry_uppererrorsfirst_nameidlast_namenamephoneprovinceprovince_codestreetsummarytranslated_country_nametranslated_province_nameurlzip
ગ્રાહક
Shopify Order Printer માં ઉપલબ્ધ હોય તેવી ગ્રાહક વિશેષતાઓની નીચેની સૂચિનો રિવ્યૂ કરો:
accepts_marketingaccount_activation_urladdressesaddresses_countb2b?default_addressemailfirst_namehas_accountidlast_namelast_ordermetafieldsnamenew_addressordersorders_countpayment_methodsphonereset_password_urlsubscribe_urltagstax_exempttotal_spent
DiscountApplication
Shopify Order Printer માં ઉપલબ્ધ DiscountApplication વિશેષતાઓની નીચેની સૂચિનો રિવ્યૂ કરો:
target_selectiontarget_typetitletotal_allocated_amounttypevalue_typevalue
ડિસ્કાઉન્ટ પ્રિન્ટ કરવા
ડિસ્કાઉન્ટ સંપૂર્ણ ઑર્ડર પર અથવા વિશિષ્ટ લાઇન આઇટમ પર લાગુ કરી શકાય છે:
- ઑર્ડર લેવલના ડિસ્કાઉન્ટ: તે સંપૂર્ણ ઑર્ડર પર લાગુ થાય છે. તમારું ઑર્ડર ઇન્વૉઇસ પ્રિન્ટ કરતી વખતે તમે આ ડિસ્કાઉન્ટને તળિયે અલગથી ડિસ્પ્લે કરી શકો છો.
- લાઇન આઇટમ લેવલના ડિસ્કાઉન્ટ: તે વ્યક્તિગત આઇટમ પર લાગુ થાય છે. લાઇન આઇટમ વિભાગમાં વ્યક્તિગત આઇટમની વિગતો પ્રિન્ટ કરતી વખતે તમે આ ડિસ્કાઉન્ટનો ઉલ્લેખ કરી શકો છો.
તમે નીચે આપેલા ચલોનો ઉપયોગ કરીને ડિસ્કાઉન્ટની માહિતી ઍક્સેસ કરી શકો છો:
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 %}- ડિસ્કાઉન્ટના પ્રકારો અને Liquid માં ડિસ્કાઉન્ટ સાથે કામ કરવા વિશે વધુ જાણો.
DiscountAllocation
Shopify Order Printer માં ઉપલબ્ધ DiscountAllocation વિશેષતાઓની નીચેની સૂચિનો રિવ્યૂ કરો:
amountdiscount_application
ડિસ્કાઉન્ટ
Shopify Order Printer માં ઉપલબ્ધ ડિસ્કાઉન્ટ વિશેષતાઓની નીચેની સૂચિનો રિવ્યૂ કરો:
amountcodefree_shipping_discountidsavingstitletotal_amounttotal_savings
પ્રોડક્ટ
Shopify Order Printer માં ઉપલબ્ધ પ્રોડક્ટ વિશેષતાઓની નીચેની સૂચિનો રિવ્યૂ કરો:
as_jsonavailablecollectionscompare_at_pricecompare_at_price_maxcompare_at_price_mincompare_at_price_variescontentcreated_atdescriptionfeatured_imagefeatured_mediafirst_available_variantgift_card?handlehas_only_default_variantidimagesjson_filtermediametafieldsobject_typeoptionsoptions_by_nameoptions_with_valuespriceprice_maxprice_minprice_variespublished_atrequires_selling_planselected_or_first_available_selling_plan_allocationselected_or_first_available_variantselected_selling_planselected_selling_plan_allocationselected_variantselling_plan_groupstagstemplate_suffixtitletypeurlvariantsvendor
વેરિઅન્ટ
Shopify Order Printer માં ઉપલબ્ધ વેરિઅન્ટ વિશેષતાઓની નીચેની સૂચિની સમીક્ષા કરો:
as_jsonavailablebarcodecompare_at_pricefeatured_imagefeatured_mediaidimageincominginventory_managementinventory_policyinventory_quantityjson_filtermetafieldsnext_incoming_dateoption1option2option3optionspriceproductrequires_selling_planrequires_shippingselected_selling_plan_allocationselling_plan_allocationsskustore_availabilitiestaxabletitleunit_priceunit_price_measurementurlweightweight_in_unitweight_unit
રિફંડ
Shopify Order Printer માં ઉપલબ્ધ રિફંડ વિશેષતાઓની નીચેની સૂચિની સમીક્ષા કરો:
amountcreated_atidnoterefund_line_itemsrestocktransactions
શિપિંગ લાઇન
Shopify Order Printer માં ઉપલબ્ધ શિપિંગ લાઇન વિશેષતાઓની નીચેની સૂચિની સમીક્ષા કરો:
handleidoriginal_priceprice. નાપસંદ કરવામાં આવ્યું છે કારણ કે કિંમતમાં ઑર્ડર સ્તરના ડિસ્કાઉન્ટ શામેલ નહોતા.shipping_line.priceપ્રોપર્ટીનેshipping_line.price_with_discountsદ્વારા બદલવામાં આવી છે.price_with_discountstax_linestitle
ટૅક્સ લાઇન
Shopify Order Printer માં ઉપલબ્ધ ટૅક્સ લાઇન વિશેષતાઓની નીચેની સૂચિની સમીક્ષા કરો:
priceraterate_percentagetitle
ટ્રાન્ઝેક્શન
Shopify Order Printer માં ઉપલબ્ધ ટ્રાન્ઝેક્શન વિશેષતાઓની નીચેની સૂચિની સમીક્ષા કરો:
amountbuyer_pending_payment_instructionsbuyer_pending_payment_noticecreated_atgatewaygateway_display_nameidkindnamepayment_detailsreceiptshow_buyer_pending_payment_instructionsstatusstatus_label
મેટાફીલ્ડ
પેરેન્ટ ઑબ્જેક્ટ સાથે જોડાયેલ એક મેટાફીલ્ડ. ચોક્કસ ઑબ્જેક્ટ પર મેટાફીલ્ડ ઍક્સેસ કરવા વિશે વધુ જાણવા માટે, મેટાફીલ્ડ્સ ઍક્સેસ કરો નો સંદર્ભ લો.
મેટાફીલ્ડ્સ બહુવિધ ડેટા પ્રકારો ને સપોર્ટ કરે છે, જે નક્કી કરે છે કે મેટાફીલ્ડમાં કયા પ્રકારની માહિતી સ્ટોર કરવામાં આવી છે. મેટાફીલ્ડ્સ ઍક્સેસ કરવા માટે, મેટાફીલ્ડ્સના ઍક્સેસ પાથમાં બે સ્તર શામેલ હોય છે:
- નેમસ્પેસ - વિરોધાભાસને રોકવા માટે મેટાફીલ્ડ્સનું ગ્રૂપિંગ,
- કી - મેટાફીલ્ડનું નામ.
આપેલ મુજબ, તમે નીચેના સિન્ટેક્સનો ઉપયોગ કરીને મેટાફીલ્ડ ઑબ્જેક્ટ ઍક્સેસ કરી શકો છો: {{ resource.metafields.namespace.key }}.
નામકરણ: <object>.metafields.<namespace>.<key>. ઉદાહરણ તરીકે, order.metafields.shipping.express_delivery_status.
પ્રકારો:
StringArray- અનુક્રમણિકા બનાવવા માટે[ ]નો ઉપયોગ કરો. ઉદાહરણ તરીકે,order.metafield.shipping.express_delivery_status[0]IntegerBooleanDate
નોંધ Metaobject પ્રકાર સપોર્ટેડ નથી.
મેટાફીલ્ડ્સને સપોર્ટ કરતા ઑબ્જેક્ટ:
OrderCustomerProductVariantLocation
Shopify Order Printer માં ઉપલબ્ધ Liquid ફિલ્ટર્સ
ઉપયોગ
આઉટપુટમાં ફિલ્ટર્સ લાગુ કરવા માટે, ફિલ્ટર અને કોઈપણ ફિલ્ટર પરિમાણોને આઉટપુટના સર્પાકાર કૌંસ ડિલિમિટર્સ {{ }} ની અંદર ઉમેરો અને તેની પહેલાં પાઇપ અક્ષર | મૂકો. નીચેના ઉદાહરણમાં, product ઑબ્જેક્ટ છે, title તેની પ્રોપર્ટી છે અને upcase એ લાગુ કરવામાં આવતું ફિલ્ટર છે:
{{ product.title | upcase }}જો product.title માં Health potion મૂલ્ય હોય, તો upcase ફિલ્ટરનું આઉટપુટ HEALTH POTION હશે.
Liquid ફિલ્ટર્સનો ઉપયોગ કેવી રીતે કરવો તેની વિગતો માટે Shopify થીમ Liquid સંદર્ભમાંથી ફિલ્ટર્સ વિભાગ નો સંદર્ભ લો.
Address ઑબ્જેક્ટ પર લાગુ કરવાના ફિલ્ટર્સ
format_address
ઉપયોગના ઉદાહરણો માટે, format_address માટે Shopify થીમ Liquid દસ્તાવેજીકરણનો સંદર્ભ લો.
કોઈપણ ટેક્સ્ટ / સ્ટ્રિંગ પર લાગુ કરવાના ફિલ્ટર્સ
camelcasecamelizeencode_url_componentformat_codehandlehighlightpad_spacesparagraphizepluralizeurl_escapeurl_param_escape
વપરાશના ઉદાહરણો માટે, સ્ટ્રિંગ ફિલ્ટર્સ માટે Shopify Themes Liquid દસ્તાવેજીકરણનો સંદર્ભ લો.
નાણાં દર્શાવતા નંબરો પર લાગુ કરવાના ફિલ્ટર્સ
moneymoney_with_currencymoney_without_currencymoney_without_trailing_zeros
Shopify Order Printer નાણાં ફૉર્મેટ કરવા માટે Shopify ઍડમિનમાં કન્ફિગર કરેલા ઇમેઇલ નોટિફિકેશન ચલણના ફૉર્મેટિંગ વિકલ્પોનો ઉપયોગ કરે છે.
તમે ચલણનું ફૉર્મેટિંગ બદલી શકો છો. Shopify Order Printer માં નાણાં સંબંધિત ફિલ્ટર્સનું ફૉર્મેટિંગ બદલવા માટે Shopify ઍડમિનમાં ચલણ સાથેનો ઇમેઇલ (Email with currency) અને ચલણ વિનાનો ઇમેઇલ (Email without currency) માટેનાં મૂલ્યો સેટ કરો.
વપરાશના ઉદાહરણો માટે, મની ફિલ્ટર્સ માટે Shopify Themes Liquid દસ્તાવેજીકરણનો સંદર્ભ લો.
ઑબ્જેક્ટને json માં રૂપાંતરિત કરવા માટે લાગુ કરવાના ફિલ્ટર્સ
json
વપરાશના ઉદાહરણો માટે, json ફિલ્ટર્સ માટે Shopify Themes Liquid દસ્તાવેજીકરણનો સંદર્ભ લો.
વજન દર્શાવતા નંબરો પર લાગુ કરવાના ફિલ્ટર્સ
weightweight_with_unit
વપરાશના ઉદાહરણો માટે, યુનિટ સાથેના વજન માટે Shopify Themes Liquid દસ્તાવેજીકરણનો સંદર્ભ લો.
ટૅગ પર લાગુ કરવાના ફિલ્ટર્સ
highlight_active_taglink_to_add_taglink_to_remove_taglink_to_tag
વપરાશના ઉદાહરણો માટે, ટૅગ ફિલ્ટર્સ માટે Shopify Themes Liquid દસ્તાવેજીકરણનો સંદર્ભ લો.
url પર લાગુ કરવાના ફિલ્ટર્સ
article_img_urlasset_img_urlasset_urlcdn_asset_urlcollection_img_urlfile_img_urlfile_urlglobal_asset_urlimage_urlimg_tagimg_urllink_topayment_icon_png_urlpayment_type_img_urlpayment_type_svg_tagplaceholder_svg_tagproduct_img_urlscript_tagshopify_asset_urlstylesheet_tag
સમર્થિત મીડિયા ફિલ્ટર્સના વપરાશના ઉદાહરણો માટે, મીડિયા ફિલ્ટર્સ માટે Shopify Themes Liquid દસ્તાવેજીકરણનો સંદર્ભ લો.
કલેક્શન પર લાગુ કરવાના ફિલ્ટર્સ
link_to_typelink_to_vendorsort_byurl_for_typeurl_for_vendorwithin
વપરાશના ઉદાહરણો માટે, કલેક્શન ફિલ્ટર્સ માટે Shopify Themes Liquid દસ્તાવેજીકરણનો સંદર્ભ લો.