TYPO3 Reea Blog

This will be shown to users with no Flash or Javascript.

Implementare TypoGento

TYPO3

The Extension for TYPO3 can be found in the official TER. The Extensionkey is fb_magento. 

Follow this link to get there.

Magento

The Extension for Magento can be found on the Magento-Connect Website.

Follow this link to get directly to the Extension-Site

Foreword

This documentation describes the general installation and configuration process for TypoGento. It does not contain any installation or configuration information concerning TYPO3 or Magento. The information given were retrieved and tested in TYPO3 version 4.2.3 and Magento Commerce version 1.2.0.2. The information should be valid for newer versions as well, but we cannot garantuee compatability. Plugin configuration might need to be changed to run them other versions.

Installation of the Magento module

Magento Commerce website (http://www.magentocommerce.com) offers a useful Module repository called Magento Connect. There you can find the extension with all its information including the extension key. You’ll need to copy the key to your clipboard and switch to Magento administration backend. There you can find option Magento-Connect in Menu System.
In the Magento Connect Manager you need to choose option “Beta“ as preferred state (since to this date Magento is still a Beta version). Without this setting you won’t be able to find the module until it’s published in a first stable version (which might take another couple of months).
After that you can paste the copied extension key to the search interface. The interface will – if the system was installed using the correct file rights – automatically install the Magento module. You can test your installation status by checking the system configuration: If everything went fine, there’ll be another menu item called TYPO3 Connector.

At the time being you can enter the following information in the Magento TYPO3 Connector settings:

  1. The TYPO3 sysfolder UID where backend users are to be saved. This should be entered if you want to enable your users to log in to Magento and TYPO3 using the same user credentials in a single-sign-on environment. If the Page ID is correct, Magento automatically creates TYPO3 fe_users datasets on that page.
  2. The usergroup UID for all created users. This makes it possible to define users’ rights on a group basis.
  3. Additional add the DB-Information of TYPO3

API-Users in Magento

API-Users in Magento

YPO3 backend accesses Magento via Magento API. To be able to do so, it’ll need a Magento API user. Those users are spezial users that can only access the API interface and they are the only users that are allowed to use the API interface as well, so you’ll need them – even Admin users won’t work!
To add API users use the menu item Webservice in the system menu. You can add specific users’ rights to keep your application as secure as possible (no user should ever have more rights that he needs!). So first chose option group rights and chose a good name, for example TYPO3.
Afterwards you’re shown a source tree to define the user group’s rights. Give the User "All" rights.
After saving these user group information we can continue adding an API user. To do so we chose option user in System’s Web Services menu item. Over here you are to enter all requested user information like username, password, e-mail address and activity status. The user is given the new group’s user rights. You should note down the information for the later usage in TYPO3 backend.
At this point the Magento configuration is finished and we can go on with TYPO3.

Preperation of TYPO3

Preperation of TYPO3

After installing the extension there is a configuration part within the Extension Manager. Since TypoGento works using PHP includes you’ll need to enter the correct local path to Magento to run it. (f.e. /home/html/magento/). Additionally you’ll need to enter the web address for the store (f.e. www.mydomain.com/magento/) as well as API user information (the information you were asked to note down earlier).
The last option given let’s you add all Magento headers to your TYPO3 headers automatically. You may also do this manually via TypoScript. In our example we’ll deactivate this option and include the code later.


Enable the RealUrl configuration if you like to...

Configuration for the Front-End

We add the following TypoScript Code to the template of the shop site.
This should in principle enable TYPO3 to feature product views and further functionality.

includeLibs.user_tx_fbmagento_pi1 = EXT:fb_magento/pi1/class.tx_fbmagento_pi1.php
page.headerData.30 = USER_INT
page.headerData.30 {
userFunc = tx_fbmagento_pi1->main
block=typo3header
}

 

Integration of Magento blocks

The TYPO3 extension is capable to show every block to the public that Magento offers. This documentation will demonstrate this by including the Block “right“. Every TypoGento installation will need to include this block because it is needed in the order process (it also includes Javascript for the Onepage Checkout).
If your TYPO3 installation uses the old school TypoScript Engine, the extension’s output can be written directly into a subpart. This is shown by the following code example, which fills the block into the contentright subpart.


page.10.subparts.contentright = USER_INT
page.10.subparts.contentright {
      userFunc = tx_fbmagento_pi1->main
      block=right
      nowrap=1
    }

You can also use TypoGento with the more modern Template solution TemplaVoila. Instead of passing the output information to directly to a subpart, it is stored in a library variable, which is later passed to a mapped XHTML area within the template. This code will store the extension’s output in the lib.contentright variable.


lib.contentright = USER_INT
lib.contentright {
      userFunc = tx_fbmagento_pi1->main
      block=right
      nowrap=1
    }


Please notice, that it is necessary to have a <div class="col-right side-col"> around your right block. This can be archived by putting this div-class into the html-Template or to use a COA.

Example:

Old Fashioned Templating:
page.10.subparts.contentright = COA
page.10.subparts.contentright {
10 = TEXT
10.value = <div class="col-right side-col">
20 = USER_INT
20{
userFunc = tx_fbmagento_pi1->main
block=right
nowrap=1
}
30 = TEXT
30.value = </div>
}


Templavoila:
lib.contentright = COA
lib.contentright{
10 = TEXT
10.value = <div class="col-right side-col">
20 = USER_INT
20{
userFunc = tx_fbmagento_pi1->main
block=right
nowrap=1
}
30 = TEXT
30.value = </div>
}

Block top.links

Block top.links

If you like to add the block "My Account |My Cart | Checkout | Sign in" into your Template, this can also be done using TS:

lib.toplinks = USER_INT
lib.toplinks{
    userFunc = tx_fbmagento_pi1->main
    block=top.links
    nowrap=1
}

Magento-Shop Frontend Plugin in TYPO3

There are two possibilities to add the Magento shop to TYPO3. The first one includes the category tree (or parts of it) as well as the product overviews and details. This is supposed to be the way it is done most of the time.

Additionally it is possible to output a single product if needed, so every product may be presented within its own TYPO3 page mixed up with other elements like texts, formulars and images. In general this is only recommended in shops with a low number of products since this comes with a higher administration effort.
Please note that only frontend functionality can be included, product and category administration can not be included into TYPO3 frontend or backend. In effect, this would not even make sense, because Magento has an optimized interface to solve administration.

Modell 1

TypoGento brings an adapter for TYPO3 HMENU to integrate the category tree as a TYPO3 menu. To access its functionality use the following TypoScript code user function:

includeLibs.user_tx_fbmagento_navigation = EXT:fb_magento/lib/class.tx_fbmagento_navigation.php
lib.magentonavi = HMENU
lib.magentonavi{ 
      special = userfunction
      special{
      userFunc = user_tx_fbmagento_navigation->categories
      pid=7
      startcategory=3
      }
   expAll = 0
   1 = TMENU
   1 {
      itemArrayProcFunc  = user_tx_fbmagento_navigation->clear
      wrap = <ul style="text-align: left">|</ul>
      noBlur = 1
      expAll = 1
      wrap = <ul id="sub-level1">|</ul>
      NO {
         wrapItemAndSub = <li class="first">|</li> |*| <li>|</li> |*| <li class="last">|</li>
         }
     }
}

As you can see the HMENU’s special parameter gets the TypoGento user function, the TypoGento Page ID as well as the start category within the Magento category tree.
The menu does only make sense if the category content is shown on the linked page. This is achieved by adding a TypoGento frontend plugin to the pages content. To do so one needs to switch to the Page (old template engine) or Page TV (TemplaVoila) module and add a “Plugin element” to one of its content areas. In the resulting content you need to choose “Product list” and define the starting category. It is recommended to choose a category that fits to the menus start category

Languages

After installing the Extension in TYPO3 you will have the possibility to add store views to website-languages in TYPO3. The default language in TYPO3 is equal to the default Language in Magento.

If you edit a Language in TYPO3, you will find a dropdown where you can select store views of Magento. Simply choose the store view which fits the language in TYPO3.

blog comments powered by Disqus

De reținut

A se controla dacă a fost instalat SOAP pe server.

A se verifica dacă funcționează linkul:  http://www.instalaremagento.com/api/?wsdl

Dacă nu funcționează se modifică in fișierul:
typo3conf/ext/fb_magento/lib/ class.tx_fbmagento_soapinterface.php 
linia 27 inlocuit private
$urlPostfix = 'api/soap/?wsdl';
cu private
$urlPostfix = 'index.php/api/soap/?wsdl';

Important!

Trebuie creat un user de admin in TYPO3 BE, care trebuie ca la tab-ul extend sa fie setat la Magento Role -> Administrator.

Ca sa funționeze, trebuie să se facă logarea in BE de TYPO3 cu userul acesta