承接 magicalella/yii2-shopify 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. 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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-05-29