List items explanation
Posted: 12 Sep 2019, 05:14
Good morning, Aineos community.
I need little help with understanding of DB structure of lists.
I am trying to create short text and attach it to new created product.
it adds rows to the mshop_text and mshop_text_list tables. But texts are not shown in front-end. And the mshop_index_text table is empty.. But I did index rebuilding..
But when I add demo data with then the texts are shown, but mshop_text and mshop_text_list tables don't consists data regarding texts! Seems texts data only inside : mshop_index_text table.. So what is mshop_text_list for ? This table stores temporary data which will be deleted by aimeos after it creates data in mshop_index_text table ?
Please make it clear for me. Great thank you!
I noticed if I add:
It works!
Also I would like to ask how can I delete all prices for specific product ? I mean data from all related tables. Price, price_list, price_index ?
I need little help with understanding of DB structure of lists.
I am trying to create short text and attach it to new created product.
Code: Select all
$textItem = $textManager->createItem();
$textItem->setDomain('text');
$textItem->setType('short');
$textItem->setLanguageId('de');
$textItem->setContent($shortDescription);
$textItem->setLabel(substr($shortDescription, 0, 255));
$textItem->setStatus(1);
$textManager->saveItem($textItem);
$textListItem = $textListsManager->createItem();
$textListItem->setParentId($textItem->getId());
$textListItem->setDomain('text');
$textListItem->setType('default');
$textListItem->setStatus(1);
$textListItem->setRefId($product->getId());
$textListsManager->saveItem($textListItem);
$indexManager = \Aimeos\MShop\Index\Manager\Factory::create($context);
$indexManager->rebuildIndex();
$indexManager->optimize();
But when I add demo data with
Code: Select all
php artisan aimeos:setup --option=setup/default/demo:1
Please make it clear for me. Great thank you!
I noticed if I add:
Code: Select all
$product->addListItem( 'text', $textListItem, $textItem );
$this->productManager->saveItem($product);
Also I would like to ask how can I delete all prices for specific product ? I mean data from all related tables. Price, price_list, price_index ?