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/4d41fd209efab198b90a0ef97736a108 to your computer and use it in GitHub Desktop.
Save netzkollektiv/4d41fd209efab198b90a0ef97736a108 to your computer and use it in GitHub Desktop.
<?php
$options = $proxy->catalogProductAttributeOptions($sessionId, '23');
foreach ($options as $opt) {
if ($opt['label'] == 'yellow') {
$color = $opt['value'];
}
}
if (!isset($color)) {
$color = $proxy->catalogProductAttributeAddOption('23','yellow');
}
$options = $proxy->catalogProductAttributeOptions('24');
foreach ($options as $opt) {
if ($opt['label'] == 'XL') {
$size = $opt['value'];
}
}
if (!isset($size)) {
$size = $proxy->catalogProductAttributeAddOption('24','XL');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment