Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netzkollektiv/33e88d7be2724b527682ea5e9e36f9a1 to your computer and use it in GitHub Desktop.
Save netzkollektiv/33e88d7be2724b527682ea5e9e36f9a1 to your computer and use it in GitHub Desktop.
<?php
$options = $proxy->call($sessionId, 'catalog_product_attribute.options', array('23'));
foreach ($options as $opt) {
if ($opt['label'] == 'yellow') {
$color = $opt['value'];
}
}
if (!isset($color)) {
$color = $proxy->call($sessionId, 'catalog_product_attribute.addOption', array('23','yellow'));
}
$options = $proxy->call($sessionId, 'catalog_product_attribute.options', array('24'));
foreach ($options as $opt) {
if ($opt['label'] == 'XL') {
$size = $opt['value'];
}
}
if (!isset($size)) {
$size = $proxy->call($sessionId, 'catalog_product_attribute.addOption', array('24','XL'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment