Skip to content

Added the Cart Resource #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ Some resources are available directly, some resources are only available through
- Blog -> Article -> [Metafield](https://help.shopify.com/api/reference/metafield)
- Blog -> [Event](https://help.shopify.com/api/reference/event/)
- Blog -> [Metafield](https://help.shopify.com/api/reference/metafield)
- [CarrierService](https://help.shopify.com/api/reference/carrierservice/)
- [CarrierService](https://help.shopify.com/api/reference/carrierservice/)-
- [Cart](https://shopify.dev/docs/themes/ajax-api/reference/cart) (read only)
- [Collect](https://help.shopify.com/api/reference/collect/)
- [Comment](https://help.shopify.com/api/reference/comment/)
- Comment -> [Event](https://help.shopify.com/api/reference/event/)
Expand Down
24 changes: 24 additions & 0 deletions lib/Cart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace PHPShopify;

/* @see https://shopify.dev/docs/themes/ajax-api/reference/cart */
use PHPShopify\ShopifyResource;

class Cart extends ShopifyResource {

/**
* @inheritDoc
*/
protected $resourceKey ='cart';

/**
* @inheritDoc
*/
public $searchEnabled = false;

/**
* @inheritDoc
*/
public $readOnly = true;
}
3 changes: 3 additions & 0 deletions lib/ShopifySDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
* @property-read ApplicationCharge $ApplicationCharge
* @property-read Blog $Blog
* @property-read CarrierService $CarrierService
* @property-read Cart $Cart
* @property-read Collect $Collect
* @property-read Collection $Collection
* @property-read Comment $Comment
Expand Down Expand Up @@ -115,6 +116,7 @@
* @method ApplicationCharge ApplicationCharge(integer $id = null)
* @method Blog Blog(integer $id = null)
* @method CarrierService CarrierService(integer $id = null)
* @method Cart Cart(string $cart_token = null)
* @method Collect Collect(integer $id = null)
* @method Collection Collection(integer $id = null)
* @method Comment Comment(integer $id = null)
Expand Down Expand Up @@ -167,6 +169,7 @@ class ShopifySDK
'ApplicationCharge',
'Blog',
'CarrierService',
'Cart',
'Collect',
'Collection',
'Comment',
Expand Down