Skip to content

Commit

Permalink
Remove latest product info
Browse files Browse the repository at this point in the history
  • Loading branch information
ingoldsby committed Jun 11, 2020
1 parent 50b3098 commit a166520
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ All notable changes to `laravel-dashboard-shopify-tile` will be documented in th
## 1.0.0 - 2020-06-09

- initial release

## 1.1.0 - 2020-06-11

- remove 'latest' product information as only the first product was able to be retrieved
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

This tile can be used on [the Laravel Dashboard](https://docs.spatie.be/laravel-dashboard) to display Shopify information.

![screenshot](https://user-images.githubusercontent.com/26500496/84368299-bab77800-ac18-11ea-981b-953a200e966a.png)

## Installation

You can install the package via composer:
Expand Down Expand Up @@ -80,7 +82,7 @@ If you discover any security related issues, please email instead of using the i

I have learnt a lot from Spatie's various packages, including [Mailcoach](https://mailcoach.app), and would recommend you check them out if you want to know more.

Learn how to create a package like this one, by watching Spatie's premium video course:
Learn how to create a package like theirs, by watching Spatie's premium video course:

[![Laravel Package training](https://spatie.be/github/package-training.jpg)](https://laravelpackage.training)

Expand Down
3 changes: 0 additions & 3 deletions resources/views/all/tile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
<div class="self-center font-bold text-4xl tracking-wide leading-none">
{{ $shopify['products']['count'] }}
</div>
<div class="text-dimmed text-xs">
{{ $shopify['products']['latest']['title'] }} created {{ \Carbon\Carbon::parse($shopify['orders']['latest']['created_at'])->diffForHumans() }}
</div>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion src/Commands/FetchShopifyInfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function handle(ShopifyApi $api)
$response['checkouts']['latest'] = $api->getShopifyInfo('checkouts', 'latest');

$response['products']['count'] = $api->getShopifyInfo('products', 'count');
$response['products']['latest'] = $api->getShopifyInfo('products', 'latest');

ShopifyStore::make()->setShopifyInfo($response);

Expand Down
4 changes: 0 additions & 4 deletions src/ShopifyApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class ShopifyApi
const ORDERS_FIELDS = '&fields=id,created_at,name,subtotal_price,currency';
const CUSTOMERS_FIELDS = '&fields=id,created_at,first_name';
const CHECKOUTS_FIELDS = '&fields=id,created_at,total_line_items_price,presentment_currency';
const PRODUCTS_FIELDS = '&fields=id,created_at,title';

public static function getShopifyInfo(string $endpoint, string $type = 'count', int $id = null)
{
Expand Down Expand Up @@ -57,9 +56,6 @@ public static function generateUrl(string $url, string $endpoint, string $type)
case 'checkouts':
$url = $url . self::CHECKOUTS_FIELDS;
break;
case 'products':
$url = $url . self::PRODUCTS_FIELDS;
break;
}

}
Expand Down

0 comments on commit a166520

Please sign in to comment.