Questions tagged [liquid]

1

votes
2

answer
806

Views

API Call from Shopify's Liquid

I am writing trying to call the Instagram API from my online store on Shopify. I cannot use javascript because Instagram is not allowing the request. It is not a bad call, or an error, they are just denying it. So, I am using Liquid to call the API. I am wondering if there is something similar php's...
Anthony
1

votes
2

answer
47

Views

How to hide footer on customized rails 404 page in liquid shopify template

I am working on a rails website with views made predominantly with liquid shopify. I customized the default rails 404 error message to something more dynamic that would display an animation and the top menu of the website. My new error pages are named not_found.html.erb and internal_server_error.htm...
Hakeem Baba
1

votes
1

answer
334

Views

How to validate if a string property is numeric on a Logic Apps Liquid template?

I'm creating a Liquid template, and I need to validate whether a string property in my JSON payload is numeric (contains only digits). I've tried to implement the tip suggested here {% assign test = 'A string' | plus: 0 %} {{ test }} {% assign test_d = '123456' | plus: 0 %} {{ test_d }} {{ test }}...
Paco de la Cruz
1

votes
1

answer
77

Views

Update shopify cart with customized product image

I'm working on Shopify public app creation. I have customized a product image and store that image link in a meta field of that particular product. I want to show the customized image I had created when adding the product to cart and other order product listing section without updating actual produc...
Shamon S
1

votes
0

answer
251

Views

Shopify - Display all products with the same vendor as current product

We built our Shopify site so that the only product variants would be size. However, we also wanted to display different styles of the same product as thumbnail links on product pages. This was done using the vendor attribute and the following liquid code: {% assign vendor = product.vendor %} {% assi...
new recruit 21
1

votes
0

answer
124

Views

How to globally register custom Liquid filters?

In my Rails 5 app I'm trying to globally register a custom Liquid filter, but my filters aren't getting registered. In my root/lib folder I save: # lib/liquid_filters.rb module DatetimeFilters def previous_business_day(datetime) Time.previous_business_day(datetime) end end Liquid::Template.register_...
JohnSmith1976
1

votes
1

answer
171

Views

Sort Products by Published date in collection page - SHOPIFY

We want our products sorted out by Publish Date, (not by created date) I'm sure this is possible in Shopify, I just don't get what I'm missing. {% assign date_now_sort = 'now' | date:'%s' %} {% assign product_sort = collection.products | sort: 'published_at' | reverse %} {% for product in produc...
AJ Abaricia
1

votes
1

answer
32

Views

jekyll: Is it possible to use a page.variable, as an operator inside a conditional if statement?

JSON file in path: _data/integers.json which looks like this: { '100': [ { 'value': 'true' } ] } In Jekyll page: --- integers: - 100 - 200 --- What I'm trying to do: {% assign json = site.data.integers %} {% for integer in page.integers %} // loop {% if json.{{ integer }}[0].value == 'true' %} ......
Daniel Haim
1

votes
1

answer
454

Views

Hiding products based on customer tag Shopify search.liquid

I hope someone may be able to help with this. I am currently setting up my store with shopify and have duplicated my products for retail and wholesale customers. The only issue I am faced with is that the retail products are still showing when a customer with the 'wholesale' tag uses the search box...
Andy L
1

votes
0

answer
53

Views

Creating a div in Jquery and passing it through object

Currently I'm able to pass just text to the ajax-cart-template but when I try to pass a element that I create it returns [object Object]. This is my code in ajax-cart.js. Now the hiddenProductText does get passed through. Just not the element I created. var hiddenProductText = 'Add $99+ to Your Car...
Dustin Lee
1

votes
1

answer
38

Views

Filter Collection Items by page metadata

Context I have a jekyll collection called product-categories in which each file has the following metadata in front matter: _product-categories/filename1.md --- - title - uuid --- I have a page whose front matter contains filenames from this collection (collection array selections are saved by their...
Josh
1

votes
0

answer
31

Views

Paginate highly filtered Jekyll collection

I’m building an ICO Website. The website contains a ‘coins’ collection, this collection contains all the ico coin pages. I have then created pages such as https://moonlandingnetwork.netlify.com/upcomingico , https://moonlandingnetwork.netlify.com/activeico etc to display these coins based on w...
alwingeorge
1

votes
0

answer
147

Views

VScode - No syntax highlighting inside {% schema %} or {% stylesheet %} tags in .liquid file

I've started a new job working on shopify templates and am having trouble getting the syntax highlighting to work in VSCode. I have installed the Liquid Languages Support and Shopify Liquid Template Snippets extensions, but on my .liquid files there is no syntax highlighting inside the {% schema %}...
Davez01d
1

votes
1

answer
104

Views

Jekyll Liquid limit contains

I would like to limit how many posts show which contains the layout project but doing this just limits my posts. If I put the limit:4 after the contains, I'm met with; Liquid Warning: Liquid syntax error (line 50): Expected end_of_string but found pipe in 'post.layout contains 'project' | limit:1' i...
spskeen
1

votes
0

answer
96

Views

Shopify order confirmation email does not shows if condition statement for out of stock product,

My task is fairly straightforward but seems it doesn't. I am attempting to send the order confirmation email for out of stock product i.e whose inventory is zero or less. I am allowing to place out of stock order and wants to send order confirmation email as An order will be dispatched by June 17 in...
amar ghodke
1

votes
1

answer
51

Views

Shopify liquid : cart-template variant is not defined

I am simply allowing to checkout out of stock product to buy. When a customer wants to buy product has inventory less than zero and clicks on view cart from ajax cart, I simply want to show message ' dispatch by 7 June.' in cart-template.liquid.I have applied logic as given below. If required full c...
amar ghodke
1

votes
1

answer
37

Views

How to group Jekyll pages by the first letter of the title?

I'm building a Jekyll site that has a page for each topic. I want to create an alphabetically grouped list of links to each page. For example, if my topic titles are: Aardvark Beatle Catfish Cattle I want to end up with a list of links organised as: A Aardvark B Beatle C Catfish Cattle So far, I ha...
mistakenot
1

votes
0

answer
247

Views

Shopify output line items as json values

I am trying to amend our tracking code for Shopify to output the items in the order, but it's giving me issues as not returning what i want. Any ideas please. It's var pr = values that are not working. The rest is fine and outputs what we need: var of_ssid = 'xxxx'; var cs = '{{ total_price | money_...
Onefeed
1

votes
0

answer
129

Views

Check if variable type is hash or array in liquid

I am attempting to write a somewhat generic layout that can take as a parameter either an array of strings or a hash of options, so you can either do: option: - 'One: This is' - 'Two: Raw HTML' Or you can do: option: One: This is Two: a mapping The reason I want to support both of these is that this...
Paul
1

votes
0

answer
151

Views

Regex Replace or Remove in Liquid Syntax

Can We have something in Liquid syntax for following Regex r = new Regex(@'[^a-zA-Z0-9_. ]+', RegexOptions.Compiled); string result1 = r.Replace('input text', 'replacement text'); Which basically do a Replace or Remove?
0

votes
0

answer
5

Views

How do I use a variable inside an include statement in a Jekyll file?

I have a multilingual Jekyll website and I'm trying to build a page that uses an include that will append a file based on the language used but I'd like to avoid using an if statement. I tried to use the following options without success: {%- assign filename = 'myFile.' -%} {%- assign lang = site.ac...
bemed
1

votes
0

answer
126

Views

How to make picture srcset with media queries in liquid (shopify)

I'm looking to render device specific images for both my products, but also all the content that is uploaded through the customize section in Shopify. I'm looking to generate something like the following: How can this be done in liquid as a reusable snippet for both product images, collection images...
martinsoender
1

votes
0

answer
182

Views

Shopify: Slide show images don't aspect fit to the banner area; they get cropped

I am using shopify theme 'Pop' which comes with a Slick Slider Hero. When the slideshow is opened on a mobile device, it automatically crops my images which I don't want because I added text to the image so it cuts it off (view pic attached) Please let me know what code to add to what liquid/css fil...
MissManihi
1

votes
2

answer
92

Views

How do I make hover attributes permanent? [CSS]

I will be using images as it may be hard to understand otherwise. We have these social icons in the footer of our site that have a lovely hover state, however, I can't seem to replicate it without the hover. Facebook Icon: Hover Inactive: Facebook Icon: Hover Active: I would like to replicate the h...
Leon M
1

votes
0

answer
23

Views

Looping through product images in 4s with an offset

So I've got a carousel with thumbnails in which I'm dynamically pulling in product images. The code looks like this: {{ featured_image.alt | escape }} {% for image in product.images offset:1 %} {{ image.alt | escape }} {% endfor %} {% cycle 'section-group-1': '', '' %} {% for image in product.images...
MariaL
1

votes
1

answer
120

Views

How to check if category/tag exists in Jekyll?

I'm trying to achieve a post header like in the example below: 8/18/2018 | Tags: foo, bar In order to do that I need to make sure tag exists, otherwise | Tags: section waste space in untagged post. After searching the web, I tried this statement: {% if post.tags != nil %} Tags: {% for tag in tags %}...
ege
1

votes
0

answer
130

Views

Updating Cart issue on Shopify Checkout Page

With reference to this page URL: https://shop.betterbody.co/pages/autoship-provitalize Select a bottle, the the page will look like this: checkout page We have an issue on our checkout page when we are about to update the quantity using the + and - buttons. Sometimes it works, sometimes it doesn't....
Nazreen M Daud
1

votes
1

answer
66

Views

How to ignore offset in jekyll when previous post is skipped

i'm trying to create my first blog on jekyll. And i stucked in one stupid thing. so the theme is next: i have a section for one of my categories, let it be 'news': {% for post in site.categories.news limit: 2 offset: 0 %} {% include news-item-col-6.html %} {% endfor %} {% for post in site.categorie...
Nursultan Askaruly
1

votes
0

answer
188

Views

Shopify tag product filter not working with checkbox select

i'm trying to create a set of product filters that will work individually or as multiple selects. For test purposes i've added two sets of checkbox that separate different types of filtering options; Category and Size. When you check one of the checkbox option, the page reloads, but with all of the...
moody1208
1

votes
0

answer
28

Views

Droparea dont function, Jquery -> Drag and drop show image and not upload

i have a small problem - i can add a file on click. only the dropzone dont work. If I drag and drop the file in the browser, will be displayed and not uploaded. $('#trigger-attachment').click(function(event) { if ($('#attachment-1').val() == '') { console.log('trigger 1') $('#attachment-1').click();...
Quixxm
1

votes
0

answer
276

Views

Add Custom Script to Shopify Liquid Section

I am working on OutdoorProducts.Com and we have been provided a custom video player widget. (function(d, s) { __TVPage__ = window.__TVPage__ || {}; __TVPage__.config = __TVPage__.config || {}; __TVPage__.config['carousel-home'] = { loginid: '1759226', channel: {'id':'179996403'}, targetEl : 'carous...
Mario Espinoza
1

votes
2

answer
40

Views

Checking for tag duplicates with jekyll excludes tags that are contained in other tags

I am trying to build a (simple, unweighted) tag cloud with liquid in my jekyll site. The tag cloud renders fine when I use this code: {% assign sitetags = '' %} {% for page in site.pages %} {% for tag in page.tags %} {% unless sitetags contains tag %} {% assign sitetags = sitetags | append:tag | app...
leucotic
1

votes
0

answer
35

Views

Octopress / Jekyll: Liquid tag not parsed before being put into file

Any attempt to use the syntax suggested in the Jekyll docs for creating links to posts, or [Name of Link]({{ site.baseurl }}{% post_url 2010-07-21-name-of-post %}) causes the error Error: Tag '{%%20post_url%202018-12-04-irc-codename-phoenix%20%}' was not properly terminated with regexp: /\%\}/. Rea...
Jackson W
1

votes
1

answer
16

Views

printing unique variants for all products on top of a collection page

I am trying to create a filter on top of a collection page with all the available variants. But, I need them to be formatted nicely so I'm using the following code: {% for product in collections.all.products limit: limit %} {% assign sizes = product.variants | map: 'option1' | uniq %} {% assign co...
MG1
1

votes
1

answer
28

Views

Show custom fields on the collection page in Shopify

I am using a plugin that filters products. This means that products are no longer shown in the traditional product loop. I think the plugin has switched to using javascript to show products on the collection page rather than liquid. For every product on a collection page, I wish to show its colour....
Adam Scot
1

votes
1

answer
52

Views

Jekyll liquid if statement confusion

I'm trying to make a if statement work according to my markdown post's liquid header where if a variable is set to true, do a thing, else and if it doesn't exist do the other thing. Just can't seem to get it to work properly. I've tried changing the if statement to {% unless %}. trying different com...
Michael SanAngelo
1

votes
0

answer
81

Views

How to load jekyll data from sub-folder dynamically using page variable as data file name

I learned how to load data from _data/sub-folder from here as following: site.data[page.folderName].fooList But could not figure out how to load data from _data/sub-folder when using page variable as the data file name. Page front-matter: --- layout: default title: Foo folderName: foo dataFileName:...
Hassan Tareq
1

votes
1

answer
26

Views

XML to CSV with data header using Liquid Data Mapper

I have an XML file that describes a header and a list. I need to generate a CSV file where the first line of the file is constructed from the header information and the subsequent lines of the file constructed from the list. The header has a different number of columns to the list items. This is eas...
A Bridgen
1

votes
0

answer
25

Views

Excluding products from shopify search

I am trying to exclude certain products with a specific tag. I was able to exclude products using {% unless result.tags contains 'wholesale' %} on the search page, but having trouble with the search header. The template I have been modifying is using the raw tag. Anyone got any suggestions? {% raw %...
Megan
1

votes
1

answer
58

Views

Scroll top undefined in shopify site

I am working on an ecommerce store(shopify/liuquid). I want to scroll smoothly to different hashs. Now because this is a CMS, I have had to add some attributes via editor or manually with JS. Here I give it the href $(document).ready(function() { $('.hero__cta').addClass('scroll'); $('.hero__cta')....
ptts

View additional questions