New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check smarty name #11

Merged
merged 1 commit into from Jan 9, 2019

Conversation

Projects
None yet
3 participants
@matthieumota
Copy link
Contributor

matthieumota commented Nov 17, 2018

There is a little typo on smarty name for check part.

@Scritik

Scritik approved these changes Jan 9, 2019

@Scritik Scritik merged commit c95cd01 into PrestaShop:master Jan 9, 2019

Scritik added a commit that referenced this pull request Jan 9, 2019

Fix check smarty name (#11)
There is a little typo on smarty name for check part.

Scritik added a commit that referenced this pull request Jan 9, 2019

Fix check smarty name (#11)
There is a little typo on smarty name for check part.
@dvitcompte

This comment has been minimized.

Copy link
Contributor

dvitcompte commented Jan 9, 2019

Hello,
the problem is that in PS1.6 the mail var is 'cheque_name' but in PS1.7 the mail var was changed to 'check_name'.
So depending on the PS version you want to generate your template the cheque mail will be wrong.
I used a existing ps1.7 specific var to check the PS version but maybe there is a better solution ?
Regards,

@Scritik

This comment has been minimized.

Copy link
Collaborator

Scritik commented Jan 10, 2019

Hi,

Yes you are right.
I think that the best solution is to revert this commit and for the 1.7 versions, we should add the two variables in:

https://github.com/PrestaShop/ps_emailsmanager/blob/master/ps_emailsmanager.php#L90

This way, we keep the old names for the 1.6 versions.

@dvitcompte

This comment has been minimized.

Copy link
Contributor

dvitcompte commented Jan 10, 2019

Yes, here my working update for PrestaShop 1.7 ps_emailsmanager module cheque>check typo :

public function hookActionGetExtraMailTemplateVars($params)
{
    if (version_compare(_PS_VERSION_, '1.7', '>=') && $params['template'] == 'cheque') {
        $params['extra_template_vars']['{cheque_name}'] = $params['template_vars']['{check_name}'];
        $params['extra_template_vars']['{cheque_address_html}'] = $params['template_vars']['{check_address_html}'];
    }
    $params['extra_template_vars']['{passwd}'] = '*********';
}
@Scritik

This comment has been minimized.

Copy link
Collaborator

Scritik commented Jan 10, 2019

Looks good to me, can you make a PR so I can make a test on my side? Thanks.

@Scritik Scritik referenced this pull request Jan 10, 2019

Open

Revert check vars #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment