Does anyone know a way to write and read the Customer Group Prices with API v2?
We are using a tool to integrate our financial software with Magento. Each customer has a different agreed price for products in Dynamics GP and we need to match this price in Magento. This way, when a Customer logs into the Magento site, their agreed price will be displayed in all simple products.
Magento – Use API v2 to work with Customer Group Prices
apigroup-pricemagento-1.9soap
Best Answer
I've done this for importing group prices with SOAPv2 for Magento CE 1.7.0.2 some time ago and wrote a a (german) blogpost about this (Google translate might help). I added the important parts with an english explanation here and hope this helps you getting started.
Basically you need to rewrite the
catalog/product_api_v2
model and extend the_prepareDataForSave
method.Create a new module
In my example it's Avoe_Catalog:
In
Avoe/Catalog/etc/config.xml
rewrite the Product API:Avoe/Catalog/Model/Product/Api/V2.php:
copy the
_prepareDataForSave
method fromMage_Catalog_Model_Product_Api_V2
to your new Api model:Create the following file:
Avoe/Catalog/Model/Product/Attribute/Groupprice/Api/V2.php
copied fromMage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php
:In this copied file, I've replaced all
$tierPrices
with$groupPrices
and updated checks with needed options (cust_group, price, website_id).SOAPv2 API call
You can insert group prices via SOAPv2 then the following way: