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

fix: remove deprecated array merge on smarty #766

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
{# PrestaShop Account #}
<script src="{{ urlAccountsCdn }}" rel=preload></script>
<script>
var psAccountLoaded = false;
if (window?.psaccountsVue) {
window?.psaccountsVue?.init();
{% set shop_context = shop_context|merge({'accounts_component_loaded': true}) %}
psAccountLoaded = true;
}
</script>
{% endif %}
Expand All @@ -51,6 +52,10 @@

const context = {{ shop_context|json_encode()|raw }};

if (psAccountLoaded) {
context.accounts_component_loaded = true;
}

renderModules(context, '#cdc-container')
}
</script>
Expand Down
7 changes: 6 additions & 1 deletion views/templates/hook/dashboard-zone-one.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
{if isset($urlAccountsCdn)}
<script src="{$urlAccountsCdn}" rel=preload></script>
<script>
var psAccountLoaded = false;
if (window?.psaccountsVue) {
window?.psaccountsVue?.init();
{assign shop_context $shop_context|@json_decode:true|array_merge:['accounts_component_loaded' => true]|@json_encode}
psAccountLoaded = true;
}
</script>
{/if}
Expand All @@ -57,6 +58,10 @@

const dashboardTipsAndUpdateContext = {$shop_context};

if (psAccountLoaded) {
dashboardTipsAndUpdateContext.accounts_component_loaded = true;
}

renderTipsAndUpdate(dashboardTipsAndUpdateContext, '#cdc-tips-and-update-container')
}
</script>
Expand Down