Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › eStore – order products in category
Tagged: product categories
- This topic has 12 replies, 7 voices, and was last updated 8 years, 8 months ago by admin.
-
AuthorPosts
-
April 1, 2013 at 2:34 am #8847tahoemntsMember
I read a post about how to order products within a category by price and/or alphabetical. There should be a field to itemize products at will.
[http://highdesertwoodcollections.com/rear-view-mirror-cross]
On this page all the products are the same price. I can’t order them by price nor alphabetical. How can I order them? As you can see, at the bottom of the page, products #4 and 7 are out of order…
Thanks.
April 1, 2013 at 10:10 pm #54728wpCommerceModeratorHi, We do have an option to show products in an order.
Please do the following:
1) Install the eStore extra shortcode plugin (if you haven’t done so already).
http://www.tipsandtricks-hq.com/ecommerce/wp-estore-shortcodes-and-functions-reference-460
2) In the extra shortcode reference guide, look for a shortcode that allows you to display products from a particular category along with fancy display. Here is an example shortcode that you can use to order the products (take note of the “order” parameter):
[wp_eStore_category_products_fancy id=1 style=2 order=3]
order=3 should sort and display the products by name.
August 25, 2014 at 5:08 am #54729dlburkhartSpectatorThe “order” attribute of the “show all products” shortcode does not seem to work for value 1, ascending product ID. For example, it shows my products in the following ID order: 1, 3, 2.
August 25, 2014 at 2:24 pm #54730wzpModeratorThe addon made an incorrect “presumption” about the way MySQL table entries are retrieved.
Until the addon can be corrected (1 line of code), please do the following:
- Edit the eStore-extra-shortcodes/shortcode_include.php file.
- Search for the show_wp_eStore_category_products_fancy() function definition.
- About 30 lines down from that point, is the statement: if($order==1)
- Just below that line is another line that reads:
$wp_eStore_db = $wpdb->get_results(“SELECT * FROM $cat_prod_rel_table_name where cat_id=$id LIMIT $start, $limit”, OBJECT);
- Change it, to read:
$wp_eStore_db = $wpdb->get_results(“SELECT * FROM $cat_prod_rel_table_name where cat_id=$id ORDER BY prod_id ASC LIMIT $start, $limit”, OBJECT);
- Save the file.
August 26, 2014 at 12:53 am #54731adminKeymasterI have corrected this in the extra shortcodes addon (Thank you for pointing it out). Please download a new copy of that addon and you should be fine.
March 6, 2015 at 6:00 pm #54732Rick BarronMemberI’m having the same issue with the sort order 1 using the addon version v4.9.4. How do I get the update I just downloaded the addon?
….. Rick
March 7, 2015 at 1:13 am #54733adminKeymasterYou already have the updated copy. Lets look at the shortcode you are using. What shortcode are you using and which sort order is not working? Please post a link to the page where you have the shortcode.
March 7, 2015 at 3:09 am #54734Rick BarronMemberThank you for the prompt reply. I’m using the shortcode
[wp_eStore_show_all_products style=1 order=1]
on
[http://quantumcredibility.com/store/]
but I added the ORDER BY on line 2438 of shortcode_include.php and it’s working.
/* $wp_eStore_db = $wpdb->get_results(“SELECT * FROM $products_table_name LIMIT $start, $limit”, OBJECT); */
$wp_eStore_db = $wpdb->get_results(“SELECT * FROM $products_table_name ORDER BY id ASC LIMIT $start, $limit”, OBJECT); /* RMB – 2015-Mar-06 */
P.S. There are additional shortcodes on the page. I’m still deciding what to use.
March 8, 2015 at 12:17 am #54735adminKeymasterThe default sort order should be using ASC. So when you use “1” as the order parameter, it should sort it by ASC. Is that not happening?
March 10, 2015 at 2:06 am #54736Rick BarronMemberIt’s not happening …. Rick
March 10, 2015 at 4:16 am #54737adminKeymasterI will make that change in the addon also.
March 21, 2016 at 8:12 pm #54738FrankMemberOne thing that I’ve come to recognize, to make certain products leap to the top of the list with the default ordering is to just place a space in front of the product name and it leaps right to the top – so it becomes like a featured item without using any trickery.
Frank
March 22, 2016 at 4:04 am #54739adminKeymasterGood trick. The empty/space character comes before any alphabet.
-
AuthorPosts
- You must be logged in to reply to this topic.