Back to Top

Modify Cart Presenter In PrestaShop

Updated 30 August 2024

In this blog, we will learn how to modify the Cart Presenter values.

So let’s see together how to do that with PrestaShop.

Sometimes, we need to modify the cart presenter according to our needs.

Thanks to the available hooks, Prestashop gives a hook actionPresentCart

We will register this hook in the module.

Searching for an experienced
Prestashop Company ?
Find out More
$this->registerHook(
    [
        'actionPresentCart',
    ]
);

Now see below, The customer can add a promo code to get a discount

Showing promo button

We can remove this apply promo code section using the PresentCart hook, see the below code

public function hookActionPresentCart($params)
    {
        $params['presentedCart']['vouchers']['allowed'] = 0;

    }

We have overridden the voucher-allowed value and the customer can not apply the vouchers, see below

prom removed

We can also override the Minimum purchase total required to validate the order.

Suppose the minimum purchase condition is 50 INR then the Customer can not place an order until the cart total has reached 50 INR and the customer will get the below screen

minimum purchase

Now, we will add the below line code to override it in the PresentCart hook

$params['presentedCart']['minimalPurchase'] = 0.0;
$params['presentedCart']['minimalPurchaseRequired'] = '';

You will see, that the minimum purchase condition is removed.

Minimum purchase removed

Like this, we can modify the all below values of Cart Presenter according to our needs.

all values

That’s all about this blog. Hope it will help you.

If you are facing any issues or doubts in the above process, please feel free to contact us in the comment section.

We would be happy to help.

Also, you can explore our PrestaShop Development Services & a large range of quality PrestaShop Modules.

For any doubt contact us at support@webkul.com.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home