Learning coding means GreatToCode Be more than a Coder ! Greattocode , Join GreatToCode Community,1000+ Students Trusted On Us .If You want to learn coding, Then GreatToCode Help You.No matter what It Takes !


CODE YOUR WAY TO A MORE FULFILLING And HIGHER PAYING CAREER IN TECH, START CODING FOR FREE Camp With GreatToCode - Join the Thousands learning to code with GreatToCode
Interactive online coding classes for at-home learning with GreatToCode . Try ₹Free Per Month Coding Classes With The Top Teachers . Shopify Tutorial: Basic to Advanced

Shopify Tutorial: Basic to Advanced

 The liquid is a template language developed by Shopify. It is available as an open-source project on GitHub and is used by many different software projects and companies. We can also modify our output by creating a marked logic or changing it directly with a filter. Items and properties of an object are extracted using one of six basic data types. Liquid also integrates sensible and comparable basic operators for use with tags.

Template language allows you to create a single template to handle static content, and enter information by force depending on where the template is provided. For example, you can create a product template that handles all of your typical product specifications, such as a product image, title, and price. That template can provide those attributes with relevant content, depending on the current product being viewed.

HANDLES

The handle is used to access the signs of a liquid. By default, it is the subject of a small capital letter with any spaces and special characters replaced by hyphens (-). Everything in Liquid (product, collection, blog, menu) has a handle.

A product labelled ‘shirt’ will automatically be provided with a catch shirt. If you already have a product with a ‘shirt’ handle, the handle will automatically adjust. In other words, all the 'shirt' products created after the first one will get a handle on shirt 1, shirt 2, and so on.

1. Basic Commands

COMMANDDESCRIPTIONSYNTAX
==Equals (comparison)
{% if book.title == 'Hello World%}
  These are awesome!
{% endif %}
!=Not equals
{% if book.title != 'Hello World%}
  These are awesome!
{% endif %}
Greater than
{% if student.age>35%}
  Adults
{% endif %}
< Lesser than
{% if student.age<18%}
  Kids
{% endif %}
>=Greater than and equal to
{% if student.age>=35%}
  Adults
{% endif %}
<=Lesser than and equal to
{% if student.age<=35%}
  Young Adults
{% endif %}
orCondition A or Condition B
{% if student.age<=35 or student.age>=18%}
  Hello World
{% endif %}
andCondition A and Condition B
{% if student.age<=35 and student.age>=18%}
  Young Adults
{% endif %}
containsChecks for the presence of a substring
{% if ‘Hello’ contains 'ello' %}
  Hello has ello
{% endif %}

2. Data Types

COMMANDSYNTAX
Strings{% assign str = 'Hello!' %}
Numbers{% assign intg=35%}
Boolean{% assign var=true %} or {% assign var=false%}
Array
{% for var in product.var %}
  {{ var }}
{% endfor %}

3. Tag Commands

Variable Tags are used to create new Liquid variables.

COMMANDDESCRIPTIONSYNTAX
AssignCreates a new Variable  {% assign var = 5 %}
CaptureSelects the string inside of the opening and closing tags and assigns it to a variable.
{% capture var%}Hello world.{% endcapture %}
{{ var }}
IncrementIncrements the variable every time it is called.{% increment var %}
DecrementDecrements the variable every time it{% decrement var %}
IfExecutes an if block statement.
% if student.age>35%}
  Adults
{%else%}
Kids
{% endif %}
Else IfExecutes an Else if the block.
% if student.age>35%}
  Adults
{%else if student.age<18%}
Kids
{% endif %}
CaseCreates a switch clause to compare a variable with different values.
{% assign handle = 'ice' %}
{% case handle %}
  {% when 'ice' %}
  This is ice
  {% when 'water' %}
  This is water
  {% else %}
   This is vapor
{% endcase %}
UnlessSimilar to if, but executes block only when conditions are not met.
{% unless product.title == 'Hello world' %}
  Bye World
{% endunless %}
ForExecutes a block of code continuously.
{% for product in collection.items %}
  {{ items.title }}
{% endfor %}
For ElseElse block if For condition fails.
{% for product in collection.items %}
  {{ items.title }}
{% else %}
  This collection is empty.
{% endfor %}
BreakStops the loop from iterating in the middle.
{% for i in (1..5) %}
  {% if i == 4 %}
{% break %}
  {% endif %}
{% endfor %}
ContinueThis causes the loop to skip the current iteration and proceed with the loop.
% for i in (1..5) %}
  {% if i == 4 %}
{% continue %}
  {% endif %}
{% endfor %}
CycleLoops through a group of strings. Each time cycle is called, and the next string that was passed as a parameter is returned as the output.{% cycle 'one', 'two', 'three' %}
Table RowGenerates an HTML table.
<table>
  {% tablerow item in collection.items %}
{{ items.title }}
  {% endtablerow %}
</table>
CommentsPart of a code which is never rendered.
y name is {% comment %}Liquid{% endcomment %} Hello World.
LiquidAllows us to write multiple tags under a delimiter.
{% liquid
case section.blocks.size
when 1
.......
  when 2
  ......
when 3
 ........
else
 .........
endcase %}
EchoOutputs an expression when rendered in HTML in a liquid tag
{% liquid
if product.image
  echo product.image | img_tag
else
  echo 'prod-1' | placeholder_svg_tag
endif %}
RawAllows output of Liquid code on a page without being parsed.
{% raw %}{{ B | comes after : A }}{% endraw %} is the Alphabets.
SectionInserts a section from the sections folder of a theme. {% section 'header' %}
StyleRenders an HTML style tag in Liquid
{% style %}
  .section-header {
color: #dddddd;
  }
{% endstyle %}
Whitespace controlUsing hyphens, the assigned statement doesn't output a blank line.{%- assign my_variable = "tomato" -%}
You can download a PDF version of Shopify Cheat Sheet.

4. Theme Tags

TAGSDESCRIPTION
{% include %}Inserts a snippet from the snippets folder of a theme.
{% form %}Creates a form element in HTML with necessary attributes.
{% paginate %}Works in conjunction with for tags to split the content into numerous pages.
{%render%}Renders a snippet from the snippets folder of a theme.

5. Filters

COMMANDDESCRIPTIONSYNTAX
Font FaceReturns a CSS font face declaration to load the chosen font.
<style>
  @font-face {
font-family: "Neue Haas Unica";
font-weight: 400;
font-style: normal;
src: url("..”) format(".."),
     url("..") format("..");
  }
</style>
Font ModifyIt takes two arguments. The first indicates which property must be changed and the second one indicates what modification must be made.
{% assign bold_font = settings.body_font | font_modify: 'weight', 'bold' %}
h2 {
  font-weight: {{ bolder_font.weight }};
Font UrlReturns a CDN URL for the chosen font. It returns woff2 by default.{ settings.type_header_font | font_url }}
DateConverts an existing date to another format.{{ article.published_at| date: "%a, %b %d, %y" }}
DefaultSets a default value no value is assigned to a variable.Dear {{ student.name | default: "student" }}
Default ErrorsOutputs default error messages for the form.errors variable.
{% if form.errors %}
  {{ form.errors | default_errors }}
{% endif %}
Default PaginationA set of links for paginated results are created.{{ paginate | default_pagination }}
Format AddressPrints the elements in an address according to their locale.{{ address | format_address }}
HighlightWords are wrapped inside search results with HTML <strong> tag with highlight class.{{ item.content | highlight: search.terms }}
Highlight ActiveA tag link is wrapped in a span with the class active.
{% for x  in items.tags %}
{{ tag | highlight_active | link_to_tag: x }}
{% endfor %}
JSONConverts a string to the JSON format.var content = {{ pages.page-handle.content | json }};
Placeholder_SVG_TagTakes a placeholder name and outputs a placeholder SVG illustration.{{ 'clctn1' | placeholder_svg_tag }}
T(translation)It uses a translation key to access the locale file for the active language and returns the corresponding string of translated text in the locale file.{ 'products.product.sold_out' | t }}
Weight with unit.Formats the weight.{{ product.variants.first.weight | weight_with_unit }}
String ConcatenationMerges an array with another array.{% assign str3 = str1 | concat: str2 %}
JoinJoins the elements in an array based on a character passed as a parameter.{{ product.tags | join: ', ' }}
FirstReturns the first element in an array.{{ product.tags | first }}
IndexReturns the item stored at a specific index.{{ product.tags[10] }}
LastReturns the last element of the array.{{ product.tags | last }}
MapAccepts an array element value as a parameter and makes a string out of each array element’s value.{{ collections | map: 'name' }}
ReverseReverses the array.{{ arr| reverse | join: ", " }}
SizeReturns the length of an array.{{ arr | size }}
SortSorts the array.{% assign arr = collection.products | sort: 'title' %}
UniqRemoves duplicate elements.{{ array | split: ' ' | uniq | join: ' ' }}
WhereCreates an array will all values based on a certain condition.{% assign array = collection.products | where: "type", "ABC" %}
Metafield TagGenerates an HTML element depending on the meta field.{{ product.metafields.instructions.wash | metafield_tag }}
Metafield TextGenerates a text version of Metafield.{{ product.metafields.instructions.wash | metafield_text }}
Currency SelectorDisplays a drop-down menu for customers to choose a particular currency.
{% form 'currency' %}
  {{ form | currency_selector: class: 'my_special_class', id: 'Submit'  }}
{% endform %}
Img_tagCreates an image tag.{{ 'penguin_gnome.gif' | asset_url | img_tag }}
Payment ButtonCreates a checkout button.{{ form | payment_button }}
Payment TermsRenders the Shop Pay Installments banner for a product.{{ form | payment_terms }}
Payment Type SVGReturns SVG tag for a requested payment type image.

{% for type in shop.enabled_payment_types %}

  {{ type | payment_type_svg_tag, class: 'custom-class' }}

{% endfor %}

Script TagGenerates a script tag.{{ 'store.js' | asset_url | script_tag }}
Stylesheet TagGenerates a link that refers to a given stylesheet.{{ 'store.css' | asset_url | stylesheet_tag }}
Time TagConverts a time to an HTML time tag.{{ form.published_at | time_tag }}
MoneyFormat the value based on the ‘HTML without currency’ setting.{{ 200 | money }}
Money with currency.Format the value based on the ‘HTML without currency’ setting.{{ 2.95 | money_with_currency }}
Money with trailing zerosExcludes the decimal point and trailing zeroes.{{ 90.00 | money_without_trailing_zeros }}
Money without currencyFormats the price based on decimals.{{ 2.59 | money_without_currency }}
AbsReturns the absolute value.{{ -99 | abs }}
At leastLimits a number to the least value.{{ 4 | at_least: 10 }}
At mostLimits a number to a higher value.{{ 4 | at_most: 10 }}
CeilRounds the number up to the nearest int value.{{ 4.2 | ceil }}
Divided byDivides the output by a number{{ 200 | divided_by: 10 }}
FloorRounds the output down to the nearest int value.{{ 4.2 | floor }}
MinusSubtracts a value.{{ 200 | minus: 10 }}
RoundRounds the output to the nearest integer to a specified number of decimals.{{ 3.14159 | round: 2 }}
TimesMultiplies by a number.{{ 200 | times: 10 }}
ModuloReturns Remainder after division.{{ 200 | modulo:10 }}
AppendAppends chars to a string.{{ 'store' | append: '.txt' }}
Camel CaseConverts a hyphenated string to camel case.{{ 'shopify-liquid' | camelcase }}
CapitalizeCapitalizes the first letter of each word.{{ 'upper case' | capitalize}}
DowncaseConverts a string to lowercase.{{ 'LOWERCASE' | downcase }}
EscapeEscapes a string.{{ "<p>text</p>" | escape }}
HandleizeFormats a string into a handle.{{ '100% M & Ms!!!' | handleize }}
New Line to brInserts a page break.{{ array | newline_to_br }}
PluralizeReturns a singular or plural version of the string based on the number.{{ cart.item | pluralize: 'item', 'items' }}
PrependPrepends a character to an existing string.{{ ‘day’ | prepend: ‘Have a great ' }}
RemoveRemoves an occurrence in a substring.{{ "Hello, world. Bye,Bye." | remove: "world" }}
ReplaceReplaces all the occurrences of a particular string.{{ product.title | replace: 'Clothes', 'products' }}
SliceReturns substring specified at an index.{{ "shopify" | slice: 1, 4 }}
SplitA substring is used as a delimiter.{% assign words = "Hi, how are you?" | split: ' ' %}
StripStrips tabs, spaces, and newlines from left and right.{{ '   too many spaces  ' | strip }}
LstripStrips tabs, spaces, and newlines from left."{{ '   too many spaces       ' | lstrip }}
RstripStrips tabs, spaces, and newlines from right.{{ '          too many spaces  ' | rstrip }}
Strip HTMLStrips all HTML Tags.{{ "<h1>Shopify</h1> Liquid" | strip_html }}
UpcaseConverts string to uppercase.{{ ‘uppercase’| upcase }}
Brightness DifferenceCalculates the perceived brightness of two colors.{{ '#fff00f' | brightness_difference: '#0b72ab' }}
Color BrightnessReturns the perceived brightness of a given color.{{ '#7ab55c' | color_brightness }}
Color ContrastCalculates ratio between two colors.{{ '#495859' | color_contrast: '#fffffb' }}
Color DarkenIncreases the darkness of the input color.{{ '#7ab55c' | color_darken: 10 }}
Color DesaturateDesaturates the input color.{{ '#7ab55c' | color_desaturate: 10 }}
Color ExtractExtracts a component from the given color.{{ '#7ab55c' | color_extract: ‘blue’ }}
Color LightenLightens the input color.{{ '#7ab55c' | color_lighten: 10 }}
Color MixBlends two colors.{{ '#7ab55c' | color_mix: '#ffc0cb', 50 }}
Color RGBConverts a CSS string to CSS rgb().{{ '#7ab55c' | color_to_rgb }}
External Video TagAn Iframe is generated that contains a youtube player.
{% if product.featured_media.media_type == "external_video" %}
  {{ product.featured_media | external_video_tag }}
{% endif %}
Image TagGenerates an image tag for the media’s preview picture.
{% if product.featured_media.media_type == "model" %}
  {{ product.featured_media | img_tag }}
{% endif %}
Media TagGenerates a tag for media.
{% if product.featured_media.media_type == "model" %}
  {{ product.featured_media | media_tag }}
{% endif %}
Model Viewer TagGenerates a google model viewer in 3D.
{% if product.featured_media.media_type == "model" %}
  {{ product.featured_media | model_viewer_tag }}
{% endif %}
Asset Image URLReturns asset URL of an Image.{{ ‘shopify.png' | asset_img_url: '100x' }}
File Image URLReturns the Image URL.{{ 'shopify.png' | file_img_url: '100x' }}
File URLReturns URL of a file.{{ 'shopify.pdf' | file_url }}
Customer Link LoginGenerates a link to the login page for customers.{{ 'Log in' | customer_login_link }}
Global Asset URLReturns Global Asset URL.{{‘shopify.js' | global_asset_url | script_tag }}
Link ToGenerates a HTML hyperlink.{{ 'shopify' | link_to: 'https://www.shopify.com', ' link to Shopify' }}
Link to TagGenerates a link for all products in a collection.
{% for tag in collection.tags %}
  {{ tag | link_to_tag: tag }}
{% endfor %}
Payment Type ImageReturns URL of payment SVG Image.
{% for tag in collection.tags %}
  {{ tag | link_to_tag: tag }}
{% endfor %}
Shopify Assets URLReturns the URL of a global asset that is found on Shopify’s servers.{{ 'shopify.js' | shopify_asset_url | script_tag }}

6. Objects

1. GENERIC COMMANDS

COMMANDDESCRIPTIONSYNTAX
All ProductsReturns a list of all products.                                                                                                                                           {{ all_products[‘shopify store’].title }}
ArticlesReturns a list of all the blog articles in a store.{% assign article = articles['news/shopify'] %}
Current PageReturns the page number you are in, in paginated content.{ {page_title }} - Page: {{ current_page }}
Page DescriptionReturns description of a page, collection or product.{{ page_description }}
Page TitleReturns the title of a page, collection or product.{{ page_title }}
PagesReturns a list of all the pages in your store.<h1>{{ pages.about.title }}</h1>
SettingsReturns a list of the settings in your published theme.the 
{% if settings.use_logo %}
  {{ 'shopify.png' | asset_url | img_tag: shop.name }}
{% else %}
  <span class="no-logo">{{ shop.name }}</span>
{% endif %}
Collection All productsReturns the number of products in a given collection.{{ collection.all_products_count }}
Collection All TagsReturns a list of Tags in the collection.{{collection.all_tag}}
Collection All typesReturns a list of all product types.
{% for product_type in collection.all_types %}
  {{ product_type | link_to_type }}
{% endfor %}
Collection DescriptionReturns description of a collection.{{collection.description}}
Collection Handle.Returns the handle of the collection.{{collection.handle}}
Collection IDReturns the unique ID of the collection.{{collection.id}}
Collection ImageReturns the collection Image.
{% if collection.image %}
  {{ collection.image | img_url: 'medium' }}
{% endif %}
Collection TitleReturns Collection Title.<h2>{{ collection.title }}</h2>
Collection URLReturns URL of collection.{{collection.url}}
Content for headerDynamically loads all scripts required for Shopify into doc head.{{ content_for_header }}
Content for IndexContains dynamic sections to be rendered on the home page.{{ content_for_index }}
Content for LayoutSimilar to content for the index but for collection.liquid or cart.liquid.{{ content_for_layout }}

2. BLOCKS

Contents and settings are represented by a single block in an array of section blocks.

SyntaxDescription
block.idReturns a unique and dynamically allocated ID generated by Shopify.
block.settingsRetrieve the settings of a block using its block id.
Block.typeReturns the type defined in the block’s schema.

 3. CUSTOMER OBJECTS

Contains information about customer accounts.

SyntaxDescription
customer_address.first_nameReturns the first name of the customer.
customer_address.last-nameReturns the last name of the customer.
customer_address.address1Returns the value of the address1 field.
customer_address.address2Returns the value of the address2 field.
customer_address.streetReturns the value of the street field.
customer_address.companyReturns the value of the company field.
customer_address.cityReturns the value of the city field.
customer_address.provinceReturns the value of the province field.
customer_address.zipReturns the value of the zip code field.
customer_address.country_codeReturns the value of the country code field.
customer_address.phoneReturns the value of the phone number field.
customer_address.idReturns the id of the customer address.

4. DISCOUNT ALLOCATION

Contains information about all the discounts available and applicable.

SyntaxDescription
discount_allocation.amountThe discount amount is to be deducted.
discount_allocation.discount_applicationThe discount application allocates the amount on the line item.

5. FILTER VALUE

Represents an individual value from a filter object.

SyntaxDescription
filter_value.activeReturns a Boolean value. Checks if the filter value is active.
filter_value.countReturns how many results are related to the filter value.
filter_value.url_to_addReturns the current page URL.

6. LINE ITEMS

Represents a single line of items in a shopping cart.

SyntaxDescription
line_item.final_line_priceReturns the price of the line item including all line-level discount amounts.
line_item.fulfillmentReturns fulfilment of line items.
line_item.gramsReturns the weight in grams.
line_item.imageReturns the line item image.
line_item.idReturns the id of the line item.
line_item.keyReturns a unique identifier for each item in the cart.
line_item.message.Returns the discount message.
line_item.original_line_priceReturns the original price of the line.
line_item.productReturns the products in the line.
line_item.product_idReturns the product ids of items in the line.
line_item.quantityReturns the number of products in each line.
line_item.titleReturns the title of the line.
line_item.urlReturns the URL to the product page.
line_item.vendorReturns the name of the vendor.

7. FULFILLMENT

SyntaxDescription
fulfillment.tracking_companyReturns the name of fulfilment services.
fulfillment.tracking_numberReturns a fulfilment’s tracking number
fulfillment.tracking_urlReturns the URL for the tracking number.
fulfillment.item_countReturns the total number of items in the fulfilment.

8. LOCATION

The location object contains location information for stores.

SyntaxDescription
location.idReturns the location ID
location.latitudeReturns the latitude of the location.
location.longitudeReturns the longitude of the location.
Location.nameReturns the name of the location.

9. LINKLIST

Used to make a menu on the navigation page.  

SyntaxDescription
linklist.handleReturns the handle of the link list.
Linklist.levelReturns the number of nested levels.
Linklist.linksReturns the array of links.
linklist.titleReturns the title of the link list.

10. COUNTRY

SyntaxDescription
Country.currencyReturns the currency used in the country.
country.iso_codeReturns the iso code of a country.
Country.nameReturns the name of a country.

11. VIDEO

SyntaxDescription
video.altReturns the alt tag of a video.
video.durationReturns the duration of a video.
Video.idReturns the id of a video.
video.positionReturns position of video in the product.
Video.sourceReturns the source of the video.

12. TRANSACTION

SyntaxDescription
transaction.idReturns the transaction ID.
transaction.amountReturns the transaction amount.
transaction.nameReturns the name of the transaction.
transaction.statusReturns the status of the current transaction.
transaction.created_atReturns the timestamp when the transaction was initiated.
transaction.receiptReturns the payment receipt of the transaction.

13. VARIANT

SyntaxDescription
variant.availableReturns a Boolean value based on the availability of a variant.
variant.barcodeReturns the barcode of a variant.
variant.compare_at_priceReturns the variant compare at price.
variant.matchedReturns whether the variant has been matched.
variant.idReturns the id of the variant.
variant.imageReturns the image of the variant.
variant.incomingReturns true if a batch of inventory is incoming
variant.unit_weightReturns unit of weight.
variant.urlReturns the variant's absolute URL.
variant.unit_priceReturns the unit price of a variant.
variant.titleReturns the concatenation of all the variant’s option values.
variant.taxableReturns whether a variant is taxable or not.
variant.selectedReturns true if the variant is selected.

14. THEME

SyntaxDescription
theme.idReturns the theme id.
theme.role (deprecated)Return(s) the role of a theme.
theme.nameReturns the name of the theme.

15. TAXLINE

SyntaxDescription
tax_line.titleReturns the title of the tax
tax_line.priceReturns the amount of tax.
tax_line.rateReturns the rate of tax.
tax_line.rate_percentageReturns rate of tax in a percentage format.

16. REQUEST

SyntaxDescription
request.design_modeReturns true if a request is being made from the theme editor.
request.hostReturns which domain the customer is accessing from.
request.localeReturns shop locale of the current request.
request.pathReturns a path to the page.

17. SHIPPING METHOD

SyntaxDescription
shipping_method.handleReturns handle of shipping method.
Shipping_method.original_priceReturns original price of shipping method.
shipping_method.priceReturns the price of the shipping method.
shipping_method.title.Returns title of shipping method.

18. CART

SyntaxDescription
cart.attributesCaptures information about the cart page.
cart.currencyReturns the currency of the cart.
cart.item_countReturn the number of items in the cart.
Cart.noteAllows capturing more information on the cart page.
cart.original_priceReturns the original price of products in the cart.
cart.total_discountReturns the total discount
cart.total_priceReturns the total price of products in the cart.
cart.total_weightReturns the total weight of the cart.

19. PRODUCT

SyntaxDescription
product.availableReturns true if the product is available for purchase
product.collectionsReturns an array of collections of all products.
product.compare_at_price_maxReturns the highest compared to price.
product.compare_at_price_minReturns the least compared to price.
Product.tagsReturns an array of all product tags.
Product.template_suffixReturns the name of the custom product template assigned.
product.titleReturns the title of the product
product.typeReturns the type of product.
product.urlReturns URL of the product.
product.vendorReturns the vendor of the product.
product.urlReturns the product ID
product.contentReturns the description of the product.
product.priceReturns the price of the product
product.price_maxReturns the maximum price of the product
product.price_minReturns the minimum price of the product.

20. ROUTES

Used to create Dynamic URLs for the storefront.

SyntaxDescription
routes.account_urlReturns the account URL
routes.account_login_urlReturns the login URL
routes.account_logout_urlReturn the logout URL
routes.account_recover_urlReturns the account recovery URL
routes.cart_urlReturns the cart URL
routes.cart_clear_urlReturns a URL that clears the cart.
routes.root_urlReturns the root URL
routes.search_urlReturns the search URL.

21. CHECKOUT

The checkout object can be accessed on the orders page.    

SyntaxDescription
checkout.attributesReturns the attributes of checkout
checkout.billing_addressReturns the billing address.
checkout.customerReturns customer’s name
checkout.customerReturns the discount applied for checkout
checkout.emailReturns email ID used during checkout
checkout.idReturns checkout ID.
checkout.order_nameReturns the name of the order
checkout.requires_shippingReturns whether the checkout as a whole needs shipping.
checkout.shipping_addressReturns the shipping address.
checkout.order_numberReturn the order number.
checkout.shipping_methodReturns the method of shipping.
checkout.shipping_priceReturns the checkout price.
checkout.tax_linesReturns tax lines of checkout.
checkout.tax_priceReturns the total cost of tax per checkout.
checkout.totalReturns the total price of checkout.

22. ORDER

SyntaxDescription
order.attributesReturns custom cart attributes for the order.
order.billing_addressReturns the order billing address.
order.cancelledChecks whether the order is canceled or not.
order.cancelled_atReturns the timestamp when the order was canceled.
order.cancelled_reasonReturns the reason for order cancellation.
order.cancel_reason_labelReturns the translated output of an order’s order.cancel_reason
order.created_atReturns the timestamp of when the order was created.
order.customerReturns customers associated with the order.
order.customer_urlReturns the url of the customer's account page.
order.discount_applicationsReturns an array of discount applications.
order.emailReturns email id associated with the order.
order.emailReturns the financial status of the order.
order.locationReturns the destination location of the order.
order.nameReturns the name of the order.
order.noteReturns the note linked with the order
order.order_numberReturn the order number.
order.shipping_addressReturns the shipping address of the order.
order.shipping_priceReturns the selling price of the order
order.tax_linesReturns the tax variable.
order.tax_priceReturns the order’s total tax.
order.total_discountsReturns the total discount on the order.
order.total_priceReturns the total price of the order.
order.transactionsReturns array of transactions.

23. ARTICLE

SYNTAXDESCRIPTION
article.authorReturns the full name of the author of the article.
article.commentsReturns the published comments of the article.
article.comments_countReturns the number of published comments.
article.comment_post_urlReturns the URL of the post.
article.contentReturns the content of an article.
article.created_atReturns the timestamp article was created.
article.excerptReturns to the excerpt of the article.
article.idReturns the ID of the article
article.imageReturns the image of the article.
article.urlReturns the relative URL of the article.
article.userReturns an object with author information.
article.user.bioReturns bio of the author.
article.user.emailReturns the email of the author.
article.user.first_nameReturns the first name of the author.
article.user.homepageReturn to the homepage.
article.user.last_nameReturns the Last name of the author.

CONCLUSION

Like any template language, Liquid acts as a bridge between an HTML file and a data store; in our case, the data is a Shopify store. This is accomplished by giving us easy-to-use and readable access to variables from within a template or Liquid file with user-friendly syntax.

By going through this cheat sheet, you would have gotten a decent understanding of Liquid by Shopify and how to implement it.

Shopify MCQ Questions

1.

Which of the following is not a datatype in liquid?

2.

Which of the following syntax returns the URL of payment SVG?

3.

Which of the following is not found in an order tag?

4.

Which of the following is true about Line Items?
 

5.

Which of the following is not included in the product tag?

6.

Which of the following is true about liquid?
 

7.

Which of the following is not found in the colour tag?

8.

Which of the following is a tax line command

a. tax_line.title

b. tax_line.price

c. tax_line.rate

d. tax_line.rate_percentage

e. tax_line.rate_cost

9.

______ returns the cost of a product.



Post a Comment

0 Comments

•Give The opportunity to your child with GreatToCode Kid's • Online Coding Classes for Your Kid • Introduce Your kid To the world's of coding
•Fuel You Career with our 100+ Hiring Partners, Advance Your Career in Tech with GreatToCode. •Join The Largest Tech and coding Community and Fast Forward Your career with GreatToCode. •10000+ Learner's+ 90 % placement Guarantee. • Learning Coding is Better with the GreatToCode community .
•Greattocode Kid's •GreatToCode Career •GreatToCode Interview •GreatToCode Professional •GreatToCode for schools •GreatToCode For colleges •GreatToCods For Businesses.
Are you ready to join the millions of people learning to code? GreatToCode Pass is your one-stop-shop to get access to 1000+ courses, top-notch support, and successful job placement. What are you waiting for? Sign up now and get your future in motion with GreatToCode Pass.