1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Review This Item Button

Discussion in 'Showcase Support' started by JBS, Mar 6, 2014.

  1. JBS

    JBS New Member Showcase

    Is there a way to add a "review this product/item" button? Once the item was reviewed it would be cool if it turned to "reviewed". My members are having an issue figuring out were to click to rate items.

    ...or...

    What is the URL that I would use to create my own button?

    Also...a button for "discuss this item". Like in the XF resource manager?
     
  2. Bob

    Bob Developer Staff Member

    The challenge is that there are multiple rating systems and they work differently ie, one is an inline AJAX rating, the other is an AJAX overlay form action. You can't just place a "button" somewhere. Neither system works like that as they are both AJAX driven by clicking on the stars (which is a javascript action that either then does an inline rating or launches the overlay for users to enter in text for the review).

    You'd have to completely re write the rate/review system to do what you want.

    As for the discuss button, it has been suggested and MIGHT make it into the next version.
     
  3. Bob

    Bob Developer Staff Member

  4. JBS

    JBS New Member Showcase

    Is there a way to add a second instance of the rating system to a different location...like the reviews tab...or above all the tabs?
     
  5. Bob

    Bob Developer Staff Member

    Depends on which rate/review system you are using. If its the inline ajax system, then it will require some programming to handle additional inline inserts. The Review system would be a bit easier since it does a response redirect which reloads the page (it could be done similar to how the Resource Manager has it below the main body content).

    I wish I could tell ya that you just cut and paste some template code, but its not that simple. Even relocating it requires more than just a template edit, it will require modification to the .js file, some programming code (the view) and a couple different template edits (and some CSS changes).

    Once I release this next version, I will be available for customization and can certainly handle something like this for you. I've done a few rating customization's for license holders.
     
  6. Bob

    Bob Developer Staff Member

    Not sure if this will work for you, but this is now part of core showcase when using the Rate & Review rating system type (this is not applicable to rate only system).

    I've added a new block above the Reviews on the Reviews tab of an item (see below image). This only displays if the viewing user has permission to rate & review and has not yet reviewed the item. If the user does not have permission OR has already review, the block won't even be rendered.

    This is an example of what it looks like (very simple).

    Selection_035.png


    This is also displayed below the "Content" tabs and on all the Custom Field Tabs pages (again, only for the Rate & Review rating system type). Here you can see it below the content on the first tab...

    Selection_036.png

    Here you can see it below a Custom Field that has been set as its Own Tab....

    Selection_037.png


    NOTE: the Rate Only rating system is only available in the sidebar because of it being inline ajax. I've removed the inline ajax rating (as it has become a show stopper for way to many things), so this stuff above also works with rating only system.
     
    Last edited: Mar 8, 2014
    C.Birch likes this.
  7. C.Birch

    C.Birch Member AMS Premium SC Premium UBS Premium

    That works for me, hopefully it will put people off using the comments for posting reviews lol
     
    Bob likes this.
  8. Joe Link

    Joe Link New Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Is there a conditional we can use to tell whether a person has reviewed an item or not?
     
  9. Bob

    Bob Developer Staff Member

    Its Permissions based, so the variable {$item.canRateItem} is what you need to use.
     
  10. Joe Link

    Joe Link New Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Is there a way to differentiate between someone who can't review the item because they don't have permission (such as not being logged in) and someone who can't review the item because they've already reviewed it?
     
  11. Bob

    Bob Developer Staff Member

    {$item.has_rated} should be exposed and is a BOOLEAN. You'll need to use them BOTH to test for various cases. Just because {$item.has_rated} is 0 (which means they have not rated the item), doesn't mean they CAN.

    {$item.canRateItem} determines whether they CAN or CAN NOT.

    {$item.has_rated} simply means they have or have not rated.
     
    Joe Link likes this.
  12. Joe Link

    Joe Link New Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Perfect, I think this is what I needed to know :)
     
  13. Joe Link

    Joe Link New Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Yep, exactly what I needed. I'll leave this here for anyone who might find it useful.

    Code:
    <xen:if is="{$item.canRateItem} == 0 AND {$item.has_rated} == 1">
    Can't rate, already rated </xen:if>
    
    <xen:if is="{$item.canRateItem} == 1 AND {$item.has_rated} == 0">
    Can rate but has not </xen:if>
    
    <xen:if is="{$item.canRateItem} == 0 AND {$item.has_rated} == 0">
    Can't Rate Item </xen:if> 
     
  14. Joe Link

    Joe Link New Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    One more question on this subject :)

    If I wanted to build a template link to take a user to their review, how should I do that?
     
  15. Bob

    Bob Developer Staff Member

    Individual reviews are not fetched by User ID, they are fetched by Review ID. There are no fetching methods to get a review for a specific individual.
     
    Joe Link likes this.
  16. Joe Link

    Joe Link New Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Thanks for clarifying.

    If you get bored here are a couple more non-urgent noob questions for the sake of learning :D

    How does the recent activity tab list reviews by user? Is it possible to a) display the total number of reviews (not items) a user has outside of showcase (postbit, member card, etc) and/or b) create a tab with a list of a user's reviews (same appearance as recent activity, basically filtered)?
     
  17. Bob

    Bob Developer Staff Member

    That tab fetches content via the NewsFeedHandler (data is stored in the table: xf_news_feed). Data in the xf_news_feed table is purged after 7 days.

    That data is not stored, nor are there any fetching methods in any of the models, so custom development would be required to do something like that.

    There are NO fetching methods for User Reviews that are USER ID based. It would require extending models and adding in your own custom fetching methods.
     
    Joe Link likes this.
  18. Joe Link

    Joe Link New Member AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Good to know, thanks Bob :)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.