I'm not sure if this is what you need, but here is a simple extension that allows you to get the product url.
The main idea is to rewrite the info
method in the product api model and make it return the url of the product also.
For this you will need the following files:
app/etc/modules/[Namespace]_[Module].xml
- the declaration file
<?xml version="1.0"?>
<config>
<modules>
<[Namespace]_[Module]>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Catalog />
<Mage_Api />
</depends>
</[Namespace]_[Module]>
</modules>
</config>
app/code/local/[Namespace]/[Module]/etc/config.xml
- the configuration file
<?xml version="1.0"?>
<config>
<modules>
<[Namespace]_[Module]>
<version>0.0.1</version>
</[Namespace]_[Module]>
</modules>
<global>
<models>
<catalog>
<rewrite>
<product_api>[Namespace]_[Module]_Model_Product_Api</product_api>
</rewrite>
</catalog>
</models>
</global>
</config>
app/code/local/[Namespace]/[Module]/Model/Product/Api.php
- your new class
<?php
class [Namespace]_[Module]_Model_Product_Api extends Mage_Catalog_Model_Product_Api {
public function info($productId, $store = null, $attributes = null, $identifierType = null){
$product = $this->_getProduct($productId, $store, $identifierType);
$result = parent::info($productId, $store = null, $attributes = null, $identifierType = null);
//add a new element in here called product_url. You can even wrap it in some condition to see if the product is assigned to the current website or if the product is enabled or visible. ($product->getWebsiteIds(), $product->getStatus(), $product->getVisibility()).
$result['product_url'] = $product->getUrlInStore($store);
return $result;
}
}
Note: This works only for API V1. In order to make it work for v2 you need to add a wsdl to your module. See how you can do it.
For add to cart of configurable product,you need to super attribute value. in my below if only one super attribute so
in super_attribute i have set one value
$quoteId = $client->call( $session, 'cart.create',array( 'default' ));
$arrProducts = array(
array(
"product_id" =>"21",
"qty" => 2,
"super_attribute" => array(
92 => 162
)
)
);
$resultCartProductAdd = $client->call(
$sessionId,
"cart_product.add",
array(
$quoteId,
$arrProducts
)
);
here 92 is attribute id and 162 it option id
if you have more then one variance for then
"super_attribute" => array(
first_attribute_id => first_chose_option_value
seocnd_attribute_id => seocnd_chose_option_value.
.....
)
Best Answer
The SOAP V2 API does not allow you to do that.
You can do that in V1 through the method
multiCall
. This allows you to send an array of calls to be made at once.Here is a small example. Sorry it's PHP. I don't have one for .NET
Unfortunately the V1 API is ugly and not that developer friendly.