Product Tier Price API

Last modified by koopkoop2 on Tue, March 3, 2009 18:55
Source|Old Revisions  

This is an old revision of the document!


Allows to import/export product tier prices.

Module: Mage_Catalog

Resource: catalog_product_attribute_tier_price

Aliases:

  • product_attribute_tier_price
  • product_tier_price

Methods

catalog_product_attribute_tier_price.info

Retrieve product tier prices

Return: array - array of tier prices array(array(’website’ ⇒ ..., ‘customer_group_id’ ⇒ ..., ‘qty’ ⇒ ..., ‘price’ ⇒ ...))

Arguments:

  • mixed product - product ID or Sku

Aliases:

  • product_attribute_tier_price.info
  • product_tier_price.info

catalog_product_attribute_tier_price.update

Update product tier prices

Return: boolean

Arguments:

  • mixed product - product ID or Sku
  • array tierPrices - array of tier prices array(array(’website’ ⇒ ..., ‘customer_group_id’ ⇒ ..., ‘qty’ ⇒ ..., ‘price’ ⇒ ...))

Aliases:

  • product_attribute_tier_price.update
  • product_tier_price.update

Faults

Fault Code Fault Message
100 Product not exists.
101 Invalid data given. Details in error message.
102 Tier prices not updated. Details in error message.

Examples

  1. $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
  2. $sessionId = $proxy->login('apiUser', 'apiKey');
  3.  
  4. // Get tier prices
  5. $tierPrices = $proxy->call($sessionId, 'product_tier_price.info', 'Sku');
  6.  
  7. var_dump($tierPrices);
  8.  
  9. // Add new
  10. $tierPrices[] = array(
  11.     'website'           => 'all',
  12.     'customer_group_id' => 'all',
  13.     'qty'               => 68,
  14.     'price'             => 18.20
  15. );
  16.  
  17. // Update tier prices
  18. $proxy->call($sessionId, 'product_tier_price.update', array('Sku', array($tierPrices)));
  19.  
  20. // Compare values
  21. var_dump($proxy->call($sessionId, 'product_tier_price.info', 'Sku'));
  22.  
  23. var_dump($tierPrices);



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs