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.
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
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
Who is online
Users browsing this forum: No registered users and 22 guests