Issue 862 in wp-e-commerce: products page pagination fails if the products page is set as the homepage.

1 view
Skip to first unread message

wp-e-c...@googlecode.com

unread,
Dec 8, 2011, 10:40:16 PM12/8/11
to wp-e-commerce-googl...@googlegroups.com
Status: Accepted
Owner: ----
Labels: Type-Defect Priority-High Milestone-3.8.7

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


wp-e-c...@googlecode.com

unread,
Dec 20, 2011, 2:18:09 AM12/20/11
to wp-e-commerce-googl...@googlegroups.com

Comment #1 on issue 862 by da...@dewpointproductions.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

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

wp-e-c...@googlecode.com

unread,
Dec 20, 2011, 10:32:27 PM12/20/11
to wp-e-commerce-googl...@googlegroups.com
Updates:
Labels: -Milestone-3.8.7 Milestone-3.8.9

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.)

wp-e-c...@googlecode.com

unread,
Jan 17, 2012, 10:36:54 PM1/17/12
to wp-e-commerce-googl...@googlegroups.com

Comment #3 on issue 862 by ja...@om4.com.au: 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

Issue 911 has been merged into this issue.

wp-e-c...@googlecode.com

unread,
Jan 17, 2012, 11:05:07 PM1/17/12
to wp-e-commerce-googl...@googlegroups.com

Comment #4 on issue 862 by ceilbleu...@gmail.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

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


wp-e-c...@googlecode.com

unread,
Jan 20, 2012, 8:08:09 PM1/20/12
to wp-e-commerce-googl...@googlegroups.com

Comment #5 on issue 862 by ceilbleu...@gmail.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

any help? please

wp-e-c...@googlecode.com

unread,
Mar 17, 2012, 5:30:10 PM3/17/12
to wp-e-commerce-googl...@googlegroups.com

Comment #6 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

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

wp-e-c...@googlecode.com

unread,
Mar 17, 2012, 5:34:10 PM3/17/12
to wp-e-commerce-googl...@googlegroups.com
Updates:
Labels: Workflow-HasPatch Workflow-NeedsTesting

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.)

wp-e-c...@googlecode.com

unread,
Mar 17, 2012, 6:55:26 PM3/17/12
to wp-e-commerce-googl...@googlegroups.com
Updates:
Status: Started

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

wp-e-c...@googlecode.com

unread,
Mar 17, 2012, 8:22:43 PM3/17/12
to wp-e-commerce-googl...@googlegroups.com

Comment #9 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

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.

wp-e-c...@googlecode.com

unread,
Mar 18, 2012, 12:43:38 AM3/18/12
to wp-e-commerce-googl...@googlegroups.com

Comment #10 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

Alright - not entirely proud of this, but it seems to work pretty well.
Please test test test.

Attachments:
862.3.diff 10.1 KB

wp-e-c...@googlecode.com

unread,
Mar 18, 2012, 5:25:28 AM3/18/12
to wp-e-commerce-googl...@googlegroups.com

Comment #11 on issue 862 by pavele...@gmail.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

Does this patch work also for issue 737:
http://code.google.com/p/wp-e-commerce/issues/detail?id=737 ?

wp-e-c...@googlecode.com

unread,
Mar 18, 2012, 7:04:21 PM3/18/12
to wp-e-commerce-googl...@googlegroups.com

Comment #12 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

Not sure, have not tested that.

wp-e-c...@googlecode.com

unread,
Mar 19, 2012, 10:16:04 AM3/19/12
to wp-e-commerce-googl...@googlegroups.com

Comment #13 on issue 862 by gary...@garyc40.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

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.

wp-e-c...@googlecode.com

unread,
Mar 21, 2012, 7:08:52 PM3/21/12
to wp-e-commerce-googl...@googlegroups.com

Comment #14 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

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

wp-e-c...@googlecode.com

unread,
Mar 23, 2012, 3:02:53 PM3/23/12
to wp-e-commerce-googl...@googlegroups.com

Comment #15 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

When/if this gets committed, we should ensure that it also fixes related
(or possibly duplicate) issue #928.

wp-e-c...@googlecode.com

unread,
Apr 26, 2012, 6:22:38 PM4/26/12
to wp-e-commerce-googl...@googlegroups.com

Comment #16 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

Related: Issue 737

wp-e-c...@googlecode.com

unread,
May 9, 2012, 10:51:48 AM5/9/12
to wp-e-commerce-googl...@googlegroups.com

Comment #17 on issue 862 by alexgieg: products page pagination fails if the
I've applied this patch and did some testing in my localhost install.
Here's the results.

First, my setup:

WordPress 3.3.2, with:
- Language: pt-BR;
- Permalinks enabled and set to /%postname%/;
- The page used as the store is called Produtos, with slug produtos,
resulting in permalink "http://localhost/wordpress/produtos/".

WPEC 3.8.8.1-unnoficial with patch 862.4 applied, with:
- $product_list_url set to the above permalink in wp-admin/options.php;
- Option "Use Hierarchical Product Category URL" enabled;
- Option "Show Subcategory Products in Parent Category" enabled;
- Permalinks applied twice in WP.

Now, the test results:

a) Going to "http://localhost/wordpress/produtos/" shows a list of all
products added (there are 25 pages in total, so plenty to test). Links
block in source:

<span class='page-numbers current'>1</span>
<a class='page-numbers' href='?paged=2'>2</a>
<a class='page-numbers' href='?paged=3'>3</a>
<span class="page-numbers dots">&hellip;</span>
<a class='page-numbers' href='?paged=25'>25</a>
<a class="next page-numbers" href="?paged=2">Próximo &raquo;</a>

So, the link to, for example, page two, points to
http://localhost/wordpress/produtos/?paged=2

b) Clicking the above link causes a redirect, sending me to page
http://localhost/wordpress/produtos/page/2/. This page shows the same
contents of http://localhost/wordpress/produtos/, so it's not actually page
2.

The links in the navigation bar reflect this, being equal as the above
ones. Hence, the link to page 2 is now
http://localhost/wordpress/produtos/page/2/?paged=2.

c) Clicking it doesn't cause a redirect, so the page that loads is
http://localhost/wordpress/produtos/page/2/?paged=2. However, the contents
is still the same, so I'm still actually looking at page 1. The links are
the same too.

d) Changing the sequence of clicks doesn't change the result. For example,
if I first click on the link to page 25, I'm at
http://localhost/wordpress/produtos/page/25/. Clicking then link to page 3
puts me in http://localhost/wordpress/produtos/page/25/?paged=3. But the
contents is always that of page 1 (http://localhost/wordpress/produtos/).

e) Important: if I copy a link and paste it, manually changing the
parameter from "?paged=" to "page=", it works. For example,
http://localhost/wordpress/produtos/?page=10 in fact shows the 10th page of
products.

f) Something odd happens at the resulting navigation bar when I do this,
though. It fills, with most links as one would expect, all but one pointing
to their respective "?paged=". The odd link out is the one that should go
to page 1. It instead links to "?page=CURRENTPAGENUMBER" (note that it
isn't "?paged=", it's "?page="). The same applies to the "&laquo; Previous"
link if I'm looking at "?page=2".

g) Trying the "?page=" trick in a redirected address such
as "http://localhost/wordpress/produtos/page/4/", for example by
pasting "http://localhost/wordpress/produtos/page/4/?page=10", has no
effect. These always show the contents of page 1.

Now, moving to a category:

h) I have a product category with lots of items at
http://localhost/wordpress/produtos/interruptores-tomadas/. Entering it
provides these source links in the bar, same as before:

<span class='page-numbers current'>1</span>
<a class='page-numbers' href='?paged=2'>2</a>
<a class='page-numbers' href='?paged=3'>3</a>
<span class="page-numbers dots">&hellip;</span>
<a class='page-numbers' href='?paged=23'>23</a>
<a class="next page-numbers" href="?paged=2">Próximo &raquo;</a>

So, the link to, for example, page two, points to
http://localhost/wordpress/produtos/interruptores-tomadas/?paged=2.

i) Clicking it causes a redirect to
http://localhost/wordpress/produtos/interruptores-tomadas/page/2/. But this
time I actually see the page 2 contents, so the above link is functional.
The same applies to all 23 pages in this category. Going to
http://localhost/wordpress/produtos/interruptores-tomadas/page/18/ works.

j) The links in the navigation bar aren't right though. Here's what I see
in the above page's source:

<a class="prev page-numbers" href="?paged=17">&laquo; Anterior</a>
<a class='page-numbers' href=''>1</a>
<span class="page-numbers dots">&hellip;</span>
<a class='page-numbers' href='?paged=16'>16</a>
<a class='page-numbers' href='?paged=17'>17</a>
<span class='page-numbers current'>18</span>
<a class='page-numbers' href='?paged=19'>19</a>
<a class='page-numbers' href='?paged=20'>20</a>
<span class="page-numbers dots">&hellip;</span>
<a class='page-numbers' href='?paged=23'>23</a>
<a class="next page-numbers" href="?paged=19">Próximo &raquo;</a>

This results in the link to page 20, for example, to be
http://localhost/wordpress/produtos/interruptores-tomadas/page/18/?paged=20.

k) However, this link works! Clicking it redirects me to
http://localhost/wordpress/produtos/interruptores-tomadas/page/20/, which
shows the expected contents of page 20.

l) The link to page 1 points to the current page. The same applies to
the "$laquo; Previous" link when I'm at page 2. So, I guess this explains
the "?page=CURRENTNUMBER" from "f": it's merely the current URL.

m) By the way: the trick of typing "?page=" also works. The URL
http://localhost/wordpress/produtos/interruptores-tomadas/?page=12 shows
the expected contents of page 12.

Now, moving to a subcategory:

n) A subcategory of this category, at
http://localhost/wordpress/produtos/interruptores-tomadas/silenlux/, has 7
pages, so I used it. Moving around within it shows the exact same behaviors
as moving around its parent category, so there's no need to detail it
further.

Messing with the code:

I don't really understand how the new function works, as my knowledge of
PHP isn't advanced enough. That said, I looked around for the 'paged' text
and tried changing it to see what'd happen. These are my results:

o) First, changing line 92 from "'format' => '?paged=%#%'," to "'format'
=> '?page=%#%'," solves most of the problems, in that all links become
http://localhost/wordpress/products/[something/[something/]]?page=NUMBER,
which as shown above works when manually attempted, doesn't cause any
redirects etc. The downside is no nice looking ".../page/NUMBER/"-style
links anywhere. Also, the page 1 link is still a link to the current page,
not to the actual 1st page/base [sub]category page.

p) Then I attempted changing it to variations around like '/page/%#%/' (for
example, 'page/%#%/', '\/page\/%#%\/' etc.), but they all result in useless
links.

And that's it. I hope this helps!

wp-e-c...@googlecode.com

unread,
Jun 27, 2012, 4:45:54 AM6/27/12
to wp-e-commerce-googl...@googlegroups.com

Comment #18 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

Alex,

Thank you for the very detailed reporting, it is appreciated. I didn't
have the time to read through the entire thing before working on a related
issue, issue 737, and coming to the same eventual conclusion you did. Patch
attached.



Attachments:
862.5.patch 9.7 KB

wp-e-c...@googlecode.com

unread,
Jul 25, 2012, 10:28:04 AM7/25/12
to wp-e-commerce-googl...@googlegroups.com
Updates:
Labels: -Workflow-NeedsReview Workflow-NeedsTesting

Comment #20 on issue 862 by gary...@garyc40.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

Decided against paginate_links() in this release. This will already be
tidier in the new theme engine. No need to complicate things at this stage.

Attach a simple fix. Please test.

Attachments:
862.6.diff 1.1 KB

wp-e-c...@googlecode.com

unread,
Jul 25, 2012, 6:47:23 PM7/25/12
to wp-e-commerce-googl...@googlegroups.com

Comment #21 on issue 862 by miche...@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

This patch is working good no other pagination is broken when applied one
more tester then commit.

wp-e-c...@googlecode.com

unread,
Aug 16, 2012, 1:27:03 PM8/16/12
to wp-e-commerce-googl...@googlegroups.com
Updates:
Labels: -Milestone-3.8.9 Milestone-3.9

Comment #22 on issue 862 by gary...@garyc40.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

This issue was updated by revision r1945.

wp-e-c...@googlecode.com

unread,
May 15, 2014, 6:39:28 PM5/15/14
to wp-e-commerce-googl...@googlegroups.com

Comment #23 on issue 862 by andrewvo...@gmail.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

I had the same issue. I deactivated WP e-commerce plugin and reactivated.
Problem solved.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages