Link to home
Start Free TrialLog in
Avatar of sharingsunshine
sharingsunshineFlag for United States of America

asked on

Need Woocommerce Category Sorted by Description Within Product

This is a follow on to this question - https://www.experts-exchange.com/questions/29107724/Need-Category-Sorted-By-Product-Not-First-Letter.html?anchorAnswerId=cceptAnswerByMember#acceptAnswerByMember

Need to have category page sorted by product and within by description.  Putting $off, %off, buy x.  With the x amount being in an ascending sequence.

For example, Buy 4 then Buy 5 then Buy 9 etc.
Avatar of Adrian Thompson
Adrian Thompson
Flag of United Kingdom of Great Britain and Northern Ireland image

Hello,

All looks good. I'll post a ZIP of the plugin on here when it is ready, probably tomorrow.

Thanks,

Adrian
Avatar of sharingsunshine

ASKER

Sounds good, thanks!
Here you go! This is version 0.3 and should now meet all your criteria.
agt-wc-autosort-v03.zip
It's installed and it is sorting but it seems to be inconsistent on putting the $ off's at the beginning, with Food Enzymes it is correct.  With Detox Basics and Proactazyme it is the last item.

Am I missing something in how to make the description?
Based on what we discussed previously, there might be a problem with the default settings when the plugin is first activated. To ensure the settings are correct, please can you go to the WCAS settings page and copy / paste the following code into the box then hit save:

–

After you have done this, please click the Auto Sort button and let me know the result.

Thanks!

AFTER you have tried the above... if it still does not work then please run this code and give me a screenshot of the output so I can look for special characters / anomalies with your titles:
(you just need to replace "YOUR-DATABASE-NAME" with your actual database name)
SELECT id,post_title,menu_order
FROM `YOUR-DATABASE-NAME`.`wp_posts`
WHERE post_type='product'
AND post_title LIKE '%Detox Basics%'
AND post_status='publish'
ORDER BY menu_order;

Open in new window

Good news! I have solved the issue.

I have run out of time for today but I will post the updated plugin on here for you tomorrow.

Adrian
sounds good, thanks for everything.
ASKER CERTIFIED SOLUTION
Avatar of Adrian Thompson
Adrian Thompson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That looks perfect!  However,  it seems my sorting for other categories is no longer alphabetical.  I'll post another question for that if that is alright with you?
Good to hear it has worked for you.

Yes that sounds fine. Please proceed and post a link here to the follow-up question.

Thanks,

Adrian