DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

tt_products

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Oliver Hofmann
Changed:2003-01-26T23:53:05
Author:Oliver Hofmann
Email:typo3_list@oliverhofmann.de
Info 3:
Info 4:

tt_products

Extension Key: doc_shop

Copyright 2000-2002, Oliver Hofmann, <typo3_list@oliverhofmann.de>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

tt_products 1

Introduction 1

What does it do? 1

FILES 1

Tutorial 2

New Template 2

Site structure 3

Insert Plugins and edit Plugin CODE 4

Filling the product and category list 4

Order tracking 5

A working Shop Module 6

Additional changes and settings 7

Shop Template 7

More than 1 shop on the site... 7

Setup Payment and Delivery: 7

Exclude Payment 7

Setup Order Tracking Status Codes 7

Show Second Price in Front End 8

Note 8

Known problems 8

To-Do list 8

Changelog 9

Introduction

What does it do?

The shop extension (tt_products) enables you to include an online shop in your TYPO3 site. The extension givs you the facility for...

  • Product listings with images and details
  • Shopping basket
  • Payment page
  • Tracking customers order status

FILES

TS Config options

http://typo3.org/doc+M52f5617218a.0.html

productsLib.inc

Property

productsLib.inc

Description

Main class used to display the shopping basket.

Call it from a USER cObject with 'userFunc = user_products->main_products'

products_mail.inc

Property

products_mail.inc

Description

Class for sending HTML-email order confirmations

products_comp_calcScript.inc

Property

products_comp_calcScript.inc

Description

Example 'calculationScript'

products_template.tmpl

Property

products_template.tmpl

products_template_htmlmail.tmpl

Description

Example templates in english.

'.._htmlmail.tmpl' is a HTML-wrap for the HTML-emails sent.

payment_DIBS.php

Property

payment_DIBS.php

Description

Script for interfacing with DIBS (Danish Internet Payment System) in Denmark. You can reach them at http://www.architrade.com/uk/ .

payment_DIBS_template.tmpl

Property

payment_DIBS_template.tmpl

Description

Template file for DIBS payment.

[tsref:plugin.tt_products]

Tutorial

This tutorial describes how to set up the shop extension for Typo3 (tt_products) using the example of a shop for a soccer club. Obviously all file names and paths can, of course, be changed to your own needs.

Before you begin to set up your shop, do this...

  • In your Extension Manager, install the shop extension, or download from the online Repository (simply click on the green cross)
  • Find the file typo3/ext/tt_products/pi/products_template.tmpl and copy this into fileadmin/tmpl_files/products_eur.tmpl
  • Modify this template to suit your needs. You may need to translate the text into your own language.

Now you are ready to set up the shop in the BE (Back End) of Typo3.

New Template

You first need to create template for the shop. You may also need to create a new page in your page tree...

  • To create a new page either click the globe icon or the icon for an existing page. Choose New from the pop-up menu and either Page (inside ), or Click here for wizard and select the location for the new page. Give the page a suitable title, unhide it and click the Save and close icon
  • Create a new template on the new page (or on an existing one). Click the page icon on which you want the template; choose New from the pop-up menu,and from the New record window, click Template ...

img-1

Now you will see the Setup and Constant fields of Template New...

img-2

Enter your template title “ products

In the Constants: field, enter...

plugin.tt_products.file.templateFile = fileadmin/tmpl_files/products_eur.tmpl
  • This will point to your template file you copied & modified earlier
  • Save the template and select Clear all cache from the drop down menu
  • Select Page in the Web module list
  • Click on your page shop page to editit
  • Change the Page type (which is set to Standard by default) to Advanced and save...

img-3

img-4

  • Create a content element on the shop page, in which to insert the products plugin. Select Page in the Web module list
  • Click on your shop page
  • Click Create page content
  • Choose Regular text element ...

img-5

img-6

Change the page Type to Insert plugin from the drop down list, and choose Products from the Plugin list....

img-7

Click the icon to Save and close the new element.

Before we can move forward to configure the plugin we need to create our site structure and define the place where the products should be stored, bought and paid for, and where the order status can be checked by the customer.

Site structure

You now need to create four new pages inside your shop page...

Click on the page icon of your shop page, and select New from the pop-up menu

  • Under Page (inside) click Click here for wizard , and select the position for the new page
  • Change the page type from the drop down list, and name each page, as described below...

img-8

1 - SysFolder - your products will be stored here

2 - Shopping Cart - change the Page Type to Not in menu if you intend to use the shop navigation to move from page to page, or Standard if you want the page to appear in a menu

3 - Cashpoint - change the page type as for the Shopping Cart page

4 - Order status - change the page type as for the Shopping Cart page...

img-9

Insert Plugins and edit Plugin CODE

Now you need to add the products plugin to the pages you just created, and assign the CODE that tells TYPO3 what to use each page for...

  • Select Page in the Web module list, and click on your shop page
  • Either click on the blue text Plugin: Products CODE: or click the edit symbol (pencil)
  • In the CODE field insert LIST to display the products as a list
  • In the Startingpoint field choose Articles from the page tree in the element browser to point the page to where your product data are stored...

img-10

Repeat the above process for each page, editing only the CODE field ( Startingpoint is left blank)....

img-11

Filling the product and category list

Now you are ready to create your products...

  • In the page tree, click the page icon for the SysFolder you created earlier
  • Choose New from the menu. In the New Records window you will see Products and Product category
  • Create your Product categories first ( Sweat Shirts, Caps ) [ Save and close after each one]
  • Then, create your products [ Save and close ], selecting the appropriate category as you go...

img-12 img-13

You have now created categories and products. If you click on List from the Web module and then select the SysFolder , you will see an overview of all available products...

img-14

The shop will work now, but you still need to set up order tracking.

Order tracking

The only thing you need to do for setting up the order tracking is to modify the URL which points to your site where you have put TRACKING as CODE in the product plugin ...

http://[www.yourdomain.de]/?id=[uid_of_your_tracking_page]&type=1 &tracking=###ORDER_TRACKING_NO###

A working Shop Module

The following screenshots are from a German shop therefore the text is translated already. The translation is done directly in yout template file. The currency (EUR = Euro) is also changed manually.

Lets have a look what has been done so far. Both products and the Categories are displayed. If you click on “>>> weiter” (=German; means “next”) which can be set manually in tmpl_files/products_eur.tmpl, you will go to the Shopping Cart after entering an amount (=Anzahl) you want to order...

img-15

The Shopping Cart displayes the ordered products, delivery (Lieferung), payment (Zahlungsweise) and the total price...

img-16

Additional changes and settings

Shop Template

There are three methods of pointing to your custom page layout template...

  • Solution 1: create a template page (NEW – TEMPLATE) and enter manually the constants code as described earlier in the example
  • Solution 2: Go to the Extension Manager and make your modification there. Edit the file "ext_typoscript_constants.txt" - in the first lines you will find "file.templatefile" where you have to replace the path with your own "fileadmin/xxx/xxx" - this will setup the new template file ( products_eur.tmpl ) as default.

In order to set up your custom shop template as defaul write the code mentioned above in your CONSTANTS and SETUP fields of the template Setup. To do so, click Template in the Web module and choose your template page. There your will make your custom settings

Solution 3: Use the constant editor. Category: plugin.products, section: files. There you can change the default template for one sepcific page

More than 1 shop on the site...

If you want different shops with different layouts the third method is the solution. When you want only one shop but with a different layout, go for the first or second.

You can make some modifications to the default template through the template Constant Editor (Category: PLUGIN.PRODUCTS) on your Template page....

  • Click Template in the Web Module and click the “root page” for your shop
  • Select Constant Editor from the drop down menu on the upper right (note - to make modify entries manualy choose Info/Modify from the drop down menu)...
((generated))
Constants:
plugin.tt_products.file.templateFile = fileadmin/your_template_folder/products_eur.tmpl

plugin.tt_products.clickEnlarge = 1
plugin.tt_products.clickEnlarge_basket = 1

plugin.tt_products.priceDecPoint = ,
plugin.tt_products.priceThousandPoint = .

plugin.tt_products.TAXpercentage = 16
plugin.tt_products.displayListCatHeader = 1
plugin.tt_products.displayBasketCatHeader = 1

plugin.tt_products.priceDec = 2
plugin.tt_products.limit = 5

Setup Payment and Delivery:

((generated))
Setup:
# Modification of Shopping Cart Module

plugin.tt_products {
  shipping >
  shipping {
    10.title = Post delivery
  }
  payment >
  payment {
    radio = 1
    10.title = Money transfer
  }
}

The Shipping, Payment and other information can be modified accordingly. If you want to make a condition for payment procedure use excludePayment .

Exclude Payment

For example:

40.title = Pick up in store
40.excludePayment = 10,40

Setup Order Tracking Status Codes

This Error! message appears when the order tracking has not been configured in products_eur.tmpl yet. Just follow the procedure.

img-17

The following codes can be setup manually either by simply copying and modifying this code to your personal needs or using the TypoScript ObjectBrowser ( TOB ).

  • Click TEMPLATE in the Web module and choose your template site
  • Choose TOB from the drop down menu on the upper right side of the BE. There you simply make the according clicks.
SETUP ROOT
-[plugin]
--[tt_products]
---[categoryHeader]
...
---[statusCodes]
...
((generated))
Manual Code
plugin.tt_products.orderEmail_from = shop@yourdomain.de
plugin.tt_products.orderEmail_fromName = TuS Soccer Shop
plugin.tt_products.orderEmail_to = your_email_address@yourdomain.de
plugin.tt_products.currencySymbol = EUR
plugin.tt_products.statusCodes.1 = Order sent to shop
plugin.tt_products.statusCodes.2 = Order recieved and accepted by shop
plugin.tt_products.statusCodes.10 = Shop is waiting for delivery
plugin.tt_products.statusCodes.11 = Shop is waiting for payment
plugin.tt_products.statusCodes.12 = Shop is waiting for additional information from customer
plugin.tt_products.statusCodes.20 = Order sent to customer
plugin.tt_products.statusCodes.30 = Your order can be picked up upon seperate appointment
plugin.tt_products.statusCodes.30 = Your order can be picked up at location at anytime or by appointment
plugin.tt_products.statusCodes.50 = Customter asks for cancellation of order
plugin.tt_products.statusCodes.51 = Message from customer to Shop
plugin.tt_products.statusCodes.100 = Order sent and closed
plugin.tt_products.statusCodes.101 = Order finished/closed
plugin.tt_products.statusCodes.200 = Cancel order

Show Second Price in Front End

To get the second prize from your product information (BE) shown in the FE, insert this in the File: class.tx_ttproducts.php

$markerArray["###PRICE2_TAX###"] =
$this ->priceFormat($this->getPrice($row["price2"]));
$markerArray["###PRICE2_NO_TAX###"] =
$this ->priceFormat($this->getPrice($row["price2"],0));

Add it where the PRICE_TAX and PRICE_NO_TAX is.

Note

If there are FE users registered on the site, and one is logged in, the shop picks up the name, address, telephone number and e-mail address from the FE users db table

Known problems

  • The Shop Plugin uses a predefined Order email. (See typo3/ext/tt_products/ext_typoscript_setup.txt) If not set up correctly all orders are send to this host. If this host exists it catches all privacy information's. Therefore make sure to change your e-mail address
  • Target group: Mostly Developers

To-Do list

Adding information to the tutorial regarding linking/configuring the shop payment system to a payment gateway (e.g. WorldPay etc.)

Make downloads available of translated shop template

Translating shop module in various languages and make it availabel through the extension

Changelog

  • 25-01-2003 - document first published
  • 26-01-2003 - edited error of template file location to typo3/ext/tt_products/pi

img-18 tt_products - 8