adezandee / shopify-bundle
Symfony2 扩展包,用于与 Shopify 店铺交互(API 调用)
dev-master
2014-04-27 23:17 UTC
Requires
- php: >=5.3.2
- guzzle/guzzle: ~3.9
- jms/serializer-bundle: ~0.13
Requires (Dev)
- phpunit/phpunit: ~4.0
- symfony/config: ~2.3
- symfony/dependency-injection: ~2.3
- symfony/http-kernel: ~2.3
- symfony/yaml: ~2.3
This package is not auto-updated.
Last update: 2024-09-28 15:44:32 UTC
README
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(); }