P
P
po4emu4ka20202021-04-02 14:47:59
1C-Bitrix
po4emu4ka2020, 2021-04-02 14:47:59

How to display both active orders and orders that have already been completed in the bitrix "Orders list" component (bitrix.sale.personal.order.list) at once?

Good afternoon!
Please tell me the problem.
bitrix component "List of orders" (bitrix.sale.personal.order.list).

I need to make sure that the entire history of the user's orders (both active orders and completed ones) is in one place, and even with the loading of orders via AJAX at the click of a button, if the number of orders on the page exceeds 15 pieces.

So, I have 2 questions:

1 - how can I implement the withdrawal of both active orders and those that have already been completed ?
The fact is that the component looks at the get parameter ?filter_history and displays old or active products from it. Is the only way out is to remove the condition in the component code?

2 - how can I display orders with loading via AJAX on button click? Bitrix doesn't even seem to have pagination for this component. How to be?

I would be grateful for any help, hint. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
po4emu4ka2020, 2021-05-17
@po4emu4ka2020

Ainur Valiev , Il'ia Kartovitskii , as it turned out, it is NOT necessary to customize the component for my task .
He already has everything wired up: both the display of all orders at once, and navigation.
It only remained to use it correctly.
In short, to display all orders at once, you need to use the query parameter specification before calling the component: Navigation is also relatively simple. You can specify a navigation template in the call parameters, only the "NAV_TEMPLATE" parameter is specified, and not "PAGER_TEMPLATE" as in other components. And in the template itself, navigation is displayed not using the $arResult['NAV_RESULT'] object , but using the usual output of a variable containing pagination
$_REQUEST['show_all'] = "Y";
echo($arResult['NAV_STRING']);

I
Il'ia Kartovitskii, 2021-04-26
@kartovitskii

In short, customize the component, it is advisable to make a copy of the component in the local folder and, as you wrote, delete the condition in the component code.
As an option, you fasten pagination through an ajax request and a filter on the back side, in which you specify limit and offset, you display the data received by ajax, for example, through append in each of the request result, limit and offset, each request is recalculated and moved to that count -in, how many elements you want to display by pressing one conditional button 'Show more'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question