Comments (35)
Yeah, and why is it stale bot? Because Shopify doesn't reply ;)
from shopify-api-php.
No worries. You can find an implementation of this issue in my fork: MagicLegend@d43bc94
from shopify-api-php.
+1
I don't know why this has NOT been implemented yet.
from shopify-api-php.
I have created PR for this. This is what should be (save
return response, saveAndUpdate
update object itself)
#185
from shopify-api-php.
This is a pretty serious issues that the Base.php save() method returns void. E.g. the rest api order docs incorrectly state there will be a response. Getting the response with the new order's id is mission critical for our use case, but I don't see a way to access the updated object.
Any contributors able to post a workaround until this is resolved?
from shopify-api-php.
@Zelfapp Yeah, as stated in the original message, I have fixed this (along with other improvements to the library) in my fork: MagicLegend@d43bc94
from shopify-api-php.
@MagicLegend I saw your PR. This library has too many issues for a private app at this point and feels too hacky. It has great potential though.
For the sake of anyone else battling this alpha lib for a private app, likely you're better off simply using guzzle to make REST api endpoint requests. E.g. in just few lines of code you can dynamically pass in any endpoint and payload.
Again, this is a great lib, but I would not classify as ready for production.
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
/// Guzzle client
$client = new Client();
$request = new Request(
'GET',
"https://$this->shop/admin/api/2022-07/$endpoint",
[
'X-Shopify-Access-Token' => $this->permanentAccessToken,
],
$endpointParams['payload'] ?? null,
);
$response = $client->sendAsync($request)->wait();
$response = $response->getBody();
from shopify-api-php.
I respectfully disagree, and we have my fork running in production right now. It works fine, it just has some quirks that Shopify is not allocating resources to to solve. I prefer using a library that's providing typing over doing it manually in Guzzle, but both will of course work fine.
from shopify-api-php.
This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Still waiting on Shopify...
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Still waiting on Shopify...
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Still waiting on Shopify...
from shopify-api-php.
I fully agree on this issue. I would like to see PR #185 to be committed.
from shopify-api-php.
On second thought. When you do for instance:
$product = new Product($session);
$product->title = "my awesome product"
echo $product->id // NULL as it's a fresh unsaved product
// now we save it and set the param $updateObject to true
$product->save($updateObject = true);
echo $product->id // 1234567876 !!!!
// our $product object has been replaced with the object from the response.
from shopify-api-php.
@brrrm Well, you don't pass $updateObject
if that's not what you intended to do, so the save()
call will return the updated entity instead of overwriting the existing entity.
from shopify-api-php.
the param $updateObject is not about updating an existing entity or creating a new entity. All it does is update the Object with the returned entity from Shopify's response. Or am I misunderstanding what you mean?
if ($updateObject) {
$body = $response->getDecodedBody();
self::createInstance($body[$this->getJsonBodyName()], $this->session, $this);
}
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Yeah, and why is it stale bot? Because Shopify doesn't reply ;)
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Yeah, and why is it stale bot? Because Shopify doesn't reply ;)
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Yeah, and why is it stale bot? Because Shopify doesn't reply ;)
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Yeah, and why is it stale bot? Because Shopify doesn't reply ;)
from shopify-api-php.
FYI for anyone still struggling with this, instead of calling just save()
, use saveAndUpdate()
and then the original item is populated.
$newFulfillmentServiceResponse = new ShopifyFulfillmentService($session); $newFulfillmentServiceResponse->saveAndUpdate(); $id = $newFulfillmentServiceResponse->id; //this is now populated by using saveAndUpdate over save
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Yeah, and why is it stale bot? Because Shopify doesn't reply ;)
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Yeah, and why is it stale bot? Because Shopify doesn't reply ;)
from shopify-api-php.
This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.
from shopify-api-php.
Yeah, and why is it stale bot? Because Shopify doesn't reply ;)
from shopify-api-php.
Hey folks, thanks for your patience here. We've removed the stalebot from this repo, and I'm going to add this issue to our tracking.
Once again, thank you for your patience!
from shopify-api-php.
Related Issues (20)
- A new release of the Shopify API occurred HOT 2
- Could not find the current session id in the cookies - Error still happening HOT 2
- Add missing @throws tag to DocBlocks HOT 2
- Unable to Access My shopify app UI in admin side using Docker. HOT 2
- cannot get response as the documentations HOT 2
- The Registry::process always fails for webhooks sent by Shopify
- Token Exchange support HOT 2
- Exception stacktrace goes missing when the processing of a webhook catches it HOT 3
- Utils::sanitizeShopDomain is not utilizing the custom $myShopifyDomain parameter HOT 3
- Complete example in documentation? HOT 2
- A new release of the Shopify API is due soon
- Add a method to retrieve the last raw response HOT 1
- 5.5.1 is a breaking change: CookieNotFoundException HOT 3
- A new release of the Shopify API occurred
- Default cookie setter in OAuth is not setting samesite = None
- Add missing CUSTOMERS_REDACT, CUSTOMERS_REQUEST & SHOP_REDACT topics. HOT 1
- Missing combines_with in PriceRule HOT 4
- Cant add fields, metafieldNamespaces, filter to webhooks! ruby has it why dont we??? Shopify\Webhooks\Registry::register HOT 1
- You may have taken more than 60 seconds to complete the OAuth process and need to start over HOT 2
- A new release of the Shopify API is due soon
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shopify-api-php.