Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when I try to create configurable product. #18

Open
novapc opened this issue May 29, 2018 · 0 comments
Open

Problem when I try to create configurable product. #18

novapc opened this issue May 29, 2018 · 0 comments

Comments

@novapc
Copy link

novapc commented May 29, 2018

true, 'connection_timeout' => 86400, 'wsdl_cache' => WSDL_CACHE_NONE, ); $proxy = new SoapClient('https://www.veromotos.com.br/index.php/api/v2_soap/?wsdl=1',$options); try { echo "
";
    $sessionId = $proxy->login('example', 'example123@');
echo "
"; }catch(Exception $e) { die(var_dump($e)); } /** * Simple product #1 (sku : SKU-001) */ $productData = array( 'name' => 'Produto Simples #1', 'description' => 'Descrição do Produto Simples #1', 'short_description' => 'Descrição Curta do Produto Simples #1', 'website_ids' => array('base'), // Id or code of website 'status' => 1, // 1 = Enabled, 2 = Disabled 'visibility' => 1, // 1 = Not visible, 2 = Catalog, 3 = Search, 4 = Catalog/Search 'tax_class_id' => 2, // Default VAT 'weight' => 0, 'stock_data' => array( 'use_config_manage_stock' => 0, 'manage_stock' => 0, // We do not manage stock, for example ), 'price' => 9.90, // Same price than configurable product, no price change 'additional_attributes' => array( 'single_data' => array( array( 'key' => 'cores', 'value' => 'AMARELO', // Id or label of color, attribute that will be used to configure product ), ), ), ); $proxy->catalogProductCreate($sessionId, 'simple', 'Default', 'SKU-001', $productData); /** * Simple product #2 (sku : SKU-002) */ $productData = array( 'name' => 'Produto Simples #2', 'description' => 'Descrição do Produto Simples #2', 'short_description' => 'Descrição Curta do Produto Simples #2', 'website_ids' => array('base'), // Id or code of website 'status' => 1, // 1 = Enabled, 2 = Disabled 'visibility' => 1, // 1 = Not visible, 2 = Catalog, 3 = Search, 4 = Catalog/Search 'tax_class_id' => 2, // Default VAT 'weight' => 0, 'stock_data' => array( 'use_config_manage_stock' => 0, 'manage_stock' => 0, // We do not manage stock, for example ), 'price' => 8.90, // Red product is $1 less than configurable product 'additional_attributes' => array( 'single_data' => array( array( 'key' => 'cores', 'value' => 'AZUL', // Id or label of color, attribute that will be used to configure product ), ), ), ); // Creation of product #2 $proxy->catalogProductCreate($sessionId, 'simple', 'Default', 'SKU-002', $productData); /** * Configurable product */ $productData = array( 'name' => 'Produto Configurável', 'description' => 'Descrição do produto configurável', 'short_description' => 'Descrição curta do produto configurável', 'website_ids' => array('base'), // Id or code of website 'status' => 1, // 1 = Enabled, 2 = Disabled 'visibility' => 4, // 1 = Not visible, 2 = Catalog, 3 = Search, 4 = Catalog/Search 'tax_class_id' => 2, // Default VAT 'weight' => 0, 'stock_data' => array( 'use_config_manage_stock' => 0, 'manage_stock' => 0, // We do not manage stock, for example ), 'price' => 9.90, 'associated_skus' => array('SKU-001', 'SKU-002'), // Simple products to associate ); try { $proxy->catalogProductCreate($sessionId,'configurable','Default','Configurable Product',$productData); }catch(Exception $e) { echo "
";
    die(var_dump($e));
    echo "
"; } I'm receiving the following error: ["previous":"Exception":private]=> NULL ["faultstring"]=> string(92) "Call to undefined method Mage_Catalog_Model_Product_Attribute_Backend_Price::getAllOptions()" ["faultcode"]=> string(15) "SOAP-ENV:Server" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant