Storing a date for an attribute

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Storing a date for an attribute

Post by cnoelker » 09 May 2020, 14:05

Hi there,
I have an attribute which has a date, e.g. the attribute is "red" and the date field is "delivery from". So, when the user sees the color red, then he gets a notifying text that this color is available from that date.

When I look at the attribute, I can provide a Text field with (my) type "Delivery from". However, the date should be formatted differently, depending on the language of the shop.
So, is it best to fill the "Delivery from" field in the different language formats during the import? Or is there a way to tell aimeos that this is actually a date field and aimeos silently formats this date correctly, depending on the language?

Claudia

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Storing a date for an attribute

Post by aimeos » 11 May 2020, 10:15

Not the color "red" has a delivery date but the article with the variant attribute. The stock items for the products already have a "back in stock" date and in the standard setup, it's already used for exactly what you want :-)

Here you can also format that date as you need it:
[url]https://github.com/aimeos/ai-clien ... rd.php#L96[/url]
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Storing a date for an attribute

Post by cnoelker » 11 May 2020, 11:22

Sorry, the example with "delivery date" was misleading. The dates which I would like to provide for the attribute actually have nothing to do with the delivery date of the item.

Let's see if I can make this clear with another example:
The products are T-Shirts which have an attribute depending on the event for which they are produced.
One of these attribute values is "Festival A" and I would like to store the start and end date of "Festival A" at the attribute.
So, when a user selects a T-Shirt for "Festival A", I would like to display these start and end dates, in the format depending on the language of the user.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Storing a date for an attribute

Post by aimeos » 12 May 2020, 11:41

The easiest way might be to use articles of type "event" with their start and end date. You can also configure them to be available after the end date: https://github.com/aimeos/aimeos-core/b ... #L282-L298
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply