Jump to content

Bug in the cart display, the gift product is not displayed correctly


ballashop

Recommended Posts

I try to follow Hlavtox by editing the following files:

classes/controller/FrontController.php

Find assignGeneralPurposeVariables function.

Change 

'cart' => $this->cart_presenter->present($this->context->cart)

to

'cart' => $this->cart_presenter->present($this->context->cart, true),

src/Adapter/Presenter/Cart/CartPresenter.php

Find present function.

Change

if ($shouldSeparateGifts) { $rawProducts = $cart->getProductsWithSeparatedGifts(); } else { $rawProducts = $cart->getProducts(true); }

to
$rawProducts = $cart->getProducts(true);

Add this right before return

if ($shouldSeparateGifts) { $rawProducts = $cart->getProductsWithSeparatedGifts(); $products = array_map([$this, 'presentProduct'], $rawProducts); $products = $this->addCustomizedData($products, $cart); }

the image shows the change2059078790_Schermata2021-09-22alle22_29_39.thumb.png.e24b4c3e0eccadf543a19be4b6255e5b.png

unfortunately the gift is not clear in the cart summary and in the email that the customer receives.

Thanks for any reply.

Link to comment
Share on other sites

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...