Coder Social home page Coder Social logo

Comments (11)

patrick-bigbridge avatar patrick-bigbridge commented on June 12, 2024

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.

curiousfellas avatar curiousfellas commented on June 12, 2024

Do you know about any xml feed i can import and test with my store?

from product-import.

patrick-bigbridge avatar patrick-bigbridge commented on June 12, 2024

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.

curiousfellas avatar curiousfellas commented on June 12, 2024

I mean that do you have any site from which I can import a sample feed?

Best Regards
CuriousFellas

from product-import.

patrick-bigbridge avatar patrick-bigbridge commented on June 12, 2024

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.

patrick-bigbridge avatar patrick-bigbridge commented on June 12, 2024

Can you tell me something you are trying to accomplish? That may help me give you better directions.

from product-import.

curiousfellas avatar curiousfellas commented on June 12, 2024

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.

patrick-bigbridge avatar patrick-bigbridge commented on June 12, 2024

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.

patrick-bigbridge avatar patrick-bigbridge commented on June 12, 2024

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.

patrick-bigbridge avatar patrick-bigbridge commented on June 12, 2024

This issue #27 gives you a more elaborate use.

from product-import.

patrick-bigbridge avatar patrick-bigbridge commented on June 12, 2024

Closing this issue for now. Feel free to reopen if you have further questions.

from product-import.

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.