Hallo Community,
beim letzten Mal wurde mir hier sehr gut weitergeholen mit der WooCommerce API Schnittstelle.
Diesmal möchte ich die Produkte aus der API Datenbank meines Lieferanten rausholen, in meiner eigenen Datenbank abspeichern und anschließend im Shop hochladen, wenn die Kriterien erfüllt werden.
Das Script scheint fast wie gewünscht zu funktionieren. Jedoch gibt es ein kleines Problem. Beim Hochladen der Produkte über die WooCommerce API (PHP) kommt es zu folgender Fehlermeldung in der Linux Konsole :
<pre><code>cURL Error: Operation timed out after 15000 milliseconds with 0 bytes received</code><pre><pre><code>Automattic\WooCommerce\HttpClient\Request Object
(
[url:Automattic\WooCommerce\HttpClient\Request:private] => https://4-gamers-shop.com/wp-json/wc/v3/products?consumer_key=&consumer_secret=
[method:Automattic\WooCommerce\HttpClient\Request:private] => POST
[parameters:Automattic\WooCommerce\HttpClient\Request:private] => Array
(
[consumer_key] =>
[consumer_secret] =>
)
[headers:Automattic\WooCommerce\HttpClient\Request:private] => Array
(
[Accept] => application/json
[User-Agent] => WooCommerce API Client-PHP/3.0.0
[Content-Type] => application/json;charset=utf-8
)
[body:Automattic\WooCommerce\HttpClient\Request:private] => {"sku":"749bfcd4-e9bc-48b7-9d7c-35af1d3b4a34","status":"publish","catalog_visibility":"visible","name":"3D ParticleGen Visual FX","type":"simple","regular_price":"2","short_description":"","manage_stock":true,"stock_quantity":"995","categories":[{"id":"1429"},{"id":"1430"},{"id":"1431"}],"description":"<strong>ParticleGen<\/strong> is a flexible and highperformance tool for the creation of multifaceted 3D particle effects in real-time. Thanks to numerous professional features like Interactive real-time previews and the exact setting of parameters using curve diagrams, the program is ideally suited for DTP, video compositing, post processing, software development and all kinds of visualization.<br><br><strong>ParticleGen <\/strong>enables the realization of almost any desired effect, from explosions and fog to reflections in water. Besides using your own particle shapes which can be created with any conventional image editing program, the software also allows you to import textured 3DS files, which you then can use as particles or animations. For "Autodesk Maya" users, <strong>ParticleGen <\/strong>enables users to import camera animation for compositing purposes. Yet another of the software's special features is the display of optical deformation effects like shimmering air, shock waves, etc. <br><br>ParticleGen also enables you to import the widest range of file formats, like TGA (images and sequences), BMP, DDS or AVI.<h2>Features<\/h2><ul><li>True 3D display, with wind and gravity influences<br><\/li><li>Interactive real-time preview with High Dynamic Range Rendering<br><\/li><li>Display of optical deformation effects (Displacement Maps)<br><\/li><li>Codec, frame rate, frame interlace and color space can be individually set<br><\/li><li>Configurable lighting, background and terrain<br><\/li><li>Use of own textures and 3D objects as well as background images and videos<br><\/li><li>Extensive particle, texture and effects library<br><\/li><li>Export Per Frame (DDS series, TGA series) or as video (AVI) up to 4000x3000 Pixel <br><\/li><li>Export of depth information and alpha channel<br><\/li><li>Resets for PAL-, NTSC- and HDTV formats<\/li><\/ul","images":[{"src":"http:\/\/167.86.107.132\/importProductsAuto\/images\/749bfcd4-e9bc-48b7-9d7c-35af1d3b4a34\/gallery5.jpg"},{"src":"http:\/\/167.86.107.132\/importProductsAuto\/images\/749bfcd4-e9bc-48b7-9d7c-35af1d3b4a34\/gallery3.jpg"},{"src":"http:\/\/167.86.107.132\/importProductsAuto\/images\/749bfcd4-e9bc-48b7-9d7c-35af1d3b4a34\/gallery2.jpg"},{"src":"http:\/\/167.86.107.132\/importProductsAuto\/images\/749bfcd4-e9bc-48b7-9d7c-35af1d3b4a34\/gallery4.jpg"},{"src":"http:\/\/167.86.107.132\/importProductsAuto\/images\/749bfcd4-e9bc-48b7-9d7c-35af1d3b4a34\/gallery1.jpg"}],"attributes":[{"id":5,"options":"multilanguage"},{"id":3,"options":"Steam"},{"id":4,"options":"WORLDWIDE"},{"id":8,"options":"3"}]}
)
</code><pre><pre><code>Automattic\WooCommerce\HttpClient\Response Object
(
[code:Automattic\WooCommerce\HttpClient\Response:private] => 0
[headers:Automattic\WooCommerce\HttpClient\Response:private] => Array
(
)
[body:Automattic\WooCommerce\HttpClient\Response:private] =>
)
</code><pre>
Alles anzeigen
Viele Produkte werden einfach nur mit dem Namen 'Product' im WooCommerce Shop angelegt ohne irgendwelche Eigenschaften, dh. Preis, Lagerbestand, Bilder, Produktbeschreibung werden nicht importiert.
Muss ich vielleicht die Uploadgröße beim Hoster vergrößern ? Oder wie löse ich das Problem am besten ?
Vielen Dank im Voraus :)