• Resolved Luca

    (@dharma23)


    Hi
    i’ve created a page with [recent_products] shortcode to show off the new products.
    Is there any way to change the days for a product to be considered as new? I need 7 or 30 or 14 days to show them as new…
    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Shaun Kuschel a11n

    (@shaunkuschel)

    Automattic Happiness Engineer

    Hey @dharma23,

    A better way to think about the [recent_products] shortcode is as a sorting method that is based on how recently products have been added to the site. I don’t believe there is anything by default that determines what time period is considered ‘recent’ or ‘new’ with the shortcode. Rather, it just orders all the products on the site by their creation date and limits the display to however many products are specified in the shortcode.

    Based on what you described, it sounds like you would need some custom coding to limit the ‘new’ time period- perhaps using something similar to what is described in this article.

    Thread Starter Luca

    (@dharma23)

    Thanks but this doesn’t help.

    Recent products are marked with a “new” label, so there must be something that allows WC to mark those products with that label.

    I can’t believe that such a basic functionality for every e-commerce (we are talking about simple products that are offered as new) is not included in WC.

    the shortcode only allows me to show a bunch of recently added products, but it doesn’t allow me to do anything else. For example, if I add 100 products but in the shortcode I have set to show 50, half of the new products will not be shown!

    Plugin Support Shaun Kuschel a11n

    (@shaunkuschel)

    Automattic Happiness Engineer

    Hey @dharma23,

    There are several ways to approach a use case like this but the shortcode on its own will work as you described (with the example of 50 products showing rather than all 100 new products).

    There are a number of plugins available as well (including free options here on .org), depending on the desired result. Since you mentioned a separate page for the new products, that is why I shared the link to that article. Even though that snippet just adds the “new” label, it shows how the $newness_days variable can be utilized.

    Plugin Support Tseten a11n

    (@tibetanitech)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Number of days for a “New” product’ is closed to new replies.