Page 1 of 1

cod product data from cart

Posted: Thu Mar 16, 2017 9:48 pm
by drakas
how to access product data from cart in cod.php model?
$this->product_info['my_data'] doesnt work,
i created that input my_data in db and changing using admin products data tab do i need to add something to controller?
what i'm trying to do is when my_data is set in at least one product in the cart cod should be restricted.

Re: cod product data from cart

Posted: Fri Mar 17, 2017 11:01 pm
by ADD Creative
Try $this->cart->getProducts().

Re: cod product data from cart

Posted: Tue Mar 28, 2017 2:02 am
by drakas
I do:
foreach($this->cart->getProducts() as $product) {
$this->load->model('catalog/product');
$product_info = $this->model_catalog_product->getProduct($product['product_id']);
if($product_info['my_data']=='1') return;
}
But when i try to check cash on delivery where $product_info['my_data']==0 i get an error: SyntaxError: Unexpected token < in JSON at position

Re: cod product data from cart

Posted: Tue Mar 28, 2017 2:13 am
by drakas
Fatal error: Class 'Context' not found in/catalog/controller/payment/cod.php on line 5

Re: cod product data from cart

Posted: Tue Mar 28, 2017 7:16 pm
by ADD Creative
Which is line 5?