Post by FIITGuy » Thu Mar 21, 2019 3:24 am

Hello,

I'm trying to make a modification in the way quantities are displayed but have encountered a problem. I've tried to pass a new parameter to the cart controller for display in the cart page and cart widget in the header but I've been unable to find where the cart controller gets it's data. I'm unable to find any model for the cart and can't find the function called getProducts() (Where it's defined and the data retrieved specified.).

Does anyone have any pointers on where to find this function so I can pass the appropriate data to the controller? Also, why the cart controller doesn't have a model? (A little weird for an MVC-L framework.)

Newbie

Posts

Joined
Mon Feb 25, 2019 3:10 am

Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by cedcommerceteam » Thu Apr 25, 2019 8:03 pm

Heyya FIITGuy,

Here's your answer!

You can see in catalog/controller/checkout/cart.php at line no .58

$products = $this->cart->getProducts();

here it get data from cart library.

you can see in startup.php the cart object is set in registry

// Cart
$this->registry->set('cart', new Cart\Cart($this->registry));

and accessible at controller as $this->cart

you can check all funtions related cart at below path

system/library/cart/cart.php

and make desired changes in data

Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm
Who is online

Users browsing this forum: by mona, stevesz, thekrotek and 8 guests