Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Don Bosco van Hoi
    @azngeek
    I guess it is creating attributes/categories and options, then create configurable products, create configurable product options, then variants, assign them etc.
    i am used to the Magento-World so using that terms :)
    Mike Wink
    @mikewink
    @azngeek welcome to the SW community!
    Don Bosco van Hoi
    @azngeek
    Thanks :)
    What is your experience so far with the api-based import? I need to import like 10k products and a couple of different product options.
    Mike Wink
    @mikewink
    @azngeek well, that's a interesting task for sure. Here is what I do/did. I created myself a nice little HTTP client with Symfony HTTP Client (Guzzle would work too). Next I use the administration to see the API usage for what I want to do in code. Check the network tab in your dev tools for the requests and responses.
    pawonpawon
    @pawonpawon

    @azngeek I am also Migrating from Magento. Be aware that in Magento we have "product attributes" and in Shopware we have "properties" and "custom fields".

    Probably you will want to split the Magento product attributes and transform some into properties and some into custom fields !

    Mike Wink
    @mikewink
    Once I see the way SW 6 does it I use that as a blueprint for my own code (requests with payload).
    Don Bosco van Hoi
    @azngeek
    What is the difference between a property and a custom field? I expected something "similar" to the EAV-structure. I guess i am wrong :)
    pawonpawon
    @pawonpawon
    @mikewink @azngeek I did/do exactly the same thing. I get the product data from a custom script in Magento (foreach on Mage::getModel('catalog/product'->getCollection() ) . Transform it to a SW json object and post it to the products endpoint
    Don Bosco van Hoi
    @azngeek
    @pawonpawon The thing is that i thought that there was something like an API-Import-layer which could be used. I did not know that i need to extend or write an additional client.
    pawonpawon
    @pawonpawon

    @azngeek read these:
    https://docs.shopware.com/en/shopware-6-en/products/properties
    and
    https://docs.shopware.com/en/shopware-6-en/settings/custom-fields

    It took me some days of messing around before I noticed this is not the same as in magento

    Mike Wink
    @mikewink
    @azngeek The interesting part is how to orchestrate the individual steps and if you want to use the Sync API for some of the steps.
    pawonpawon
    @pawonpawon

    @azngeek Well, you could use the Magento Importer plugin from SW.

    It works but it dumps all magento product attributes as 'custom fields' I believe and it needs some tweaking depending on the source data. For me, it was in the end easier to build a 'bridge' and use the api

    Don Bosco van Hoi
    @azngeek
    i have an existing data-integration layer based an Apache NiFi which i could easily extend to connect it to shopware. The question is: Do i need to write my own import-api for the product import or can i reuse the existing sync api for all tasks?
    pawonpawon
    @pawonpawon
    you can use the SW sync api since (as far as I know) is just a wrapper around the various admin endpoints but allows multiple create/updates in one go
    Don Bosco van Hoi
    @azngeek
    The Magento Importer is not suitable in mid term as we need to sync the data between erp and shop.
    henrikvolmer
    @henrikvolmer
    Is there a way to always display the cheapest variant on the product lists?
    pawonpawon
    @pawonpawon
    posting product data on the API is relatively straight forward. The fun starts when importing old orders :)
    Mike Wink
    @mikewink
    @henrikvolmer with custom code for sure ;)
    @pawonpawon did you import products with media and variants?
    pawonpawon
    @pawonpawon
    variants: no
    media: yes
    Don Bosco van Hoi
    @azngeek
    @pawonpawon So if i take a look at this documentation i can not find an example about how the payload needs to look like. Where did you get that information?
    pawonpawon
    @pawonpawon
    @azngeek I just hit F12 in the admin and log the requests
    henrikvolmer
    @henrikvolmer
    @mikewink Yes, but then I would always have to load all variants and there are about 500 variants per master :/
    Mike Wink
    @mikewink
    @pawonpawon yes, then it's rather simple. 😅
    Don Bosco van Hoi
    @azngeek
    @pawonpawon i guess this is the "best practice" :)
    Mike Wink
    @mikewink
    @henrikvolmer do you import your products (variants)?
    @azngeek You would see the payload format when you do check the network request in your browser or check the Swagger UI (if that still works in 6.2).
    henrikvolmer
    @henrikvolmer
    Yes, they will imported by an erp system, but the system can't do it "on the fly"
    Mike Wink
    @mikewink
    it = Shopware showing the cheapest of them all? Are there rules that alter prices after import?
    Don Bosco van Hoi
    @azngeek
    @mikewink So you mean. If i create the products in the admin-menu manually i need to log all the requests from the network tab and just replay it in postman etc.
    pawonpawon
    @pawonpawon
    @azngeek yes
    Mike Wink
    @mikewink
    @azngeek yes you can just see what Shopware does (eat your own dog food). It has to use the same API like you so why not see what SW does. Start simple. Add a product with the minimum values and go from there.
    50 replies
    Don Bosco van Hoi
    @azngeek
    @mikewink @pawonpawon Yeah. That is useful information. I will do it that way. For any reason i thought i could do it the easy way :)
    henrikvolmer
    @henrikvolmer
    There are no custom rules that adjust the prices afterwards. But because shopware displays a random variant of a master on product lists, this is not always the cheapest
    pawonpawon
    @pawonpawon
    @azngeek I have started a thread under @mikewink post
    Mike Wink
    @mikewink
    No it does not in 6.2 anymore. You can set the default variant now!
    @henrikvolmer so we set the default variant during import
    henrikvolmer
    @henrikvolmer
    Ah okay... I didn't know that feature. I'll try that. Thanks for the help
    Mike Wink
    @mikewink
    @henrikvolmer you're welcome.
    aleckscastro
    @aleckscastro
    @pawonpawon @mikewink You guys should definitely work on WMS / ERP solutions for Shopware 6!
    Mike Wink
    @mikewink
    I do, poormens version called Airtable. 😅
    pawonpawon
    @pawonpawon
    image.png
    I went a bit overboard .. this is my sync app now
    Mike Wink
    @mikewink
    @pawonpawon Niiiice! 🏆
    pawonpawon
    @pawonpawon
    @mikewink thnx :)
    Mike Wink
    @mikewink
    See, with Airtable I get the UI for free and my Excel loving customers can work in their well known and understood data table mindset.
    Don Bosco van Hoi
    @azngeek
    I do not trust anything without schema validation :)
    Mike Wink
    @mikewink
    But I plan to bring them over to a EasyAdmin 3 backend once it's is released. I was thinking Laravel Nova first, but why switch "system" when EA can do the things I need as well.