KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: Simon on September 06, 2011, 09:50:01 am

Title: how to get Reviews by date(last 7 days, year to date)?
Post by: Simon on September 06, 2011, 09:50:01 am
Hi guys,

For one project, i have to get reviews list by date(last 7 days, year to date, etc),  I've check the API, but didn't find the function about this, is there any way to get the reviews list by date?

Now I just created the custom SQL to get the review list

Thanks.
Title: Re: how to get Reviews by date(last 7 days, year to date)?
Post by: julie on September 06, 2011, 10:02:16 am
Not at the moment although it wouldn't be a big job to implement it. We allow you to sort by date, so normally our customers do that and then page through the results.
Title: Re: how to get Reviews by date(last 7 days, year to date)?
Post by: Simon on September 06, 2011, 10:11:12 am
Thanks, guys,

Which method I should use?
Title: Re: how to get Reviews by date(last 7 days, year to date)?
Post by: julie on September 06, 2011, 10:18:21 am
    /**
     * An array of review objects is returned for the given <code>productId</code>.
     * <p>
     * The <code>averageRating</code> attribute of the reviews is calculated and set by the method.
     * <p>
     * All reviews are retrieved, regardless of the language. <code>dataDesc</code> may be null. In
     * this case, the number of retrieved reviews is limited to a default number, the reviews are
     * ordered by the ReviewId and the offset is set to zero. However, by setting the attributes of
     * <code>dataDesc</code>, the following functionality may be controlled :
     * <ul>
     * <li>The maximum number of Review objects returned.</li>
     * <li>The offset which defaults to zero. This is useful when there are many Review objects, in
     * order to return them using multiple calls to this method.</li>
     * <li>Criteria on the custom attributes. If a custom attribute is set then only reviews with a
     * matching custom attribute value are returned.</li>
     * <li>The Reviews may be sorted by :
     * <ul>
     * <li>DataDescConstants.ORDER_BY_DATE_ADDED</li>
     * <li>DataDescConstants.ORDER_BY_DATE_ADDED_DESCENDING</li>
     * <li>DataDescConstants.ORDER_BY_DATE_ADDED_ASCENDING</li>
     * <li>DataDescConstants.ORDER_BY_TIMES_READ</li>
     * <li>DataDescConstants.ORDER_BY_TIMES_READ_DESCENDING</li>
     * <li>DataDescConstants.ORDER_BY_TIMES_READ_ASCENDING</li>
     * <li>DataDescConstants.ORDER_BY_RATING</li>
     * <li>DataDescConstants.ORDER_BY_RATING_DESCENDING</li>
     * <li>DataDescConstants.ORDER_BY_RATING_ASCENDING</li>
     * </ul>
     * </li>
     * </ul>
     *
     * @param dataDesc
     *            Used to control the data offset, limit the number of items returned and set the
     *            sort order
     * @param productId
     *            The numeric id of the product
     * @return Return a Reviews object
     * @throws KKException
     */
    public ReviewsIf getReviewsPerProduct(DataDescriptorIf dataDesc, int productId)
            throws KKException;