Question

I have been following this tutorial on how to create a custom product type, but I ran into a little issue on this point:

Example/Block/Adminhtml/Catalog/Product/Edit/Tab/Event.php online 101 Minute 3.59 of the Video. I can't seem to see the whole screen any assistance will be appreciated. Thanks

Tutorial Link: https://www.youtube.com/watch?v=sIygO91ejaE

so far this is my code.

   public function getTicketData()
{
    $linkArr = array();
    $tickets = $this->getProduct()->getTypeInstance(true)->getTickets($this->getProduct());
    foreach ($tickets as $ticket){
        $tmpTicketItem = array(
            'ticket_id' => $ticket->getId(),
            'title'     => $this->escapeHtml($ticket->getTitle()),
            'price'     => $this->getCanReadPrice() ? $this->getPriceValue($ticket->getPrice()),
            'sort_order'=> $ticket->getSortOrder(),
        );
        $linkArr[] = new Varien_Object($tmpTicketItem);
    }
    return $linkArr;
}
Was it helpful?

Solution

I got this working by changing the code to this:

 public function getTicketData()
{
    $linkArr = array();
    $tickets = $this->getProduct()->getTypeInstance(true)->getTickets($this->getProduct());
    foreach ($tickets as $ticket){
        $tmpTicketItem = array(
            'ticket_id' => $ticket->getId(),
            'title'     => $this->escapeHtml($ticket->getTitle()),
            'price'     => $this->getPriceValue($ticket->getPrice()),
            'sort_order'=> $ticket->getSortOrder(),
        );
        $linkArr[] = new Varien_Object($tmpTicketItem);
    }
    return $linkArr;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top