Skip to main content

🚰 Liquid - Practice

  1. Create a condition in Liquid to add a custom library via the head tag for pages with the 'sales' template, utilizing the Liquid template object.

  2. Create code for a section where you can adjust the background color from customizer settings using the Liquid section object.

  3. Create code for a section block where you can adjust the text color for all text content of the block from customizer settings using the Liquid block object.

  4. Imagine you need to hide the buy button on the PDP page using Liquid when the product is in the cart. Create a condition in Liquid to achieve this.

  5. Create a link that redirects customers to the cart page and adds 5 units of the product with variant ID "47552039911706" using Liquid.

  6. Create code to check if a customer is logged in using Liquid.

  7. Describe how you would implement a feature where a template is visible only to logged-in customers and a login form is shown to others.

  8. Write Liquid code that displays the custom message “Delivery free!” to customers who are tagged as 'VIP'.

  9. Using Liquid, create a section that dynamically lists all collections a specific product belongs to, including links to those collection pages. (Product selects from the settings schema).

  10. Using Liquid, create a condition to display a special message on the homepage only to customers who have ordered more than 5 times.

  11. Write a Liquid snippet that adds pagination to a blog page, allowing users to navigate through different pages of blog posts.

  12. Create a Liquid condition that displays a newsletter signup section only if the visitor has not already subscribed.

  13. Create Liquid code to display the following information on the Product Detail Page (PDP) of a Shopify store:

    • Product Tags: List all tags associated with the product.

    • Vendor Information: Display the vendor's name for the product.

    • Product Type: Display the type of the product.

  14. If you need to load the product's pickup location on the Product Detail Page (PDP), how should it be done? Provide an example.