Example #1
0
            $result = $proxy->call($sessionId, $variation['vovariationid'], "product_attribute.update", array($attributeToUpdate));
        }
    }
    public function deleteAttribute()
    {
        $proxy = new SoapClient('http://dev.doability.co.uk/api/soap/?wsdl');
        $sessionId = $proxy->login('vikas', 'w3sols!@#');
        $prepare = $this->conInterspire->prepare("\n        SELECT distinct magentoattributeid FROM `isc_product_variation_options`   where magentoattributeid!=0 \n        limit 100\n        ");
        $prepare->execute();
        $variations = $prepare->fetchAll(PDO::FETCH_ASSOC);
        foreach ($variations as $variation) {
            $attributeCode = $variation['magentoattributeid'];
            try {
                $result = $proxy->call($sessionId, "product_attribute.remove", array($attributeCode));
                $prepare = $this->conInterspire->prepare("\n                update `isc_product_variation_options` set magentoattributeid=0 where magentoattributeid='" . $attributeCode . "'\n                ");
                $prepare->execute();
            } catch (exception $e) {
                echo $e->getMessage() . ' ' . $attributeCode;
                $prepare = $this->conInterspire->prepare("\n                update `isc_product_variation_options` set magentoattributeid=0 where magentoattributeid='" . $attributeCode . "'\n                ");
                $prepare->execute();
            }
        }
    }
}
$obj = new Variations();
//$obj->AddAttributeSets();
// $obj->AddAttributes();
//$obj->AddAttributesToSets();
$obj->AddVariationOptions();
//$obj->deleteAttribute();
//$obj->UpdateAttributes();