views:

256

answers:

3

i am having problems with retrieving my products, in 1.3 it worked and i just added some products on 1.4 but there is a new function in the capalogProductInfo called the product identifier, i don't know what to put in there, i tried passing down product type form list but i keep getting a error that says that the product does not exit.

can anyone help?

catalogProductInfo(sessionId, Product_id, CurrentStore, attributes, productIdentifierType)
A: 

If you are talking about the Magento API Catalog Product Info, that function requieres 3 arguments

  • mixed product - product ID or Sku
  • mixed storeView - store view ID or code (optional)
  • array attributes - list of attributes that will be loaded (optional)

The 1.4 version seems to work the same way. Try to debug this class Mage_Catalog_Model_Product_Api_V2

/**
 * Retrieve product info
 *
 * @param int|string $productId
 * @param string|int $store
 * @param stdClass $attributes
 * @return array
 */
public function info($productId, $store = null, $attributes = null, $identifierType = null){}
Elzo Valugi
oh i used the null and it works lol, my bad, but if it has a null value, y bother putting in a argument, what is it s purpose?
Shane van Wyk
you have to use it otherwise the function will not receive the number parameters that are expected. Check example 5 from the documentation to understand better why the params should be there. http://www.php.net/manual/en/functions.arguments.php
Elzo Valugi
+1  A: 

Before I defined the attributes I wanted back, I kept getting the same error (product does not exit):

catalogProductRequestAttributes attrib = new catalogProductRequestAttributes();
attrib.attributes = new string[] { "description", "name" };

catalogProductInfo(sessionId, Product_sku, CurrentStore, attrib, null)

Don't know about the productIdentifierType, but booth null and "sku" worked for me.

Trond
A: 

i have a same issue, then i try null with identifier type, it's work fine. Thanks

robert