Low ReOrder not working ajax pagination
Hi ya,
I was wondering if you might be able to help. I am having an issue getting Low ReOrder to play nice with some ajax pagination.
It is working on the pages that use the fallback="yes". On pages that are being re-ordered, I am getting a duplication on the first entry in the re-ordered list.
{exp:low_reorder:entries set="{exp:stash:get name='reorder_set'}"
channel="products"
limit="1"
paginate="bottom"
dynamic="no"
entry_id="{exp:stash:get name='e_ids'}"
fallback="yes"
force_set_params="yes"
parse="inward"
}
{sn_product_list}
{exp:stash:get name='reorder_set'} - Is being pulled through without a problem.
I hope you can help!
Cheers
Replies
Low 23 Oct 2012 14:14
Hi!
Using tags as parameter input is not recommended from a parse order point of view. Results are always flakey.
If you turn on template debugging and look up the low_reorder:entries tag mentioned there (they look like Tag: {exp:low_reorder:entries...) as well as the lines starting with Low Reorder -- what does that tell you?
aurorameida 23 Oct 2012 14:53
Yeah, I'm not keen. I can't think of another way of getting it to work the way I want at the moment.
Output is:
(0.385132 / 22.08MB) Tag: {exp:low_reorder:entries set="{exp:stash:get name='reorder_set'}" channel="products" limit="1" paginate="bottom" dynamic="no" entry_id="{exp:stash:get name='e_ids'}" fallback="yes" force_set_params="yes" parse="inward" }
(0.385245 / 22.07MB) Closing Tag Found
(0.385335 / 22.09MB) Processing Tags
(0.385361 / 22.09MB) Module Tag: Low_reorder/entries
(0.385373 / 22.09MB) Including Files for Plugins and Modules
(0.386723 / 22.20MB) Files for Plugins and Modules All Included
(0.386735 / 22.20MB) Beginning Final Tag Data Processing
(0.386750 / 22.20MB) Calling Class/Method: Low_reorder/entries
(0.386767 / 22.20MB) Plugin in Parameter, Processing Plugin First
(0.386846 / 22.21MB) Tag: {exp:stash:get name='reorder_set'}
(0.386893 / 22.21MB) No Closing Tag
(0.386934 / 22.21MB) Module Tag: Stash/get
(0.386953 / 22.21MB) Including Files for Plugins and Modules
(0.386962 / 22.21MB) Files for Plugins and Modules All Included
(0.387648 / 22.23MB) Beginning Final Tag Data Processing
(0.387662 / 22.23MB) Calling Class/Method: Stash/get
(0.387733 / 22.24MB) -> Class Called: Stash
(0.387924 / 22.24MB) -> Method Called: get
(0.387974 / 22.24MB) Stash: RETRIEVED reorder_set with value 1
(0.388050 / 22.24MB) -> Data Returned
(0.388312 / 22.20MB) Plugin in Parameter, Processing Plugin First
(0.388368 / 22.21MB) Tag: {exp:stash:get name='e_ids'}
(0.388411 / 22.21MB) No Closing Tag
(0.388452 / 22.21MB) Module Tag: Stash/get
(0.388464 / 22.22MB) Including Files for Plugins and Modules
(0.388473 / 22.22MB) Files for Plugins and Modules All Included
(0.388903 / 22.24MB) Beginning Final Tag Data Processing
(0.388916 / 22.24MB) Calling Class/Method: Stash/get
(0.388991 / 22.24MB) -> Class Called: Stash
(0.389155 / 22.24MB) -> Method Called: get
(0.389905 / 22.24MB) Stash: SET e_ids to value
(0.389918 / 22.24MB) Stash: RETRIEVED e_ids with value
(0.389997 / 22.24MB) -> Data Returned
(0.390917 / 22.21MB) -> Class Called: Low_reorder
(0.391061 / 22.21MB) -> Method Called: entries
(0.391100 / 22.21MB) Low Reorder: Retrieving set from database
(0.391935 / 22.21MB) Low Reorder: Getting ordered entry_ids from database
(0.393165 / 22.22MB) Low Reorder: Setting parameters status="open" channel="products" search:categories="2" fixed_order="6|9"
(0.393180 / 22.22MB) Low Reorder: Calling the channel module
(0.397661 / 22.26MB) Calling Extension Class/Method: Low_reorder_ext/channel_entries_query_result
Ah!!
(0.393165 / 22.22MB) Low Reorder: Setting parameters status="open" channel="products" search:categories="2" fixed_order="6|9"
Does the fixed order here suggest that it is loading in that order only? I am presuming that is supposed to happen though?
Low 23 Oct 2012 15:07
That's looking correct. For set 1 (and category 0) the entries are 6 en 9. However, it looks like the Set also has a search: filter for the 'categories' field. You sure you're not trying to filter by category?
Having a duplication might have to do with something else on the page...
aurorameida 23 Oct 2012 15:35
Ahh Ok.
I am using channel entries as categories (So I have more flexibility with them). I'm then using Playa to relate them to the products.
So the search is the for ID products in the Playa field. So...
If I want to control order of the products within a channel category I do the following:
• Create a set in Low ReOrder and search the Playa 'Categories' field for the particular channel:entries style category (in this case 2)
• Edit the category and add the ReOrder set number
In the template I call out the category info in a usual channel:entries way and using Stash to set the ReOrder Set number. This is then being used in the ajax embed template.
Does that make sense? I am trying to set it up so my client doesn't need to call me if they want to re-order products. Can you think of a better way? Basically, each category (channel) will need its own ordering facility. I was thinking about having just one big set, but this could be 1000's of products spread over different categories.
Here is a bit of the blurb (if it helps)...
Categories/index.php
{embed="Wrappers/Main"}
{exp:stash:set name="MainContent"}
{exp:channel:entries channel="categories"}
<h3 class="Heading">{title}</h3>
<p>{category_description}</p>
{exp:stash:set_value name="e_ids" value="{exp:playa:parent_ids}" type="snippet" parse="inward"}
{exp:stash:set_value name="reorder_set" value="{re_order_set}"}
{/exp:channel:entries}
{exp:cartthrob:multi_add_to_cart_form id="add_to_cart_form"}
{embed="Categories/ajax_infinite_scroll"}
{/exp:cartthrob:multi_add_to_cart_form}
{/exp:stash:set}
Categories/ajax_infinate_scroll.php
{exp:low_reorder:entries set="{exp:stash:get name='reorder_set'}"
channel="products"
limit="1"
paginate="bottom"
dynamic="no"
entry_id="{exp:stash:get name='e_ids'}"
fallback="yes"
force_set_params="yes"
parse="inward"
}
{sn_product_list}
{/exp:low_reorder:entries}
Low 24 Oct 2012 07:53
So basically you want to be able to filter by parent entry instead of actual categories, right? That's not something that's possible at the moment, I'm afraid. Although undesirable, having one big list to reorder seems the only option at the moment...
Also, you might want to be searching for the parent id like this: search:categories="[2]", including square brackets. This will match an ID 2, but not an id of 42 for example.
aurorameida 24 Oct 2012 09:29
Ah, OK. Thanks anyway for the support. I was playing around last night with the reorder id to see if that had an effect. Sadly not. Neither did fixed order.
Oh well. I will have to use the channel field I guess.
Thanks again, and thanks for the heads up about the search for the future.