简体   繁体   中英

liquid Shopify - how to access the current URL

I need to access the URL when in the cart as there is an issue with the locale that I need to fix. I tried

{{ shop.secure_url }} and {{  page.url.  }} 

and many more but couldn't access it. Any idea?


thanks but still not working. I can't access the full URL in mini-cart.liquid. I used this conditional statement:

{% if request.locale.iso_code == "de" and request.origin contains 'https://myshop.ch' %} href="/{{ request.locale.iso_code }}/checkout"

Check the request object: https://shopify.dev/api/liquid/objects?shpxid=ae783aed-8802-4157-ED00-1067D234E633#request it should contain everything you need.

{
  "design_mode": false,
  "host": "polinas-potent-potions.myshopify.com",
  "locale": {},
  "origin": "https://polinas-potent-potions.myshopify.com",
  "page_type": "index",
  "path": "/"
}
``

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM