magento2 - Magento 2.3 Ubuntu 的 Venia 店面设置
问题描述
我现在正在尝试设置 Magento Venia Storefront 并将其连接到我的 Magento 2.3。我已经参考了以下网站:https ://magento.github.io/pwa-studio/venia-pwa-concept/setup/
- 到目前为止,我已经启动并运行了 Magento 2.3 后端。我从他们的官方 git 存储库中获取了一个克隆:( https://github.com/magento/pwa-studio.git )
- 我已经完成
yarn install
并安装了所需的软件包。 - 在此之后,文档建议我使用 buildpack 生成 SSL 证书,其命令为:
yarn buildpack create-custom-origin packages/venia-concept
执行此操作后,我现在收到以下错误:
yarn run v1.21.1
$ buildpack create-custom-origin packages/venia-concept
ⓧ Missing required environment variables:
MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
ⓧ Error: Missing required environment variables:
MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
ⓧ Error: Error: Missing required environment variables:
MAGENTO_BACKEND_URL: Connect to an instance of Magento 2.3 by specifying its public domain name. (eg. "https://master-7rqtwti-mfwmkrjfqvbjk.us-4.magentosite.cloud/")
CHECKOUT_BRAINTREE_TOKEN: Specify a Braintree API token to direct the Venia storefront to communicate with your Braintree instance. You can find this value in Braintree's
Control Panel under Settings > API Keys > Tokenization Keys. (eg. "sandbox_8yrzsvtm_s2bg8fs563crhqzk")
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
至于第一点,我找不到关于如何在设置 Venia 店面时配置 Braintree 的适当文档。第二点,我现在在本地运行我的 Magento 2.3,我的管理面板只在 Http 上运行。
任何帮助表示赞赏,在此先感谢您!
解决方案
首先创建您的 .env 文件,如果它不是使用以下命令构建的。
MAGENTO_BACKEND_URL="https://magento.local" yarn buildpack create-env-file packages/venia-concept
现在您可以在 packages/venia-concept/.env 中找到 .env 文件,您可以在其中将 MAGENTO_BACKEND_URL 设置为您的 magento url。
如果您将浏览 .env 文件,那么您会看到有一个字段 CHECKOUT_BRAINTREE_TOKEN=token 被注释掉了。取消注释并将 Braintree 令牌放入其中。
对于braintree 令牌,创建沙盒帐户, https://www.braintreepayments.com/sandbox?_ga=1.114967554.428334232.1579331999
然后复制您在创建帐户后获得的令牌(私钥)。
希望能帮助到你 !!
推荐阅读
- ruby - 为什么我在 Aws::SQS::Errors::NonExistentQueue 上找不到任何文档
- html - Hexagon Grid CSS - 所有六边形在单击时都会改变大小
- javascript - 如果值为 null,如何传递 JSON 解析?
- google-sheets - 自定义公式为:范围 = TRUE、Google 表格、条件格式、
- android - 我可以使用无障碍服务知道屏幕上的所有视图 ID 吗?
- flutter - (Flutter) StreamBuilder 只返回 null
- python - 将多行(读取为单行/输入)粘贴到 Spyder 控制台
- javascript - VS Code 没有将关键字“this”链接到当前的 javascript 对象?
- xcode - 如何在 XCode 中为文本字段控件设置“占位符”值
- typescript - 带有 typescript 的 vue 没有重载匹配此调用