magicalella/yii2-shopify
Composer 安装命令:
composer require magicalella/yii2-shopify
包简介
Shopify component for Yii 2 framework
README 文档
README
Modulo per integrare la Yii con Shopify
Shopify Technical API Documentation Generate access Token (https://shopify.dev/docs/apps/build/authentication-authorization/access-tokens/generate-app-access-tokens-admin)
Installation
The preferred way to install this extension is through composer.
Run
composer require "magicalella/yii2-shopify" "*"
or add
"magicalella/yii2-shopify": "*"
to the require section of your composer.json file.
Configuration
Component Setup
- Add component to your config file
'components' => [ // ... 'shopify' => [ 'class' => 'magicalella\shopify\Shopify', 'storeName' => 'store name in Shopify', 'accessToken' => 'accessToken generate in Shopify APP', 'apiVersion' => 'api version settin durinf build APP in Shopify', ], ]
Usage:
Query:
const QUERY_CHECK = <<<QUERY query test (\$userId: Int!){ userInfo (userId: \$userId) { firstname lastname email } } QUERY; $result = Yii::$app->graphql->execute(QUERY_CHECK, ['userId' => (int) $userId], 'github');
ActiveDataProvider:
use magicalella\shopify\ShopifyDataProvider; // If you want to use pagination in ActiveDataProvider, Set $offset and $limit in your query. Everything will be handled automatically. const QUERY = <<<QUERY query(\$limit: Int, \$offset: Int){ categories (first: \$limit, skip: \$offset){ id name icon } } QUERY; $dataProvider = new ShopifyDataProvider([ 'query' => QUERY, 'queryCallback' => 'data.categories', // How to access the array in responded query result? More: https://www.yiiframework.com/doc/guide/2.0/en/helper-array#getting-values 'totalCountQuery' => 'query { categoriesConnection { aggregate { count } } }', 'target' => 'prisma', ]); return $this->render('index', [ 'dataProvider' => $dataProvider, ]);
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-05-29