I am looking to change the order in which a list is being brought together in our Magento cart.
We have the following coding:
public function getOptionList()
{
$options = false;
if (Mage::getStoreConfig('SCP_options/cart/show_custom_options')) {
$options = parent::getOptionList();
}
if (Mage::getStoreConfig('SCP_options/cart/show_config_product_options')) {
if ($this->getConfigurableProductParentId()) {
$attributes = $this->getConfigurableProductParent()
->getTypeInstance()
->getUsedProductAttributes();
foreach($attributes as $attribute) {
$options[] = array(
'label' => $attribute->getFrontendLabel(),
'value' => $this->getProduct()->getAttributeText($attribute->getAttributeCode()),
'option_id' => $attribute->getId(),
);
}
}
}
return $options;
}
Which displays the following: http://awesomescreenshot.com/053ffeie9
We are looking to swap the Attributes and Options over so the Attributes display at the top of the item.
In the coding we’ve established that the top if statement is for options and the bottom if statement is for the attributes, so theory being it should just be a case of swapping them over… unfortunately it doesn’t seem as simple as that.
If we swap them the attributes don’t show but the options do.
Would someone be able to recommend anything to try as we’re getting very frustrated trying to sort this.
swap them and then use array_merge on the bottom half. When you swap them, the second part was just assigning options and wiping out the attributes part. This puts the two together instead of overwriting: