Comments (11)
Hello @curiousfellas
You can find a small PHP example in the integration tests:
https://github.com/bigbridge-nl/product-import/blob/master/Test/ApiFunctional/RestApiTest.php
Example xml payloads are in the doc/example directory.
from product-import.
Do you know about any xml feed i can import and test with my store?
from product-import.
I have placed several types of feeds in the example directory
https://github.com/bigbridge-nl/product-import/tree/master/doc/example
Here's "a-basic-product.xml"
<?xml version="1.0" encoding="UTF-8"?>
<import>
<simple sku="skinny-jeans-811">
<attribute_set_name>Default</attribute_set_name>
<global>
<name>Skinny Jeans 811</name>
<price>19.95</price>
<status>1</status>
<visibility>4</visibility>
<tax_class_name>Taxable Goods</tax_class_name>
<generate_url_key>1</generate_url_key>
</global>
<store_view code="default">
<price>19.75</price>
</store_view>
<category_global_names>
<item>Default Category/Trousers</item>
<item>Default Category/Trendy</item>
</category_global_names>
<website_codes>
<item>base</item>
</website_codes>
<stock>
<qty>12</qty>
<is_in_stock>1</is_in_stock>
</stock>
</simple>
</import>
from product-import.
I mean that do you have any site from which I can import a sample feed?
Best Regards
CuriousFellas
from product-import.
Ah, no, these feeds are not exported by any system. They must be created by a programmer.
This product importer helps a programmer who wishes to import many products quickly. The feeds need to be produced by hand, though.
from product-import.
Can you tell me something you are trying to accomplish? That may help me give you better directions.
from product-import.
I have this third party website like techdata and i have a to send a post request to their specified url with xml payload and then in the response they will send me a xml response. I need to parse that response and import the products provided with the response received by magento site.
from product-import.
Ok, in that case you may just want to use the library of the importer. Read the products from the xml and import them with code like this
$importer = $factory->createImporter($config);
foreach ($lines as $i => $line) {
$product = new SimpleProduct($line[1]);
// global eav attributes
$global = $product->global();
$global->setName($line[0]);
$global->setPrice($line[2]);
// German eav attributes
$german = $product->storeView('de_store');
$german->setName($line[3]);
$german->setPrice($line[4]);
$importer->importSimpleProduct($product);
}
// process any remaining products in the pipeline
$importer->flush();
from product-import.
What you're describing is a classic use case of the library: you need to import products from an external system with a custom feed-layout and you need it done simple and quick.
from product-import.
This issue #27 gives you a more elaborate use.
from product-import.
Closing this issue for now. Feel free to reopen if you have further questions.
from product-import.
Related Issues (20)
- website_codes restapi HOT 4
- How to use the programming library to import products HOT 3
- Restapi update url issue HOT 15
- Category flat url structure HOT 9
- Image import creates hardlinks HOT 9
- Saving product on storeview scope overwrites storeview attribute values with global values HOT 4
- How to set salable quantity ? HOT 5
- Export category attribute values HOT 2
- Trying to get property 'path' of non-object in Model/Resource/Storage/UrlRewriteStorage.php on line 376 HOT 1
- How to set out of stock threshold for backorders ? HOT 4
- Importing library fails after clearing all products HOT 1
- The setSelectAttribute method does not fill swatch input on Text Swatch HOT 3
- Module shouldn't rely on magento2-base package to exist HOT 3
- Fetching Magento configurations isn't working as expected HOT 3
- Generated Url key already exists HOT 1
- Clear Cache after change per product ID HOT 1
- PHP 8 Compatibility HOT 1
- Choose Affected Attribute Set prompt when saving configurable product
- Can't set is_in_stock = 0 HOT 1
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 product-import.