shopify开发经验

1.任意页面直接跳转checkout页面

目前shopify 购买按钮直接跳转到结账页面,shopify没有提供官方方法,但是 有一个黑科技方法,通过模拟 提交购物车到结账页面的形式 例子:
<a href='/cart/{{product.selected_or_first_available_variant.id}}:1/‘>  </a>

2.获取任意一个section的html

// header 任意一个section里面的文件名 header.liquid
// 注意只获取html结构没有schema数据
fetch('/?sections=header').then((response) => {
    return response.json();
})
.then((data) => {
    console.log("data", data)
}).catch(err=> {
    console.log("error", err)
})

3.git 命令 纳入版本管理的需要先清空

git rm -r --cached .
git add .
git commit -m 'update .gitignore'
git push -u origin master

4.环境搭建 资源学习

### [Liquid文档](Liquid 模板语言中文文档 | Liquid 中文网)

### [shopify文档](Shopify Developers Platform—Build. Innovate. Get paid.) 入门文档

###安装shopify cli https://shopify.dev/themes/tools/cli/installation

### shopify liquid https://shopify.dev/api/liquid/filters/array-filters

安装shopify 2.0 版本

### jquery学习https://www.runoob.com/jquery/jquery-tutorial.html

5.命令

shopify login --store xx.myshopify.com 建立shopify登录连接

shopify theme pull 拉取shopify代码

shopify theme serve 启动

shopify theme push 发布代码

切换分支

shopify switch --store xx.myshopify.com

shopify switch --store xx.myshopify.com

忽略文件操作:

https://shopify.dev/themes/tools/cli#excluding-files-from-shopify-cli

shopify theme push --ignore .shopifyignore

shopify theme pull --ignore .shopifyignore

获取url链接

    {{ canonical_url }} 全链接
    {{ shop.url }} 网站链接
    {{ shop.domain }} 主题
    {{ request.pathname }}
    {{ request.path }}
    {{ request.shop_locale }}
     {{ request.locale | json }}
     {{ shop_locale.locale }}
     {{ localization.country.iso_code }} 获取地区

扩展ui
shopify app deploy

https://github.com/Shopify/remote-ui
安全
https://shopify.dev/docs/api/checkout-ui-extensions#ui-components

远程
https://shopify.engineering/remote-rendering-ui-extensibility

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值