Start date - end date

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
wenotine
Posts: 10
Joined: 17 Sep 2016, 15:17

Start date - end date

Post by wenotine » 04 Mar 2017, 08:00

Dear support,

Please help me to solve this issue:

When we upload a product, which has a start date that is different than now, it works fine and I can see the product in the store.

We made our menu regarding the mshop_index_catalog, and we count the products in the mshop_index_catalog table to show the customers, how many products are in a category.

If any product has a start date that is different than now, that product does not go to the index_catalog table, and this is my problem.

After I run aimeos job rebuildIndex, than all those products go to the index_catalog list.

After spent I dont know how many hours to find the exact place, where the products go to the mshop_index_catalog, I coudnt find it :) (nor in the saveItem() nor in the rebuildIndex()...

So, my question is, how and where should I run the rebuildIndex if I want to do this process automatically, so my menu will be always updated even if I have products, that has a different start date than now?

Thank you so much,

Peter

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

Re: Start date - end date

Post by aimeos » 04 Mar 2017, 12:22

I still don't know what you exact problem is. Do you mean that products with a start date in the future are not shown?

The entries for the mshop_index_catalog table are written in the rebuildIndex() method of the index catalog manager:
https://github.com/aimeos/aimeos-core/b ... d.php#L415
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

wenotine
Posts: 10
Joined: 17 Sep 2016, 15:17

Re: Start date - end date

Post by wenotine » 05 Mar 2017, 11:00

Thanks for the reply,

Products in the future shown correctly, but we build our menu according to the mshop_index_catalog table contents:

$product_manager = \Aimeos\MShop\Factory::createManager($context, 'product');
$product_search = $product_manager->createSearch(true);
$product_search->setSlice(0, 1000000);

$catalog_controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' );
$tree_count_list = $catalog_controller->aggregateIndex( $product_search, 'index.catalog.id' );

So we use, the index.catalog.id to build our menu like:

products:
- t-shirt ( 69 pcs)
- shoes ( 51 pcs)

We get the xx pcs numbers from the index.catalog.id

So my question is, how can I manually refresh the index.catalog table and add those items to the table, that are allready shown on the website BUT the index catalog list dont contain them.

Thank you!

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

Re: Start date - end date

Post by aimeos » 06 Mar 2017, 15:32

Simply run this command every night:

Code: Select all

php artisan aimeos:jobs index/rebuild
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply