Viewing 15 posts - 31 through 45 (of 77 total)
Monique

widget most popular listing

Hello I should like to display a widget with the 5 most popular listings So i've tried "meta_key=hits&order=desc" in Custom Query But i don't get the 5 mosts hits Please can you help me Thanks

Created: July 25, 2013 at 4:31 am

  • Jennifer
    Jennifer
    November 18, 2013 at 11:24 am

    That is the same code I posted above that isn’t working in my case. Rated products rearrange themselves when I Order Results By Rating, but they aren’t in any order I can discern.

    (Note to any new readers in the thread- I had two blocks of code I was inserting into class_white_label_themes.php, and the one suggested in the above message was/is the second block. I tried each block independently, as well as the two together, and neither of them makes a difference in the behavior of the OrderBy Rating result. Having this:

    Star(Low-High) [orderby=starrating&order=asc]
    Star(High-Low) [orderby=starrating&order=desc]

    in the General Setup/Advanced Search/Custom Order Options causes rated products to appear, but not in the proper order)

    https://ecigarettes-uk.org.uk/product-category/cartridgescartomizers then sort by rating to see what I mean.

    The products are getting sorted by SOME parameter, I assume. I’m trying to figure out what it could be. It’s not the title, date, author, post ID, number of views or votes… I’m stumped.

    Got any more clues or ideas? Can anyone tell me if I should give up trying? Thanks 🙂

  • Ian
    Ian
    November 18, 2013 at 12:31 pm

    I just tried your page as per above and ratings ordered by price (high to low)

    This is my second block

    function core_search_orderby($orderby) {

    global $wpdb;

    if ( !is_admin() ) {
    if ( isset($_GET['orderby']) ) {
    if ( $_GET['orderby'] == "featured" ) {
    $orderby = $wpdb->prefix . "postmeta.meta_value ".$this->core_order();
    }elseif ( $_GET['orderby'] == "price" ) {
    $orderby = $wpdb->prefix . "postmeta.meta_value+0 ".$this->core_order();
    }elseif ( $_GET['orderby'] == "price_current" ) {
    $orderby = $wpdb->prefix . "postmeta.meta_value+0 ".$this->core_order();
    }elseif ( $_GET['orderby'] == "bidwinner" ) {
    $orderby = $wpdb->prefix . "postmeta.meta_value ".$this->core_order();
    }elseif ( $_GET['orderby'] == "starrating" ) {
    $orderby = $wpdb->prefix . "postmeta.meta_value ".$this->core_order();
    }
    }

    }

    return $orderby;

    }

  • Jennifer
    Jennifer
    November 18, 2013 at 10:32 pm

    Hi Ian,

    Why did you try OrderBy Price? It’s only the Star Rating I’m having trouble with. Your second block of code looks the same as mine.

    Jennifer

  • Ian
    Ian
    November 18, 2013 at 11:35 pm

    I didn’t try order by price, I ordered by ratings and it came up in order of price(high to Low). Could have been just a coincidence 😕

    I just noticed that if you have Search Results Settings>Display View set to ‘Featured Listings(top or bottom)’ or ‘Price(hig-low,low-hig) then it doesn’t work! With all the other settings it works fine.

  • Ian
    Ian
    November 18, 2013 at 11:40 pm

    In fact take a look at your URL after clicking on Order Results By Ratings

    This is on the end –

    ?orderby=starrating&order=desc&orderby=price&order=desc
    

    So no wonder it’s ordering by price, it’s doing as it’s told 😉

  • Jennifer
    Jennifer
    November 19, 2013 at 1:19 am

    Well, actually, you’re raising another issue with the entire search feature which I assume is accidental, but I’m not sure- every time you choose to Order Results By X, it tacks on the new parameter to the older one, so the url just gets longer and longer, with all the parameters piling onto each other. Is that typical and acceptable?

    The other stuff you said indirectly helped me solve the problem! Thank you so much!

    Here’s the answer: The main nugget you gave me was the fact that the orderby options act different when you change the Search Result Settings under General Settings. I have it currently set to System Set (the top option), AND I have BOTH blocks of code (see my first post in this thread) added to the class_white_label_themes.php file, and now I can sort by Rating and Price! Woohoo! Of course, I can’t set the default display order to what I want without causing it to go haywire again, but I can settle for this default display order.

    I think this exposes an official bug- the Search Results Settings in General Setup change the behavior of the Order Results By options. They shouldn’t because they are simply supposed to establish the default display order, right?

    Resting in satisfaction after weeks of struggling….

    Jennifer

  • Mark Fail
    Mark Fail
    November 19, 2013 at 11:24 am

    Richard, the only queries hard coded are default options which come with the theme so users don’t have to setup manually as most users don’t know how to.

    Recent listings widget is designed just for ‘listings’ thus blog options are not part of it. If you need extra functionality you could hook into it.

  • Alex
    Alex
    January 22, 2014 at 9:55 am

    Hi Richard,

    How can I make a widget showing the top 5 Listings by Hits? I have read all the above but do not know what widget to use and what code to place in the widget.

    It’s basically Steven’s question on 25th July to which I cannot see a response.

  • Malgorzata
    Malgorzata
    January 22, 2014 at 2:27 pm

    try:
    post_type=listing_type&posts_per_page=5&orderby=hits

  • Malgorzata
    Malgorzata
    January 22, 2014 at 2:35 pm

    The widgets:
    in v7.14 – New Website Listing
    in Responsive- ‘recent listings’

  • Jennifer
    Jennifer
    January 22, 2014 at 7:41 pm

    I’m glad we are talking about this again. I want a widget that shows Top Rated by Product Category, but I can’t figure out a way to get a drop-down in the widget admin that will show, and allow me to select, a single Product Category (meaning custom taxonomy). I can get WP native categories, but that does me no good.

    Anyone want to bid on creating this for me?

    Thanks, Jennifer

  • Malgorzata
    Malgorzata
    January 22, 2014 at 8:20 pm

    Depending on theme that you have v.7 or responsive, it shows me what I want and those are my categories created for DP not some WordPress.
    WprdPress categories apply to posts in responsive, but in old v7 themes, posts are the listings.
    I don’t understand why you have a problem.
    The above widgets are in the widget area.
    For v7 a plugin was downloaded from Richard Bonk site and it was free at that time. It added a widget. I can change my own created categories for v7 theme as often as I want and show more than 5 at a time.

  • Jennifer
    Jennifer
    January 22, 2014 at 8:37 pm

    I have the Responsive Shopping Cart theme, version 5.7. Please tell me where to get that plugin. Thanks, Jennifer

  • Malgorzata
    Malgorzata
    January 22, 2014 at 9:20 pm

    In responsive, the widget sits already in widget area “recent listings’ but You can change the name and the querry

Copyright © 2010-2020 PremiumPress Limited.

secure payments