Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>Magento Product api does not provide such functionality</h2> <p>Although there are easy ways to extend specific API in custom modules, but here is the quickest way if you don't want to write a custom module ( as i think it's difficult for a new magento developer).</p> <p>Copy the original product API-class from the <code>core</code> to the <code>local</code> folder before editing anything (that way your Magento installation stays "update-save").</p> <ul> <li>copy Api.php from:<br /><code>app/code/core/Mage/Catalog/Model/Product/Api.php</code></li> <li>to:<br /><code>app/code/local/Mage/Catalog/Model/Product/Api.php</code></li> </ul> <p>Now change the <code>info</code> method within the copied file to include the <code>full_url</code>. Add the following line to the <code>$result</code>-array. (Make sure to set necessary commas at the end of the array-lines.)</p> <pre><code>'full_url' =&gt; $product-&gt;getProductUrl(), </code></pre> <p>Your resulting method code should look like:</p> <pre><code>public function info($productId, $store = null, $attributes = null, $identifierType = null) { $product = $this-&gt;_getProduct($productId, $store, $identifierType); $result = array( // Basic product data 'product_id' =&gt; $product-&gt;getId(), 'sku' =&gt; $product-&gt;getSku(), 'set' =&gt; $product-&gt;getAttributeSetId(), 'type' =&gt; $product-&gt;getTypeId(), 'categories' =&gt; $product-&gt;getCategoryIds(), 'websites' =&gt; $product-&gt;getWebsiteIds(), 'full_url' =&gt; $product-&gt;getProductUrl(), ); foreach ($product-&gt;getTypeInstance(true)-&gt;getEditableAttributes($product) as $attribute) { if ($this-&gt;_isAllowedAttribute($attribute, $attributes)) { $result[$attribute-&gt;getAttributeCode()] = $product-&gt;getData( $attribute-&gt;getAttributeCode()); } } return $result; } </code></pre> <p>Afterwards you can call <code>product.info</code> and use the <code>full_url</code> field via the API.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload