Jump to content

Absent [is_gift] value in cart.product array !? 1.7.6.5


karimaotmari

Recommended Posts

While developing a new Theme for a customer, we reached the cart-detailed-product-line.tpl which is part of the Cart.tpl template used to display everything related to customer cart.

the default classic template is using a $product.is_gift value that does not get presented with CartPresenter.php file

after diving deep into the code we found that CartController.php calls Present() function of the CartPresenter.php class

         like this $presented_cart = $presenter->present($this->context->cart, $shouldSeparateGifts = true);

Even though the $shouldSeparateGifts is set to TRUE

the final product list does not get separated and we have no [is_gift] value to work with

the change occurs exactly at this line of the CartPresenter.php class in presentProduct() function

        $products = array_map(array($this, 'presentProduct'), $rawProducts);

Where the so called ($rawProduct) initial product array is turned into a ProductListingLazyArray ($products)

resulting in products in cart not getting separated (those added manually by customers and those given away as gifts by cart rules)

i cant find anything related to this issue as a setting in the backoffice.

am i missing something ?

please help

thank you.

Link to comment
Share on other sites

  • 5 months later...
  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...