0

Using Magento v1.9.2.3

I'm working on a simple cash register written in C# and using a barcode scanner. We have already added the barcode as a new attribute to all our products.

I want to get all my products using the SOAPv2 API and save it in a local SQLite. When a barcode is scanned I can look in the database for the price. Seems simple enough.

I already figured out how to get the product data. First I use the catalogProductList to get a list of all my products. Next I use catalogProductList to get more details of a product, including the price. Using catalogProductAttributeSetList I can get all my attribute sets. Next I can get all the attributes in a set using catalogProductAttributeSetList. Now I know the attribute_id of my barcode attribute. But I can't figure out how to get the value of that attribute in my product.

I did read this Get Custom attribute in API and I truly hope I don't need to mess with Magento and PHP to get this working.

Please let me know if I can read the value of my custom attribute without messing with Magento en PHP.

  • Paul, first you use , catalogProductList and then catalogProductList ? That is twice the same call, but i think that is not what you do. Do you receive the information with, catalogProductInfo ? – Evrijn Mar 18 '18 at 12:54
  • Paul, first you use , catalogProductList and then catalogProductList ? That is twice the same call, but i think that is not what you do. Do you receive the information with, catalogProductInfo ? devdocs.magento.com/guides/m1x/api/soap/catalog/catalogProduct/…. You can add the extra attributes with; catalogProductRequestAttributes Exampe; lornajane.net/posts/2010/… – Evrijn Mar 18 '18 at 13:01
  • Thanks Evrijn for the link to the example. With it I can read my barcode: var attributes = new catalogProductRequestAttributes {additional_attributes = new[] {"barcode"}}; var productInfo = _magentoService.catalogProductInfo(_magentoLogin, _productId, null, attributes, null); Please submit as an answer and I'll mark it. – Paul Meems Mar 19 '18 at 16:46
1

The answer;

You can add extra attributrs to catalogProductInfo, http://devdocs.magento.com/guides/m1x/api/soap/catalog/catalogProduct/catalog_product.info.html

More information; https://lornajane.net/posts/2010/retrieving-product-attributes-from-magentos-v2-api

Example code for additional_attributes;

var attributes = new catalogProductRequestAttributes {additional_attributes = new[] {"barcode"}};

var productInfo = _magentoService.catalogProductInfo(_magentoLogin, _productId, null, attributes, null)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.