I'm trying to get the names of products that are in checkout process. For example: a user is about to confirm that he wants to buy product1 and product2; so I need to store only the name of the products in a variable and invoke it in a paymentcontroller class. I actually know how to do this echo'in it in a tpl file, but when i try to use the same code to invoke it in the controller class, it sends error.
To get product names I'm using this array in a PaymentController class
Code: Select all
$products = $this->cart->getProducts();
foreach ($products as $product) {
$this->data['nameproducts'][] = array(
'name' => $product['name']
);
}
Code: Select all
$this->data['productnames'] = implode(', ', $nameproducts);
$this->data['action'] = "https://domain.com/LinkDeamon.cfm?total=".$this->data['total']."&description=".$this->data['productnames'];