Post by drakas » Thu Mar 16, 2017 9:48 pm

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.

Newbie

Posts

Joined
Sun Mar 13, 2016 4:14 pm

Post by ADD Creative » Fri Mar 17, 2017 11:01 pm

Try $this->cart->getProducts().

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by drakas » Tue Mar 28, 2017 2:02 am

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

Newbie

Posts

Joined
Sun Mar 13, 2016 4:14 pm

Post by drakas » Tue Mar 28, 2017 2:13 am

Fatal error: Class 'Context' not found in/catalog/controller/payment/cod.php on line 5

Newbie

Posts

Joined
Sun Mar 13, 2016 4:14 pm

Post by ADD Creative » Tue Mar 28, 2017 7:16 pm

Which is line 5?

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 22 guests