adezandee/shopify-bundle

Symfony2 扩展包,用于与 Shopify 店铺交互(API 调用)

安装次数: 18

依赖者: 0

建议者: 0

安全: 0

星标: 4

关注者: 1

分支: 2

类型:symfony-bundle

dev-master 2014-04-27 23:17 UTC

This package is not auto-updated.

Last update: 2024-09-28 15:44:32 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Total Downloads License

Symfony2 扩展包,用于与 Shopify 店铺交互(API 调用)

配置

安装扩展包后,您需要 Shopify 店铺的私钥和密码,并将其添加到配置文件中:[http://docs.shopify.com/api/tutorials/creating-a-private-app](http://docs.shopify.com/api/tutorials/creating-a-private-app)

# app/config/config.yml

shopify:
    api_key:    "%shopify_api_key%"
    password:   "%shopify_password%"
    secret:     "%shopify_secret%"
    domain:     "%shopify_domain%"

基本用法

此扩展包提供 Shopify 对象映射,并允许您通过 API 调用创建、更新或删除 Shopify 店铺中的项目。

# AcmeBundle/Controller/DefaultController.php

    public function newProductAction()
    {
        $product = new Product();
        $product
            ->setTitle('Test Product1')
            ->setBodyHtml('Body Test Product1')
            ->setProductType('Test')
            ->setVendor('symfony')
        ;

        $product = $this->get('shopify.product_exporter')->export($product);

        // Now you can persist locally that you created a shopifyProduct
        // with $product->getId();
    }