CSV Import product ctime / create date

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!
yacms
Posts: 16
Joined: 07 Jun 2018, 13:31

CSV Import product ctime / create date

Post by yacms » 18 Jun 2018, 22:36

Hi everyone,

TYPO3 CMS Version: 8.7.9
Aimeos Version: 18.4.1

Typoscript Import settings:

Code: Select all

plugin.tx_aimeos {
    settings {
        controller.jobs.product.import.csv.container.type = Directory
        controller.common.product.import.csv.separator = ,
        controller.jobs.product.import.csv.skip-lines = 1
        controller.jobs.product.import.csv {
            location = /var/www/vhosts/helios-verlag.com/staging.helios-verlag.com/typo3temp/aimeos/
            mapping {
            item {
               0 = product.code
               1 = product.label
               2 = product.type
               3 = product.status
               31 = product.ctime
            }
            text {
               4 = text.type
               5 = text.content
               6 = text.type
               7 = text.content
            }
            media {
               8 = media.url
            }
            price {
               9 = price.currencyid
               10 = price.quantity
               11 = price.value
               12 = price.taxrate
            }
            attribute {
               13 = attribute.code
               14 = attribute.type
            }
            product {
               15 = product.code
               16 = product.list.type
            }
            property {
               17 = product.property.value
               18 = product.property.type

               #Seitenzahlen
               19 = product.property.value
               20 = product.property.type

               #booksize
               23 = product.property.value
               24 = product.property.type

               #binding
               25 = product.property.value
               26 = product.property.type

               #no_of_pictures
               27 = product.property.value
               28 = product.property.type

               # reviews
               29 = product.property.value
               30 = product.property.type
            }
            catalog {
               21 = catalog.code
               22 = catalog.list.type
            }
            }
        }
   }
}
One of my CSV Rows:

Code: Select all

"item code","item label","item type","item status","text type","text content","text type","text content","media url","price currencyid","price quantity","price value","price tax rate","attribute code","attribute type","subproduct code","product list type","property value","property type","property value","property type","catalog code","catalog list type","property value","property type","property value","property type","property value","property type","property value","property type","crdate","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""
"5","XXXTITLE","default","1","short","XXXDESCRIPTION","long","XXX","XXX.jpg","EUR","1","14.95","7","","size","","default","3-933608-74-0","isbn","257","number_of_pages","2,6","","21 x 13,5","booksize","Paperback","binding","","no_of_pictures","12,13,14,15,16,17,98,256,257,258,413,414,415,457,848,876,1089","reviews","1140119192","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""
I want to sort products by "newest" in frontend, so i tried importing ctime, any idea what i am doing wrong?

yacms :)

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

Re: CSV Import product ctime / create date

Post by aimeos » 20 Jun 2018, 07:22

"ctime" is a property automatically set in all items and which you modify in the import. Guess you have publications you want to sort by their release date?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

yacms
Posts: 16
Joined: 07 Jun 2018, 13:31

Re: CSV Import product ctime / create date

Post by yacms » 21 Jun 2018, 08:05

https://imgur.com/a/NpW9Rbu

Hi, thanks for your reply. Correct i want to order bei create date, how do i set the create date properly at the import?

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

Re: CSV Import product ctime / create date

Post by aimeos » 21 Jun 2018, 08:51

At the moment, you can't. It would be possible if a setTimeCreated() method would be implemented in the product item.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

yacms
Posts: 16
Joined: 07 Jun 2018, 13:31

Re: CSV Import product ctime / create date

Post by yacms » 26 Jun 2018, 07:24

Would it be possible to sort by "newest" if i import the create date as start date in aimeos? Is "timestamp" correct format as startdate?

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

Re: CSV Import product ctime / create date

Post by aimeos » 26 Jun 2018, 19:14

No, that won't work because "startdate" limits the availability of products in the frontend but has no influence on sorting. The "startdate" value must be an ISO date value in "YYYY-MM-DD HH:mm:ss" format.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

yacms
Posts: 16
Joined: 07 Jun 2018, 13:31

Re: CSV Import product ctime / create date

Post by yacms » 02 Jul 2018, 21:43

Hi, maybe i found a possible workaround. If i delete all already imported products, sort the CSV by Date und reimport the CSV, the create date should be sorted like before?

I really need to be able to sort by newest / date :(

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

Re: CSV Import product ctime / create date

Post by aimeos » 03 Jul 2018, 10:30

Well, you need to extend the product item by a setTimeCreated() method. If you can't do it yourself, you may ask the Aimeos company to do it for you: https://aimeos.com/support/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

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

Re: CSV Import product ctime / create date

Post by aimeos » 03 Aug 2018, 10:37

The dev-master version contains the necessary changes to import and modify product creation times.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

yacms
Posts: 16
Joined: 07 Jun 2018, 13:31

Re: CSV Import product ctime / create date

Post by yacms » 11 Sep 2018, 13:39

Hi, thanks for integrating this feature!

Since my workaround is a really dirty solutions i now want to import all my products with the correct date.

Just to sum up this post:

startdate = not used for sorting in frontend since it limits the availability of products (by "newest") [FORMAT: YYYY-MM-DD HH:mm:ss]
createdate = responsible for sorting in frontend. [FORMAT: YYYY-MM-DD HH:mm:ss]

How can i map the createdate in my import?

Post Reply