Coder Social home page Coder Social logo

Comments (35)

MagicLegend avatar MagicLegend commented on September 28, 2024 1

Yeah, and why is it stale bot? Because Shopify doesn't reply ;)

from shopify-api-php.

MagicLegend avatar MagicLegend commented on September 28, 2024 1

No worries. You can find an implementation of this issue in my fork: MagicLegend@d43bc94

from shopify-api-php.

shota avatar shota commented on September 28, 2024

+1
I don't know why this has NOT been implemented yet.

from shopify-api-php.

shota avatar shota commented on September 28, 2024

I have created PR for this. This is what should be (save return response, saveAndUpdate update object itself)
#185

from shopify-api-php.

Zelfapp avatar Zelfapp commented on September 28, 2024

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.

image

Any contributors able to post a workaround until this is resolved?

from shopify-api-php.

MagicLegend avatar MagicLegend commented on September 28, 2024

@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.

Zelfapp avatar Zelfapp commented on September 28, 2024

@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.

MagicLegend avatar MagicLegend commented on September 28, 2024

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.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Still waiting on Shopify...

from shopify-api-php.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Still waiting on Shopify...

from shopify-api-php.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Still waiting on Shopify...

from shopify-api-php.

brrrm avatar brrrm commented on September 28, 2024

I fully agree on this issue. I would like to see PR #185 to be committed.

from shopify-api-php.

brrrm avatar brrrm commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

@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.

brrrm avatar brrrm commented on September 28, 2024

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.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Yeah, and why is it stale bot? Because Shopify doesn't reply ;)

from shopify-api-php.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Yeah, and why is it stale bot? Because Shopify doesn't reply ;)

from shopify-api-php.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Yeah, and why is it stale bot? Because Shopify doesn't reply ;)

from shopify-api-php.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Yeah, and why is it stale bot? Because Shopify doesn't reply ;)

from shopify-api-php.

robthompsonweb avatar robthompsonweb commented on September 28, 2024

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.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Yeah, and why is it stale bot? Because Shopify doesn't reply ;)

from shopify-api-php.

github-actions avatar github-actions commented on September 28, 2024

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.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Yeah, and why is it stale bot? Because Shopify doesn't reply ;)

from shopify-api-php.

github-actions avatar github-actions commented on September 28, 2024

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.

MagicLegend avatar MagicLegend commented on September 28, 2024

Yeah, and why is it stale bot? Because Shopify doesn't reply ;)

from shopify-api-php.

paulomarg avatar paulomarg commented on September 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.