Skip to content

Instantly share code, notes, and snippets.

@unlocomqx
Last active April 7, 2021 09:27
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 unlocomqx/424bea75315023e0e5747c7ad7b5ffe5 to your computer and use it in GitHub Desktop.
Save unlocomqx/424bea75315023e0e5747c7ad7b5ffe5 to your computer and use it in GitHub Desktop.
<?php
$combination = new Combination($id_attribute);
$attributes = array();
$attributes_str = '';
if (Validate::isLoadedObject($combination)) {
$attributes_names = $combination->getAttributesName(Context::getContext()->language->id);
if (is_array($attributes_names)) {
foreach ($attributes_names as $attributes_name) {
$attributes[] = $attributes_name['name'];
}
}
$attributes_str = implode('-', $attributes);
}
$attribute = $id_product.'-'.$attributes_str;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment