Sign in to follow this  
Pixrael

Woocommerce REST API can be cloned?

Recommended Posts

I have a technical question that maybe you can guide me to a solution/idea.

I know an online tool that publishes product information and updates prices/inventories regularly from marketplaces such as Amazon, Ebay, etc. to a Wordpress website ... can get the orders information, auto-order it and send back the tracking numbers. All this is done through the Woocommerce API. They don't have an API or CSV option to access this features..

Is it possible to create fake REST endpoints (a clone of WooCommerce) on my site to accept requests from that external website and process this data my way inside PW? The requests to a REST endpoint are POST like in regular forms submits?

Sorry I don't have to much technical background about this

Share this post


Link to post
Share on other sites
4 hours ago, clsource said:

Another option is to create a "Fake Woocommerce" site and use PW inside their handlers
in order to save the data into PW.

This is a solution I was thinking about at the beginning, but it could be very complex for me ... maybe I'll install WP + WC in a subdomain to act as a "router" and then I can connect to the WC API to get/put information the exact information I'll need about prices, inventory and orders ... it's crazy, but I need that tool, so I need to be creative πŸ™‚

Thanks for you response

Share this post


Link to post
Share on other sites
38 minutes ago, Pixrael said:

but I need that tooο»Ώl,

What tool is that, btw?

Share this post


Link to post
Share on other sites

is Shopmaster ... by the way yesterday I bought a license for Padloper .. and I'll be ready for the new version πŸ˜‰

  • Like 1

Share this post


Link to post
Share on other sites
6 hours ago, Pixrael said:

This is a solution I was thinking about at the beginning, but it could be very complex for me ... maybe I'll install WP + WC in a subdomain to act as a "router" and then I can connect to the WC API to get/put information the exact information I'll need about prices, inventory and orders ... it's crazy, but I need that tool, so I need to be creative πŸ™‚

Thanks for you response

well you can always read the database directly

or use the wordpress rest api πŸ™‚

  • Thanks 1

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By louisstephens
      I am wondering, how do you pass a variable into wire('page')->get() inside a function? I have been looking through the forums, but unfortunately I have not found the answer yet.
      My current set up is:
      function generateNewPages($parentPageName) { $p = new Page(); $p->template = "parent"; $p->parent = wire('pages')->get('/home/'); $p->name = $parentPageName; $p->title = $parentPageName; $p->of(false); $p->save(); $p2 = new Page(); $p2->template = "child"; $p2->parent = wire('pages')->get('$parentPageName'); $p2->name = "child"; $p2->title = "Child Page"; $p2->of(false); $p2->save(); } When I try to run it by passing in a title like generateNewPages('Demo');, "Demo" is created, but when it gets to the child page I get:
      Unknown Selector operator: '$' -- was your selector value properly escaped?
      Is there a way to pass the $parentPageName to "wire('pages')->get('$parentPageName')" ?
    • By thomasaull
      I recently started to build Vue SPAs with ProcessWire as the backend, connected with a REST API. Thanks to code and the help of @LostKobrakai (How to use FastRoute with ProcessWire) and @clsource (REST-Helper) I got it up and running pretty quickly and now have put all of it in a site profile for others to use. It includes the REST API with routing for different endpoints, JWT Auth and a simple Vue SPA which shows the process of logging in a user (nevertheless, you don't have to use the Vue part, the API will work on it's own).
      Check it out here: https://github.com/thomasaull/RestApiProfile
      I'm pretty sure, it's not the perfect or most sophisticsted solution, but it gets the job done for me…
      Feedback or Improvements are very welcome
      Update: This site profile is a module now: https://github.com/thomasaull/RestApi
    • By Xonox
      Hi,
      Β 
      I'm trying to upload images from a folder into a page. I need to replace the images instead of adding. The image field already has the replace existing images turned on, but it doesn't seem to be enough.
      Β 
      My code:
      foreach($files as $file) { if(substr($file, 0, 1) != '.' && $file != '.' && $file != '..') { // Get SKU $file_sku = substr($file, 0, 9); // Check for book $book = $pages->get('sku=' . $file_sku); if(!$book->id) { // Book doesn't exist } else { // Upload image into book !!! THIS CODE ADDS FILE INSTEAD OF REPLACING. HOW CAN I REPLACE? $book->book_images->add($upload_directory . '/' . $file); // Delete file unlink($upload_directory . '/' . $file); } // Save book if($book->id) $book->save(); } } Β 
      What am I missing?
    • By louisstephens
      I have a repeater with a text field where I would like to use hanna code (to make it easier on the user) so the user can define the action of a image that is in the repeater. For example:
      1. The image should have an external link:
      - the user can just type in the url
      2. The image, when clicked, should be printable (using print.js)
      - the user can just type [[print_image]]
      That works just fine, but I am running into an "issue". The code I need to use to print is:
      onclick="printJS({printable: 'path_to_image', type: 'image'});" I can put that into the hanna code as plain text, but I have no idea how to get the image from the repeater item and pass to "path_to_image". Is this even possible?