Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

PrestaShop 1.7 compatibility #17

Closed
wants to merge 1 commit into from
Closed

Conversation

firstred
Copy link
Contributor

@firstred firstred commented Oct 31, 2018

No description provided.


$cart = $this->context->cart;
if (!$cart->id_carrier) {
die(json_encode(['success' => false]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use ajaxRender instead die?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not only because of hook and even if you never use something that doesn't mean nobody is using it :).
die should never be used in MVC / MOVE context. You can break an other module, some sql requests, or anything (maybe the Symfony Framework) because you instantly stop the process without be sure a rollback isn't needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PierreRambaud, if we replace die with ajaxRender, we break the compatibility with old versions of PrestaShop. I'd keep them here.

@firstred firstred closed this Nov 12, 2018
@firstred firstred deleted the ps17 branch November 13, 2018 13:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants