Jump to content

Edit History

Peter_17

Peter_17

Hello,

I use html tags in a string that my module display using hookDisplayCustomization.

Prestashop 8.2.3 display this string in FO cart/order correctly.

In BO I see this string in one line with html tags like <br />.
admin/index.php/sell/orders/???/view
admin/index.php/sell/orders/carts/??/view

The problem can be solved by adding "| raw" to a twig files but it is not a safe solution.
https://github.com/PrestaShop/PrestaShop/pull/22227/commits/0ef8c5aaa5bdb574e126687834979e2b7cb75b93

How to solve this problem safe? I want to display customization in BO broken into many lines but I can't use tag <br/>.

My dh_cart_order_details.tpl file to create that string:

<div id="order_details">
    {foreach from=$order_details item=order_detail key=order_detailKey}
        {if $order_detail.do_not_display != 1}  
            {if $order_detail.main_group_id == link}
                <span>{$order_detail.value_name|unescape: "html" nofilter}</span><br />
            {else}
                <span>{$order_detail.main_group_name}: {$order_detail.value_name}</span><br />
            {/if}

        {/if}
    {/foreach}
</div> 

Anyone has an idea how to solve this problem safe? I do not want to generate an image with text to display in BO.

Peter_17

Peter_17

Hello,

I use html tags in a string that my module display using hookDisplayCustomization.

Prestashop 8.2.3 display this string in FO cart/order correctly.

In BO I see this string in one line with html tags like <br />.
admin/index.php/sell/orders/???/view
admin/index.php/sell/orders/carts/??/view

The problem can be solved by adding "| raw" to a twig files but it is not safe solution.
https://github.com/PrestaShop/PrestaShop/pull/22227/commits/0ef8c5aaa5bdb574e126687834979e2b7cb75b93

How to solve this problem safe? I want to display customization in BO broken into many lines but I can't use tag <br/>.

My dh_cart_order_details.tpl file to create that string:

<div id="order_details">
    {foreach from=$order_details item=order_detail key=order_detailKey}
        {if $order_detail.do_not_display != 1}  
            {if $order_detail.main_group_id == link}
                <span>{$order_detail.value_name|unescape: "html" nofilter}</span><br />
            {else}
                <span>{$order_detail.main_group_name}: {$order_detail.value_name}</span><br />
            {/if}

        {/if}
    {/foreach}
</div> 

Anyone has an idea how to solve this problem safe? I do not want to generate an image with text to display in BO.

×
×
  • Create New...