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.

EXT: Shop system (extended by MikloBit)

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2005-05-30T02:23:55
Email:typo3@miklobit.com
Email2:
Info 3:
Info 4:

EXT: Shop system (extended by MikloBit)

Extension Key: mkl_products

Oryginal version Copyright 2000-2002, Kasper Skĺrhřj, <kasper@typo3>

Modifications Copyright 2004-2005, Milosz Klosowicz (Miklobit), <typo3@miklobit.com>

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

EXT: Shop system 1

Introduction 1

Configuration 2

Files: 2

Description 2

Static template 2

productsLib.inc properties 2

Payment and shipping configuration 6

payment_DIBS.php 7

Introduction

Configuration

Files:

productsLib.inc

File

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

File

products_mail.inc

Description

Class for sending HTML-email order confirmations

products_comp_calcScript.inc

File

products_comp_calcScript.inc

Description

Example 'calculationScript'

products_template_en.tmpl

File

products_template_en.tmpl

products_template_pl.tmpl

products_template_htmlmail.tmpl

Description

Example .css driven templates in english.

Example .css driven templates in polish.

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

products_template.css

File

products_template.css

Description

Example .css stylesheet for products template

payment_DIBS.php

File

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

File

payment_DIBS_template.tmpl

Description

Template file for DIBS payment.

payment_ALLPAY.php

File

payment_ALLPAY.php

Description

Script for interfacing with AllPay.pl (Polish Internet Payment System) in Poland. You can reach them at http://www.allpay.pl.

payment_ALLPAY_template_en.tmpl

File

payment_ALLPAY_template_en.tmpl

Description

Template file for AllPay.pl payment (english)

payment_ALLPAY_template_pl.tmpl

File

payment_ALLPAY_template_pl.tmpl

Description

Template file for AllPay.pl payment (polish)

Description

Built-in shopping basket and products display within Typo3. Has a clearing interface which lets you write your own implementation with existing payment-gateways.

Currently there's an implementation with DIBS in Denmark, found at www.architrade.dk .

Currently there's an implementation with AllPay.pl in Poland, found at www.miklobit.com .

There's possible to define alternative language records for products ( title,note,www ) and for categories ( title, note ).

The multicurrency function require mkl_currxrate extension to be configured. All currency pairs has to be defined as mkl_currxrate records at root level.

The mkl_products extension must be used as tt_products !

((generated))
Example:

(See static_template 'plugin.tt_products' for a working configuration)

Static template

plugin.tt_products

productsLib.inc properties

templateFile

Property

templateFile

Data type

resource

Description

The template-file.

See example in 'media/scripts/products_template.tmpl'

Default

pid_list

Property

pid_list

Data type

string /stdWrap

Description

The pid's from where to fetch categories, forums and so on. Default is the current page. Accepts multiple pid's commaseparated!

Default

code

Property

code

Data type

string /stdWrap

Description

Code to define, what the script does. Case sensitive:

TRACKING

BASKET, PAYMENT, FINALIZE, INFO

SEARCH, SINGLE, LIST

Default

defaultCode

Property

defaultCode

Data type

string

Description

The default code (see above) if the value is empty. By default it's not set and a help screen will appear

Example:

plugin.tt_products.defaultCode = LIST

Default

recursive

Property

recursive

Data type

int /stdWrap

Description

Number of recursive levels to select tt_products from in lists.

Default

altMainMarkers

Property

altMainMarkers

Data type

(array of strings)

Description

Lets you specify alternative subpart markers for the various main template designs in the shopping basket system.

This is the list of main subparts you can override:

Properties:

TRACKING_WRONG_NUMBER
TRACKING_ENTER_NUMBER
BASKET_REQUIRED_INFO_MISSING
BASKET_TEMP
ITEM_SINGLE_DISPLAY_RECORDINSERT
ITEM_SINGLE_DISPLAY
ITEM_SEARCH
ITEM_LIST_TEMPLATE
ITEM_SEARCH_EMPTY
BASKET_TEMPLATE
BASKET_INFO_TEMPLATE
BASKET_PAYMENT_TEMPLATE
BASKET_ORDERCONFIRMATION_TEMPLATE
EMAIL_PLAINTEXT_TEMPLATE

/+ stdWrap

Example:

This example changes the main subpart marker for the regular basket display from the default ###BASKET_TEMPLATE### to the custom supplied design ###BASKET_DESIGN2### (found in the same template HTML-file)

altMainMarkers.BASKET_TEMPLATE =  BASKET_DESIGN2
altMainMarkers.BASKET_TEMPLATE.wrap = ### | ###

Default

stdSearchFieldExt

Property

stdSearchFieldExt

Data type

list of fields

Description

Additional search fields

Default internal list is title,note,itemnumber. Any fields you specify is added to these defaults.

Default

limit

Property

limit

Data type

int

Description

Max items displayed. The maximum number of items displayed on one page.

Default

image

Property

image

Data type

IMAGE cObject

Description

The image configuration in single display

Default

listImage

Property

listImage

Data type

IMAGE cObject

Description

The image configuration in list display

Default

basketImage

Property

basketImage

Data type

IMAGE cObject

Description

The image configuration in basket display

Default

noImageAvailable

Property

noImageAvailable

Data type

resource

Description

The image file displayed if no image was attached to a product. This image is processed by the IMAGE cObject which is active in the actual display of that image. That is, one of the above IMAGE cObjects.

Default

datasheetIcon

Property

datasheetIcon

Data type

IMAGE cObject

Description

The image for datasheet icon file

Default

Pdf icon

displayListCatHeader

Property

displayListCatHeader

Data type

boolean

Description

Display Category Header in list

If this option is set, the category headers (page titles) will automatically be displayed in the product lists. This is not always convenient because you might have chosen a header-title for the "list" content element.

Default

displayBasketCatHeader

Property

displayBasketCatHeader

Data type

boolean

Description

Display Category Header in basket.

If this option is set, the category headers (page titles) will automatically be displayed in the basket lists.

Default

itemMarkerArrayFunc

Property

itemMarkerArrayFunc

Data type

function-name

Description

Every time a product is display be it in the basket, list of single, the method getItemMarkerArray() in user_products is called. This function fills in and returns an array, socalled markerArray(), with key/values for template substitution.

If you enter a valid function name here (see datatype 'function-name' for details!) that array will be passed to that function as the second parameter. The first parameter will be the TypoScript properties to itemMarkerArrayFunc.

Parent PHP-Object reference:

.parentObj property is hardcoded to be a reference to the calling user_products object (PHP).

Example:

(provided that a function or class is included!)

itemMarkerArrayFunc = user_addFieldsMarkerArr
itemMarkerArrayFunc.simpleOption = 1

Default

PIDitemDisplay

Property

PIDitemDisplay

Data type

int+

Description

PID for single item display.

If you want a certain page to be used for display of item details, please enter the PID (page-uid) here.

Default

PIDsearch

Property

PIDsearch

Data type

int+

Description

PID for search page.

If you want all product searches to go to a specific page, enter the PID it here! NOTE: If you set this PID, all searchqueries will (must) be handled with a list content element with the code "search" on that page.

Default

PIDbasket

Property

PIDbasket

Data type

int+

Description

PID for basket page.

If you want every change in the number of items anywhere to go to a specific page (eg. the shopping basket page), enter the PID here.

Default

PIDstoreRoot

Property

PIDstoreRoot

Data type

int+

Description

PID for store root.

This is the PID of the rootPage of the store. If not set the store will operate over all pages from the root of the site. But if the site has many pages, performance may improve.

Default

PID_sys_products_orders

Property

PID_sys_products_orders

Data type

int+

Description

PID for the sys_products_orders records. By default they will get the pid of the payment (finalize) page.

Default

PIDinfo

Property

PIDinfo

Data type

int+

Description

PID for the info page where name and address is entered.

Default

PIDfinalize

Property

PIDfinalize

Data type

int+

Description

PID for the confirmation page where the user confirms right before payment.

Default

PIDthanks

Property

PIDthanks

Data type

int+

Description

PID for the thanks page.

Default

advanceOrderNumberWithInteger

Property

advanceOrderNumberWithInteger

Data type

int+ , int+

Description

If this value is set, then each time a new order is created the order- number counter will be incremented with a random number between [first-integer] and [second integer].

Example

1,10   (This will increment the counter randomly between 1 and 10)
5,5    (This will increment the counter with 5 each time)

Default

parseFunc

Property

parseFunc

Data type

->parseFunc

Description

The product details are parsed by these properties.

Default

categoryHeader

Property

categoryHeader

Data type

cObject

Description

Generates the category header.

Example:

categoryHeader = TEXT
categoryHeader.current = 1

Default

TAXpercentage

Property

TAXpercentage

Data type

double

Description

Sales TAX/VAT percentage.

Double value (!) (means, "use . as decimal point")

Example:

# Danish sales TAX is 25%:
TAXpercentage = 25.00

Default

TAXincluded

Property

TAXincluded

Data type

boolean

Description

Set this, if TAX is included in the database prices! ( ... and of course: Clear this, if TAX is not included in the database prices and should be added in the display of items)

All processing will take this flag into account and calculate prices accordingly.

Default

TAXeu

Property

TAXeu

Data type

boolean

Description

If set , VAT is excluded from payment in two cases:

1. Seller and buyer country are both within EU and buyer is company with valid VAT registration number.

  1. Seller is within EU , while buyer is located outside EU.

Default

priceDec

Property

priceDec

Data type

int

Description

Price decimals

Default

priceDecPoint

Property

priceDecPoint

Data type

string

Description

Price decimal point

Default

.

priceThousandPoint

Property

priceThousandPoint

Data type

string

Description

Price Thousand point

Enter the thousand separator, if any.

Default

currencySymbol

Property

currencySymbol

Data type

string

Description

Currency symbol. Used in shop administration.

Example:

DKR
USD
$

Default

lockLoginUserInfo

Property

lockLoginUserInfo

Data type

boolean

Description

If set and a user is logged in, the address info of that fe_user is 'hardcoded' as billing address of the user.

Default

requiredInfoFields

Property

requiredInfoFields

Data type

list of string

Description

List of the fields which are required in the address information

Default

orderNumberPrefix

Property

orderNumberPrefix

Data type

string

Description

Prefix to the order numbers. Dont use spaces or special chars. Max 10 chars.

Default

orderEmail_from

Property

orderEmail_from

Data type

string

Description

From email address for the confirmation email to customer

Default

orderEmail_fromName

Property

orderEmail_fromName

Data type

string

Description

From name for the confirmation email to customer.

Default

orderEmail_to

Property

orderEmail_to

Data type

list of email-addresses

Description

Comma list of recipients of the order email. Shop and administrator/supervisor email addresses go here!

Default

orderEmail_htmlmail

Property

orderEmail_htmlmail

Data type

boolean

Description

If set, the order confirmation email is sent as HTML

Default

email_notify_default

Property

email_notify_default

Data type

boolean

Description

If email-notification for the customer is enabled by default (he can change it himself in the tracking module later)

Default

statusCodes

Property

statusCodes

Data type

Array of integers

Description

Status codes used in the tracking module.

Numbers above 100 removes the order from the tracklist.

Number zero is the status of a non-finalized order (and non-finalized orders in the database may by time be regarded as garbage...)

Numbers of 50-59 is available for the customer to choose from.

Number 1 is reserved to be selected when an order goes from zero to 1 because it's confirmed. Number 1 cannot be selected by shop admin.

Example:

statusCodes {
    1 = Order submitted by user
    2 = Order is received and accepted by store
    10 = Shop is awaiting goods from third-party
    11 = Shop is awaiting customer payment
    12 = Shop is awaiting material from customer
    20 = Goods shipped to customer
    30 = Other message from store
    50 = Customer request for cancelling
    51 = Message from customer to shop
    100 = Order shipped and closed
    101 = Order closed
    200 = Ordre cancelled
}

Default

update_code

Property

update_code

Data type

string

Description

The 'password' used by the administrator of the shop to go into the tracking system in the front end.

The password form field will appear if a BE_USER is logged in, but this password is still needed.

Default

statusDate_stdWrap

Property

statusDate_stdWrap

Data type

->stdWrap

Description

stdWrap for status date

Example:

%e-%m-%y %H:%M

Default

orderDate_stdWrap

Property

orderDate_stdWrap

Data type

->stdWrap

Description

stdWrap for the order date

Example:

%e-%m-%y

Default

displayCurrentRecord

Property

displayCurrentRecord

Data type

boolean

Description

If set, certain settings are manipulated in order to let the script render a single item - the $cObj->data.

If this setting is set, the subpart marked ###ITEM_SINGLE_DISPLAY_RECORDINSERT### will be used instead of the regular subpart ###ITEM_SINGLE_DISPLAY### if it's found.

Default

externalProcessing

Property

externalProcessing

Data type

cObject

Description

This cObject may be used to call a function which manipulates the shopping basket. This manipulation could be based on settings in an external order system. The output is included in the top of the order (HTML) on the basket-page.

This cObject is executed each time the main_products method of the user_products class in productsLib is called and it's executed before any of the main processing. See the class for details.

Default

externalFinalizing

Property

externalFinalizing

Data type

cObject

Description

This cObject may be used to call a function which clears settings in an external order system. This is a sister to the above function and they should probably be used in conjunction somehow. This function is called immediately after the finalize-function has been called.

For instance this function would be suitable for clearing any external basket facilitated by the .externalProcessing cObject

Note: The output is NOT included anywhere.

Default

wrap1

Property

wrap1

Data type

-> stdWrap

Description

Global Wrap 1. This will be splitted into the markers ###GW1B### and ###GW1E###. Don't change the input value by the settings, only wrap it in something.

Example:

wrap1.wrap = <b> |</B>

Default

wrap2

Property

wrap2

Data type

-> stdWrap

Description

Global Wrap 2 (see above)

Default

color1

Property

color1

Data type

string /stdWrap

Description

Value for ###GC1### marker (Global color 1)

Default

color2

Property

color2

Data type

string /stdWrap

Description

Value for ###GC2### marker (Global color 2)

Default

color3

Property

color3

Data type

string /stdWrap

Description

Value for ###GC3### marker (Global color 3)

Default

payment / shipping

Property

payment / shipping

Data type

(see below)

Description

Configuration of payment and shipping methods, their values and costs and additional calculation scripts and payment gateways.

See description below!

Default

[tsref:(script).productsLib]

Payment and shipping configuration

Payment and shipping are very similar in configuration and therefore shared the same property list with special notes if something is for the one type only. The configuration of payment and shipping is in short a question of defining the items to chose from on the basket page. That is, a choice of one out of many transportation methods and one out of many payment methods. Therefore you can for instance select either radio-button representation or selector box.

The number of the selected payment method or shipping method is reflected in the html-template certain places and you may also want special PHP scripts executed based on the settings. That's all allowed.

radio

Property

radio

Data type

boolean

Description

If set, you get radio button layout. If not, selector-box.

Default

0

template

Property

template

Data type

string

Description

(Radio layout only)

If .radio is true, this string is the 'template' for the radio items.

Default is (in one line):

<nobr>###IMAGE### <input type="radio" name="recs[tt_products]['.$key.']" onClick="submit()" value="###VALUE###"###CHECKED###> ###TITLE###</nobr><BR>

Default

wrap

Property

wrap

Data type

Description

(Select layout only)

If .radio is false, this string wraps the <option> tags in a <select>-tag!

Default is (in one line):

'<select name="recs[tt_products]['.$key.']" onChange="submit()">|</select>'

Default

Array of integers

Property

Array of integers

Data type

Description

Configuration, see below

Examples:

10.title = Credit card
10.image.file = media/logos/dankort.gif
10.priceTax =
10.priceNoTax =
10.percentOfGoodstotal = 0
10.calculationScript = media/scripts/products_comp_calcScript.inc

30.title = By mail
30.image.file = media/logos/postdanmark.gif
30.priceTax = 40
30.priceNoTax = 32

Default

title

Property

title

Data type

string

Description

Title of item, eg. “Master card” or “Ground mail”

Default

image

Property

image

Data type

IMAGE cObject

Description

Logo image for the item

Default

priceTax

Property

priceTax

Data type

double

Description

Price of item, including VAT

(notice you have to calculate the VAT amount here by yourself!)

Default

priceNoTag

Property

priceNoTag

Data type

double

Description

Price of item, excluding VAT

(notice you have to calculate the VAT amount here by yourself!)

Default

percentOfGoodstotal

Property

percentOfGoodstotal

Data type

double

Description

Price of item, calculated from a percentage of the total amount before payment/shipping

Default

calculationScript

Property

calculationScript

Data type

resouce

Description

PHP script which is included in a “blank” function and it should be written to manipulate amounts in the internal arrays.

This script could be used to calculate a special fee regarding a payment/shipping item.

For an example of application, see media/script/products_comp_calcScript.inc which shows you how to raise the final amount with 5.75% of it's own value as to compensate for fees to international credit card organisations.

Properties of the calculation script is passed to the function as $conf array.

Default

handleScript

Property

handleScript

Data type

resource

Description

PHP script which is included in a “blank” method called from products_basket() in user_products class when the order is finalized.

This function must take care of displaying templates during the payment process with a payment gateway as well as finalizing the order afterwards.

See media/scripts/payment_DIBS.php for an example. A HTML-template file follows.

Properties of the handle script is passed to the function as $conf array. The content of the variable $content is returned as content.

Default

handleURL

Property

handleURL

Data type

string

Description

If set, this handleURL is called instead of the THANKS-url (by PIDthanks) in order to let eg. a handleScript process the information if payment by credit card or so.

Default

handleTarget

Property

handleTarget

Data type

string

Description

Alternative target for the form.

Default

excludePayment

Property

excludePayment

Data type

list of integers

Description

shipping ONLY:

This is a list of payment method keys (their numbers) which are not available given a certain delivery form. For instance if people pick up goods in the store, you don't want them to transfer money or pay online but just order the goods. So you can exclude those payment methods.

Example:

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

Default

show

Property

show

Data type

boolean

Description

If set, the item is showed in the list.

Default

1

[tsref:(script).productsLib.payment/(script).productsLib.shipping]

payment_DIBS.php

Properties of the handleScript for DIBS interfacing (http://www.architrade.com/uk/):

templateFile

Property

templateFile

Data type

resource

Description

Template file for use with DIBS

Default

soloe

Property

soloe

Data type

boolean

Description

If set, the script uses sub-template with marker ###DIBS_SOLOE_TEMPLATE### instead of the default which is ###DIBS_CARDNO_TEMPLATE###

Default

merchant

Property

merchant

Data type

string

Description

Merchant id

Default

currency

Property

currency

Data type

int

Description

Currency number, ISO4217 format

Default

relayURL

Property

relayURL

Data type

URL

Description

The url of the shop where their secure server is going to fetch the basket.

Default

test

Property

test

Data type

boolean

Description

If set, the test-field is set in the forms.

Default

cardType

Property

cardType

Data type

string

Description

Card type,

Example values:

DK = Dankort
V-DK = Visa-Dankort
MC(DK) = Mastercard/Eurocard issued in Danmark
VISA = Visakort issued abroad
MC = Mastercard/Eurocard issued abroad
DIN(DK) = Diners Club, Denmark
DIN = Diners Club, international

Default

account

Property

account

Data type

string

Description

DIBS account feature

Default

addOrderInfo

Property

addOrderInfo

Data type

boolean

Description

If set, order info is added to the form. DIBS can pickup this info and simply display if with the payment information.

Default

k1

Property

k1

k2

Data type

string

Description

DIBS key values

Default

[tsref:(script).productsLib.paymentDIBS]

((generated))
Example of a configuration from Inter-Photo A/S (www.inter-photo.dk):
xxxxx.xxxx {
  10.title = Dankort, VISA-Dankort
  10.image.file = media/logos/dankort.gif
  10.image.params = align=absmiddle vspace=2
  10.handleScript = media/scripts/payment_DIBS.php
  10.handleScript {
    merchant = xxxxx
    test = 0
    k1 = xxxxx
    k2 = xxxxx
    currency = 208
    addOrderInfo = 1
    account =
    cardType = DK,V-DK
    relayURL = http://www.inter-photo.dk/index.php?id=204
  }
  10.handleURL = index.php?204
  10.handleTarget = _top

  20 < .10
  20.title = Unibank e-betaling
  20.image.file = media/logos/soloe.gif
  20.handleScript.soloe=1
}

img-1 EXT: Shop system (extended by MikloBit) - 7