• Resolved travelwaxer

    (@travelwaxer)


    Hi Michel,

    Is it possible to use today’s date as a condition in the feed. For example
    if <today> is between _sale_price_start_date and _sale_price_end_date? If it
    not possible it is on my wish list.

    Cheers,
    Thomas

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hi Thomas,

    I’m currently working on a difficult topic but I will come back to you to see if I can find a solution for your issue.

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Hello Thomas,

    I found that this is a pretty hard thing to implement and thinking about it was wandering where you would like to use it for as I think it could be a somewhat dangerous option.

    Also the _sale_price_start_date and _sale_price_end_date in the Google feed should normally be used in the sale_price_effective_date attribute, so I wonder if it would be of any use if you link it to a specific date like <today>

    Could you give me a bit more information about how you wanted to use this option?

    Thread Starter travelwaxer

    (@travelwaxer)

    Hi Michel,

    Yes, I realized that sale_price_effective_date is what I should use instead. Then I ran into another problem: my plugin the dates for example _eur_sale_price_start_date and _eur_sale_price_end_date are stored as a timestamp. I wrote some code that parses the .xml and replaces this with ISO-dates. Do you have any hooks/action that can trigger my code after your feed generation is done?

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    You could do two things. Use the action hook ‘wppfm_complete_a_feed’ that triggeres when a feed is completed, or maybe even better, use the ‘wppfm_feed_item_value’ filter to change the values wherever you need (see https://gist.github.com/Auke1810/c62bb043926f539f9a99b418c06a3e6e on how to use that filter).

    BTW I will change the ‘wppfm_complete_a_feed’ to ‘wppfm_feed_completed’ in the next update as I think it’s a better term.

    Thread Starter travelwaxer

    (@travelwaxer)

    Excellent! That works perfect, thank you.

    Plugin Contributor Michel Jongbloed

    (@michel-jongbloed)

    Great. Good luck with your feeds!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Today’s date as condition’ is closed to new replies.