Publish products in frontend

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
earosb
Posts: 12
Joined: 13 Jul 2016, 15:30

Publish products in frontend

Post by earosb » 13 Jul 2016, 16:00

Hey there,

We are using typo3 7.6.9 and aimeos 16.4.3. We have to add/create the product creation form in the fontend. is there a way to enable the basic mode in the frontend? somehow?

Thanks in advance!

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

Re: Publish products in frontend

Post by aimeos » 13 Jul 2016, 20:44

No, the admin interface is a backend module.

You should create a TYPO3 Extbase frontend plugin with a form for the product details you need, extend your Extbase controller from the Aimeos AbstractController and use the Aimeos product manager to create/update your products.

For the start in your controller action:

Code: Select all

$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

earosb
Posts: 12
Joined: 13 Jul 2016, 15:30

Re: Publish products in frontend

Post by earosb » 14 Jul 2016, 01:49

aimeos wrote: You should create a TYPO3 Extbase frontend plugin with a form for the product details you need, extend your Extbase controller from the Aimeos AbstractController and use the Aimeos product manager to create/update your products.
I did exactly that (i tried), I created some managers for product, price, catalog, etc. but i don't understand how to attach a product with a price for example or how to create a product and see it in the catalog or the index staff.

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

Re: Publish products in frontend

Post by aimeos » 14 Jul 2016, 21:31

It's all about the lists, i.e. the list tables like mshop_product_list.

Use the product lists manager to create entries in the mshop_product_list table, use the product ID as parentid and the ID of the text/price/media as refid. The domain is text/price/media depending on the referenced item and the typeid is almost always the "default" code for the domain in the mshop_product_list_type table.

You can get the typeid via

Code: Select all

$listTypeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/lists/type' );
$textTypeId = $listTypeManager->findItem( 'default', array(), 'text' )->getId();
A product must be in a category to be visible, so add a list item to the category (catalog domain) using the product ID as refid. After everything is complete, the product must be added to the index with

Code: Select all

\Aimeos\MShop\Factory::createManager( $this->getContext(), 'index' )->saveItem( $product );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

earosb
Posts: 12
Joined: 13 Jul 2016, 15:30

Re: Publish products in frontend

Post by earosb » 18 Jul 2016, 20:12

aimeos wrote:A product must be in a category to be visible, so add a list item to the category (catalog domain) using the product ID as refid.
I almost got it, just one last question, how i add a list item to the category? i tried this

Code: Select all

$catalogListManager = \Aimeos\MShop\Factory::createManager( $context, 'catalog/lists' );
But the class Aimeos\MShop\Catalog\Manager\Lists\Standard it doesn't have a create or sets method
I'm still kinda confused with mshoplib, sorry

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

Re: Publish products in frontend

Post by aimeos » 18 Jul 2016, 22:10

Sure, they do! These methods are inherited via the base class.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

earosb
Posts: 12
Joined: 13 Jul 2016, 15:30

Re: Publish products in frontend

Post by earosb » 21 Jul 2016, 13:53

aimeos wrote:Sure, they do! These methods are inherited via the base class.
I made it :D , tranks for the help!

Post Reply