Forums / Installing on a Linux/Unix Server / category_product_listing issue

category_product_listing issue

Views: 6,759

Results 1 to 12 of 12
25 Jul 2023, 1:31 PM
#1
jrcook416 avatar

jrcook416

New Zenner

Join Date:
Jul 2012
Posts:
45
Plugin Contributions:
0

category_product_listing issue

I've found some goofy stuff in v1.5.8's category_product_listing page. I'm patched to 1.5.8a.

Category/Product Display Order is working in the category view. It is not working in the product view, so I suspect a flag isn't being set somewhere or there's some set of logic I'm not seeing in my glance between tasks.

Before I flail about and cast myself into the pit of sorrows, I decided to ask the group. Known issue - or new issue - or case of not reading the manual closely?

Thanks!

--Jeremiah

25 Jul 2023, 1:43 PM
#2
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: category_product_listing issue

Works fine for me in 1.5.8a

All I can think of is to check for error logs and perhaps for any console errors in browser's dev tools.

Simon

25 Jul 2023, 2:11 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: category_product_listing issue

jrcook416:

I've found some goofy stuff in v1.5.8's category_product_listing page. I'm patched to 1.5.8a.

Category/Product Display Order is working in the category view. It is not working in the product view, so I suspect a flag isn't being set somewhere or there's some set of logic I'm not seeing in my glance between tasks.

Before I flail about and cast myself into the pit of sorrows, I decided to ask the group. Known issue - or new issue - or case of not reading the manual closely?

Thanks!

--Jeremiah
"It is not working" covers a lot of ground. What *specifically *is "not working"?

It would also help if you would identify any plugins/add-ons that are in use, since they might be contributing to the "not working".

25 Jul 2023, 3:34 PM
#4
jrcook416 avatar

jrcook416

New Zenner

Join Date:
Jul 2012
Posts:
45
Plugin Contributions:
0

Re: category_product_listing issue

Sorry - I was in the middle of about three things at once:

In both the category and product view, you have the dropdown select box where you change the sort order of the elements. When I change the value in the Categories/Product Display Order box when viewing all of the categories, the dropdown works correctly and the reloaded page shows the proper display order.

When I go into a category and look at the product listing, the dropdown select box changes and shows the proper sort order list for all of the products. When I select an element to sort by and change the value in the Display Order box, the page reloads and goes back to the category view. It does this for all sort orders regardless of which sort order I'm selecting.

I took a glance at the code, but I didn't know if anyone had some quick suggestions before I budgeted out some time to dig deeper.
1.5.8a with Bootstrap, EO, Super Orders. I have a forked copy of the GitHub repo with my individual build that I keep in sync with the current branch if that helps.

--Jeremiah

25 Jul 2023, 4:28 PM
#5
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: category_product_listing issue

jrcook416:

Sorry - I was in the middle of about three things at once:

In both the category and product view, you have the dropdown select box where you change the sort order of the elements. When I change the value in the Categories/Product Display Order box when viewing all of the categories, the dropdown works correctly and the reloaded page shows the proper display order.

When I go into a category and look at the product listing, the dropdown select box changes and shows the proper sort order list for all of the products. When I select an element to sort by and change the value in the Display Order box, the page reloads and goes back to the category view. It does this for all sort orders regardless of which sort order I'm selecting.

I took a glance at the code, but I didn't know if anyone had some quick suggestions before I budgeted out some time to dig deeper.
1.5.8a with Bootstrap, EO, Super Orders. I have a forked copy of the GitHub repo with my individual build that I keep in sync with the current branch if that helps.

--Jeremiah

just to confirm, we are on the admin side?

if so, i can confirm that the latest v158 codeset works fine; ie it is not demonstrating the behavior you are describing.

i have a feeling it is the super orders integration which is messing you up. which is just a wild guess...

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

25 Jul 2023, 7:29 PM
#6
jrcook416 avatar

jrcook416

New Zenner

Join Date:
Jul 2012
Posts:
45
Plugin Contributions:
0

Re: category_product_listing issue

carlwhat:

just to confirm, we are on the admin side?

if so, i can confirm that the latest v158 codeset works fine; ie it is not demonstrating the behavior you are describing.

i have a feeling it is the super orders integration which is messing you up. which is just a wild guess...

best.

This is a recent development.

I've been testing 1.5.8 on PHP 8 since initial release WITH SO, EO, and Bootstrap, additionally, I don't think that either EO or SO code touches this particular page.

Thanks for the thought, though.

25 Jul 2023, 8:00 PM
#7
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: category_product_listing issue

jrcook416:

This is a recent development.

I've been testing 1.5.8 on PHP 8 since initial release WITH SO, EO, and Bootstrap, additionally, I don't think that either EO or SO code touches this particular page.

Thanks for the thought, though.

this page is now definitely not working properly. i'm trying to see when it got screwed up.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

25 Jul 2023, 8:31 PM
#8
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: category_product_listing issue

jrcook416:

When I go into a category and look at the product listing, the dropdown select box changes and shows the proper sort order list for all of the products. When I select an element to sort by and change the value in the Display Order box, the page reloads and goes back to the category view. It does this for all sort orders regardless of which sort order I'm selecting.

i can not reproduce this error. when i go into a product listing it sorts completely correctly.

when i go into a category view, the sort does not work.

that is a problem.

i think the fix is as such. look at these 2 lines:

https://github.com/zencart/zencart/blob/f0299a0349eeaa66956a156aa76ccc3f5082de66/admin/category_product_listing.php#L36
https://github.com/zencart/zencart/blob/f0299a0349eeaa66956a156aa76ccc3f5082de66/admin/category_product_listing.php#L42

and change each one as such:

if (!empty($_GET['cID'])) {

if (!empty($_GET['pID'])) {

please let us know if that fixes the problem.

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

26 Jul 2023, 1:52 PM
#9
jrcook416 avatar

jrcook416

New Zenner

Join Date:
Jul 2012
Posts:
45
Plugin Contributions:
0

Re: category_product_listing issue

Good morning!

I adjusted lines 36 and 42 accordingly in my development environment with no change in the behavior.

If I get a chance between all of the other projects I have going, I'll see if I can look deeper into the diffs and see what I can see. But thank you for taking a second look!

--Jeremiah

26 Jul 2023, 2:14 PM
#10
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: category_product_listing issue

I applied the first fix and that worked for me. The issue/bug should only occur in the subcategory immediately below the top category listing:
https://github.com/zencart/zencart/pull/5899

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

26 Jul 2023, 2:43 PM
#11
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,973
Plugin Contributions:
8

Re: category_product_listing issue

jrcook416:

I have a forked copy of the GitHub repo with my individual build that I keep in sync with the current branch if that helps.

jrcook416:

I'll see if I can look deeper into the diffs and see what I can see.

the fact that you are looking at diffs suggests to me you are perhaps not running the latest code set

jrcook416:

When I change the value in the Categories/Product Display Order box when viewing all of the categories, the dropdown works correctly and the reloaded page shows the proper display order.

as determined by me and verified by @torvista, the latest code does not do this correctly. and the fix i provided does address this issue.

jrcook416:

When I go into a category and look at the product listing, the dropdown select box changes and shows the proper sort order list for all of the products. When I select an element to sort by and change the value in the Display Order box, the page reloads and goes back to the category view. It does this for all sort orders regardless of which sort order I'm selecting.

neither one of us is seeing this behavior. the product sorting seems to sort fine and there is no redirect when changing the product sort order that causes you to go back to a category listing.

as you said, i would look at the difference in your code and what is on the latest codeset. but you did point out a verified bug in the existing code set; thank you for that!

best.

author of square Webpay, now with Apple Pay and Google Pay.
mXworks
donations: venmo or paypal accepted.
premium consistent excellent support. available for hire.

26 Jul 2023, 2:46 PM
#12
jrcook416 avatar

jrcook416

New Zenner

Join Date:
Jul 2012
Posts:
45
Plugin Contributions:
0

Re: category_product_listing issue

torvista:

I applied the first fix and that worked for me. The issue/bug should only occur in the subcategory immediately below the top category listing:
https://github.com/zencart/zencart/pull/5899

Looks like something went goofy with my merged changes somewhere in the Git workflow. I've rolled back to v158's stock file and it is now working.

Thanks, y'all!

--Jeremiah