Guest User

Untitled

a guest
Mar 22nd, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. $productAttributeOptions = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);
  2. $attributeOptions = array();
  3. foreach ($productAttributeOptions as $productAttribute) {
  4. foreach ($productAttribute['values'] as $attribute) {
  5. $attributeOptions[$productAttribute['label']][$attribute['value_index']] = $attribute['store_label'];
  6. }
  7. }
  8.  
  9. $attributeOptions = array(
  10. 'Color' => array(
  11. 1 => 'Green',
  12. 2 => 'Orange',
  13. ...
  14. ),
  15. 'Size' => array(
  16. 6 => 'L',
  17. 7 => 'XL',
  18. ...
  19. ),
  20. );
Add Comment
Please, Sign In to add comment