New issue 862 by came...@instinct.co.nz: products page pagination fails if
the products page is set as the homepage.
http://code.google.com/p/wp-e-commerce/issues/detail?id=862
What steps will reproduce the problem?
1. Make the products page the homepage in Settings -> reading.
2. Have a permalink setting that is not 'default'
3. Notice the pagination is broken
What is the expected output? What do you see instead?
the links will be
/products-page/page/2
when they should be
page/2
P
Forum topic on it here
http://getshopped.org/forums/topic/permalinks-and-pagination-are-not-working/
The URL changes when pagination is clicked, as pointed out above, but the
products remain the same.
Appears to happen regardless of if the products page is the home page.
It definitely isn't clear that it has anything to do with the trailing
Comment #2 on issue 862 by came...@instinct.co.nz: products page pagination
fails if the products page is set as the homepage.
http://code.google.com/p/wp-e-commerce/issues/detail?id=862
(No comment was entered for this change.)
Issue 911 has been merged into this issue.
please help.. i have the same issue
i use wp 3.3.1 and wpec 3.8.7.5
product page is set as home page with pagiantion enable.
when i click page 2 or 3 or so on is always redirected to page that contain
blog list.
here is my page:
http://www.moki-moki.com/products/page/2
it will redirect to
http://www.moki-moki.com/2/page/2/
please help.. what shoul i do?
thank you
any help? please
The problem is the wpsc_pagination() function. Appears to be leftover
cruft from early in the original 3.8 dev cycle (perhaps before custom post
types were introduced) or even earlier in the 3.7 dev cycle.
Patch attached (against trunk) fixes 404s, wrong products, duplicate
pages. Introduces a new filter (For args in the paginate_links() function)
to allow maximum flexibility. Deprecates 4 arguments in the function (as
core never used them). Maintains back compat with $additional_links
filter. Works as expected generally and on category pages. Went from
about 177 lines of code to 37 - so not too bad.
Please TEST TEST TEST.
Attachments:
862.1.patch 8.7 KB
Comment #7 on issue 862 by off...@zaowebdesign.com: products page
pagination fails if the products page is set as the homepage.
http://code.google.com/p/wp-e-commerce/issues/detail?id=862
(No comment was entered for this change.)
Comment #8 on issue 862 by off...@zaowebdesign.com: products page
pagination fails if the products page is set as the homepage.
http://code.google.com/p/wp-e-commerce/issues/detail?id=862
Running into another issue not addressed in this ticket or this patch -
this works fine on top-level categories with no children, or sub-categories
with no subs - but fails on categories with children. On sub cats, you get
links like this -
http://ms-test-two.zaowebdesign.com/products-page/product-category/page/4/?paged=2
Which fail, for obvious reasons. Patch attached to address.
Attachments:
862.2.diff 8.8 KB
Found another issue due to a premium support ticket at GetShopped. If you
have Hierarchical categories turned on (Settings > Store > General) and
have hierarchical categories - if you're on a top-level category and try to
go to the next page - it goes to the home page template, losing proper
styling - loses pagination but I think the correct posts are getting
queried. Odd little big, patch coming soon.
Alright - not entirely proud of this, but it seems to work pretty well.
Please test test test.
Attachments:
862.3.diff 10.1 KB
Does this patch work also for issue 737:
http://code.google.com/p/wp-e-commerce/issues/detail?id=737 ?
Not sure, have not tested that.
Thanks Justin!
A few comments:
- Before the patch, the filter 'wpsc_pagination_additional_links' accepts a
string. However, in your patch, it's accepting an array, so that could be
incompatible.
- Typo in 'wpsc_paginiation_args' filter.
- We shouldn't use both the 'base' and 'format' in the paginate_links args.
If there's no '%_%' string in 'base', 'format' is ignored anyways.
- I wonder if the "$big = 999999999" hack is necessary. We can just leave
out "base" and set "format" to "?paged=%#%". If the only advantage to
the "/page/xxx" permalink scheme is that it looks nicer than ?paged=xxx, I
don't think it's worth the hack.
- Why are we depending on $args['type'] to either output or return the
paginate links? Shouldn't we create a separate boolean-typed 'echo' arg for
that?
Let me know whether I misunderstood anything :) If you're busy with other
tasks, I'll take care of revising the patch.
1. Good point. Strings passed were primarily query strings.
wp_parse_args()?
2. That's not how you spell pagination in Japan? Weird. :P
3. Related to 4.
4. I think it's only necessary for the pretty permalinks (unless we go play
with WP_Rewrite, which seems like way more overhead). I personally prefer
the pretty permalink structure (Will probably result in very, very, very
low priority support tickets) which is why the hack is there. Patch has it
removed. People could always filter wpsc_pagination_args to change it.
See also original post ("when they should be page/2")
5. I was probably over-thinking this. Plain is the default, but if someone
over-rode the type parameter to be 'array', that's the primary instance in
which you'd want the result returned, not echo'd. I think an additional
argument would be fine. Default $echo = true - if people want to return
it, they're going to have to have to run it like
wpsc_pagination('', '', '', '', false); - which is kind of lame, but I
think the use case for returning vs. echo is edge enough to not worry about
it.
Attachments:
862.4.diff 10.0 KB
When/if this gets committed, we should ensure that it also fixes related
(or possibly duplicate) issue #928.