Page 1 of 1

Start date - end date

Posted: 04 Mar 2017, 08:00
by wenotine
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

Re: Start date - end date

Posted: 04 Mar 2017, 12:22
by aimeos
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

Re: Start date - end date

Posted: 05 Mar 2017, 11:00
by wenotine
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!

Re: Start date - end date

Posted: 06 Mar 2017, 15:32
by aimeos
Simply run this command every night:

Code: Select all

php artisan aimeos:jobs index/rebuild