Hey Wesley, what I would do is use field injection to add the time fields
to Product and then monkey patch active method of the DiscountManager (
https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/managers.py#L212)
to also check the current time against the newly injected time fields.

On Sun, Nov 30, 2014 at 1:08 AM, Wesley <[email protected]> wrote:

> Hi guys,
>   I have a question regarding Product's valid_from and valid_to field.
> Currently, I see we can control product's visibility by setting its
> valid_from and valid_to field.
>
> I see they are DateTime filed, i.e. I have to set both date and time part,
> and, product shows all the time through the given datetime period.
>
> However, currently, I have a requirement that set the visibility by Time,
> instead of DateTime,
> I mean, show the product through a specified time period every day, for
> example, display the product 08:00 - 16:00 every day.
>
> Is there anyway to achieve this without changing Mezzanine/Cartridge
> source code?
>
> Thanks.
> Wesley
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to