How to pull custom product attribute using SOAP API in Magento

When extracting a product attribute data using SOAP, the usual approach is to create a standard class and identify the common fields in the attributes property as shown below:

$proxy = new SoapClient('http://your.magento.domain/api/v2_soap/?wsdl');
$sessionId = $proxy->login('username', 'password!');
$product = new stdclass();
$product->attributes = array(
     'description',
     'short_description',
     'price',
     'custom_attribute_code'
);
$data = $proxy->catalogProductInfo($sessionId, $sku, null, $product);
var_dump($data);

The above var_dump() would show the values of requested fields except the custom_attribute_code. The reason for this is because a custom product attribute is available in additional_attributes property instead.

Get custom product attribute:

To get the value of custom_attribute_code, use the following code:

$proxy = new SoapClient('http://your.magento.domain/api/v2_soap/?wsdl');
$sessionId = $proxy->login('username', 'password!');
$product = new stdClass();
$product->additional_attributes = array('custom_attribute_code');
$data = $proxy->catalogProductInfo($sessionId, $sku, null, $product);

Keep line breaks, custom HTML attributes and remove initial paragraph tag in Magento Admin’s TinyMCE editor

One of my clients would like to add additional HTML attributes for SEO purposes as well as to keep line breaks after saving a CMS block or page in the Magento Admin.

Solution:

To do that, you must open the file js/mage/adminhtml/wysiwyg/tiny_mce/setup.js and locate the line below:

var settings = {

Right after the code plugins : plugins, add the lines highlighted in grey:

        var settings = {
            mode : (mode != undefined ? mode : 'none'),
            elements : this.id,
            theme : 'advanced',
            plugins : plugins,
            forced_root_block: false,
            extended_valid_elements: '+ul[*],+li[*],+p[*],+span[*],+div[*],+a[*]',
            remove_linebreaks : false,
            theme_advanced_buttons1 : magentoPlugins ...

Save the file and clear your cache to apply the changes.