I created a custom attribute called validity_date and assigned it to the default product attribute set. When I create a product I have to enter some values for it. Seems all to be fine, but in the checkout process I have a function that should group the products in a specific way. The problem is that the validity_date is not delivered with the product. I wonder what I can do to get the attribute value, set to the product.
public function getProductsOrderedByValidityDate($order) { // get all products $productCollection = $order->getAllItems(); // sort all products for each day $orderProductArray = array(); foreach ($productCollection as $product) { $validityDate = $product->getData('validity_date'); Mage::log($product->debug()); if ( !array_key_exists($validityDate, $orderProductArray) ) { $orderProductArray[$validityDate] = array(); } array_push($orderProductArray[$validityDate], array( 'product' => $product->getId(), 'qty' => $product->getQtyOrdered() )); } return $orderProductArray; }