Questions around the TYPO3 integration and plugins as well as Flow and NeosCMS
Forum rules: Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#1554 by alpin3rocker
18 Apr 2015, 12:25
Hello,

to make a bookable article i use a selection-article with maybe 20 default-articles, one for each day and a different price for each article.
This is a lot of work to make 10-20 and more selection-articles and a default-article for each day..
How can this effort be minimized?

You wrote in one of your earlier posts:
The (sub-)products should be created by a script to minimize the manual efforts.

How can i do this?

Thank you!
#1555 by aimeos
18 Apr 2015, 12:48
alpin3rocker wrote:to make a bookable article i use a selection-article with maybe 20 default-articles, one for each day and a different price for each article. How can this effort be minimized?


First, you don't have to attach a price to each article if they are not all different. You can also assign the default price to the selection product itself. Then this priced will used as long as the selected article don't have it's own price.

alpin3rocker wrote:This is a lot of work to make 10-20 and more selection-articles and a default-article for each day..
You wrote in one of your earlier posts:
The (sub-)products should be created by a script to minimize the manual efforts.

How can i do this?


Now you need get a bit deeper into the data structures :-)

If you need to create those products or extend the list regularly, I would suggest to create a job controller in controller/jobs/src/Client/Html/Product/ that does this for you. You can use the MShop_Product_Manager_Factory::createManager() to return a product manager that can create items, populate it with your properties and save it to the database. The setup tasks for the "unitperf" site in lib/mshoplib/setup/unitperf are a good real world example for this.

If you simply want to do this once for a whole year, I would suggest to write a script that creates the SQL statements for inserting the articles into the database.