Skip to content
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

Add template country global vars #29707

Merged
merged 3 commits into from Oct 19, 2022

Conversation

PululuK
Copy link
Member

@PululuK PululuK commented Sep 20, 2022

Questions Answers
Branch? develop
Description? Add template country global vars.
Type? improvement
Category? CO
BC breaks? no
Deprecations? no
Fixed ticket? N/A
Related PRs N/A
How to test? smarty var_dump($country)
Possible impacts? N/A

@PululuK PululuK requested a review from a team as a code owner September 20, 2022 14:31
@prestonBot prestonBot added develop Branch Improvement Type: Improvement labels Sep 20, 2022
Copy link
Contributor

@PrestaEdit PrestaEdit left a comment

Choose a reason for hiding this comment

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

$this->objectPresenter->present($this->context->country)

classes/controller/FrontController.php Outdated Show resolved Hide resolved
Co-authored-by: Jonathan Danse <j.danse@prestaedit.com>
Copy link
Contributor

@matks matks left a comment

Choose a reason for hiding this comment

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

Makes sense for me 👍

Do you have a specific usecase in mind?

@Hlavtox
Copy link
Contributor

Hlavtox commented Sep 22, 2022

Do you have a specific usecase in mind?

It's good to have everything ready in a template. ;-)

@matks
Copy link
Contributor

matks commented Oct 5, 2022

Do you have a specific usecase in mind?

It's good to have everything ready in a template. ;-)

They say "don't be afraid of asking questions" so ... I might have missed the joke 😅 but what do you mean?

@ghost ghost added the Waiting for QA Status: action required, waiting for test feedback label Oct 11, 2022
@ghost ghost added this to the 8.1.0 milestone Oct 11, 2022
@florine2623 florine2623 self-assigned this Oct 18, 2022
Copy link
Contributor

@florine2623 florine2623 left a comment

Choose a reason for hiding this comment

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

Hello @PululuK ,

I think I'm testing it wrong. Could you confirm a way to test it?

Here's what I'm doing, in develop/themes/classic/templates/cms/stores.tpl I added {$country} but the result is not as expected:
Screenshot 2022-10-18 at 11 31 29

Tested with other global vars, same thing. In fact, I know I'm not testing it right 😅

Waiting for your answer :)
Thanks!

@florine2623 florine2623 added the Waiting for author Status: action required, waiting for author feedback label Oct 18, 2022
Copy link
Contributor

@florine2623 florine2623 left a comment

Choose a reason for hiding this comment

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

Hello again,

Tested again with @Hlavtox 's tips! 😉

I can access the variable easily just by {dump($country)} or adding {$country.name}.
Info was added in MY_SHOP/themes/classic/templates/cms/stores.tpl
Screenshot 2022-10-18 at 16 00 49
Screenshot 2022-10-18 at 16 04 09

Works like a charm.
It is QA ✅ !

@florine2623 florine2623 added QA ✔️ Status: check done, code approved and removed Waiting for author Status: action required, waiting for author feedback Waiting for QA Status: action required, waiting for test feedback labels Oct 18, 2022
@matks
Copy link
Contributor

matks commented Oct 19, 2022

Thank you @PululuK and @florine2623

@matks matks merged commit 54a615c into PrestaShop:develop Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
develop Branch Improvement Type: Improvement QA ✔️ Status: check done, code approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants