2

because of the fact, that Magento2 is using the word "item" in all pager views, I have the problem because of the translation. In category view, I want to translate it as "Artikel", but in the user account list of orders, I do want to have the translation "Bestellungen" and not "Artikel".

Therefore, I thought to override the pager.phtnl template file depending on which site it is used. But no way I found on the internet worked.

Unfortunately, as with many other blocks the definition of a template file like:

<block class="Magento\Theme\Block\Html\Pager" name="sales_order_item_pager" template="Magento_Theme::html/pagertest.phtml"/>

in sales_order.view.xml is not working. It is still using pager.phtml defined int Magento_Theme/templates/html

Does anybody have an idea how to get this working?

As I said doing it with my own module did not work. I tried a couple of suggestions.

Hopefully, somebody does have an answer.

By the way, I am working with Magento 2.3.3

Regards, Chequille

3
  • 1
    is it typo: sales_order.view.xml?
    – Sohel Rana
    Commented Jan 8, 2020 at 4:15
  • yes, it is. of course sales_order_view.xml
    – Chequille
    Commented Jan 8, 2020 at 7:38
  • Hi @Chequille, if you fix the problem, can you add the fix ? I am facing the same thing :) Thanks Commented Jul 8, 2021 at 7:02

1 Answer 1

1

A simple fix that could work is to check the "full action name" in the pager.phtml file , by doing the following, for example for the product page:

<?php if ((string) $block->getRequest()->getFullActionName() === 'catalog_product_view') : ?>
// do you custom part
<?php else: ?>
// leave default magento
<?php endif ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.