shopify平台使用自定义图片个性化设置礼品卡步骤

2024-01-01 14:01:26
By 我会发光也会爆炸

使用自定义图片个性化设置礼品卡


为礼品卡上传新图片

  1. 在 Shopify 后台中,转到在线商店 > 模板

  2. 找到您要编辑的模板,然后点击操作 > 编辑代码

  3. 在 Assets 目录中,点击添加新资产

  4. 点击选择文件,以浏览到您计算机上的新礼品卡图片并上传。我们建议使用简单的文件名,例如 blue-giftcard.png

提示:礼品卡图片的建议大小为 950 × 550 像素(您还可以使用 5:3 的纵横比或最小尺寸 450 x 270 像素)。

  1. 点击上传资产。新的礼品卡图片将显示在您的 Assets 目录中。请记下文件扩展名(.png 或 .jpg)。

编辑礼品卡模板文件,使其使用您的新图片

  1. 在 Templates 目录中,点击 gift-card.liquid

  2. 在该文件中查找以下代码:

    liquid <img src="{{ 'gift-card/card.jpg' | shopify_asset_url }}" alt="">

  3. 将它替换为以下代码:

    liquid <img src="{{ 'blue-giftcard.png' | asset_img_url: '1024x1024' }}" alt="">

  4. 点击保存

备注:请确保根据需要将 blue-giftcard.png 更改为新图片的文件名和扩展名。

预览您的新礼品卡图片

  1. 在模板代码编辑器中,点击右上角的自定义模板

  2. 打开模板编辑器。

  3. 在页面顶部的下拉菜单或在移动设备上的模板菜单中,选择礼品卡

Shopify商户官网原文详情:

Personalize gift cards with a custom image

Upload a new image for your gift card

  1. From your Shopify admin, go to Online Store > Themes.

  2. Find the theme you want to edit, and click Actions > Edit code.

  3. In the Assets directory, click Add a new asset.

  4. Click Choose File to browse to the new gift card image on your computer and upload it. We suggest using a simple filename, for example blue-giftcard.png.

  5. Click Upload asset. The new gift card image will appear in your Assets directory. Take note of the file extension (.png or .jpg).

Edit the gift card template file so that it uses your new image

  1. In the Templates directory, click gift-card.liquid.

  2. Find the following code within the file:

    <img src="{{ 'gift-card/card.jpg' | shopify_asset_url }}" alt="">
  3. Replace it with the following:

    <img src="{{ 'blue-giftcard.png' | asset_img_url: '1024x1024' }}" alt="">
  4. Click Save.

Preview your new gift card image

  1. From the theme code editor, in the top right-hand corner, click Customize theme.

  2. Open the theme editor.

  3. From the drop-down menu at the top of the page, or from the Templates menu on mobile, select Gift card.

文章内容来源:Shopify商户官方网站



(本文内容根据网络资料整理和来自用户投稿,出于传递更多信息之目的,不代表本站其观点和立场。本站不具备任何原创保护和所有权,也不对其真实性、可靠性承担任何法律责任,特此声明!)


常见问答(FQAS)


礼品卡图片格式要求?

礼品卡使用的图片格式需要是JPG、JPEG或PNG格式,大小建议在200KB以下。

如何上传自定义图片?

登录商城后台管理系统,进入“产品”选项卡,选择需要设置图片的礼品卡,点击“编辑”按钮,选择“添加图片”选项,选择上传图片文件即可。

图片设置位置有哪些?

主要有三个位置可以设置图片:卡面图片、卡内图片与卡背图片。卡面图片设置在卡片正面展示,卡内图片设置在卡片内页展示,卡背图片设置在卡片反面展示。

是否可以设置图片链接?

是的,您可以给图片设置链接。在上传图片后,系统会自动生成图片链接地址,您可以修改这个链接地址,将图片设置点击后跳转到您想要的页面。

如何设置卡片样式?

您可以登录后台的“产品”页面,选择需要设置样式的礼品卡,点击编辑按钮,选择“样式”选项进行卡片样式设置,包括卡片尺寸、背景颜色等。