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: zk_products

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Klaus Zierer
Changed:2004-08-30T00:25:31
Author:Klaus Zierer
Email:zierer@pz-systeme.de
Info 3:
Info 4:

EXT: zk_products

Extension Key: zk_products

Copyright 2000-2002, Klaus Zierer, <zierer@pz-systeme.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

EXT: zk_products 1

Introduction 1

Before you start 1

What does it do? 1

Screenshots 2

Users manual 4

FAQ 6

Adminstration 6

FAQ 6

Configuration 6

FAQ 6

Reference 6

Tutorial 7

Known problems 7

To-Do list 7

Changelog 7

Important guidelines 8

Issues with Open Office documentation for TYPO3 8

Inserting images 8

Paragraph styles 8

Linking 9

Meta data and updates 9

Introduction

Before you start

Attention ! zk_products cannot be installed like any other extension. zk_products must replace tt_products! Here is a step by step installation guide:

Download zk_products from the extension repository and save it as a global extension !

Backup and delete (or rename) your original tt_products extension

Rename zk_products to tt_products

Install tt_products (or, if you had tt_products already installed first uninstall tt_products and reinstall)

What does it do?

zk_products is an extended version of tt_products, the shop extension in TYPO3. The extension givs you the facility for...

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

If you already know tt_products, here is, what is new in zk_products

  • Different tax percentages per item
  • Rudimantary stock management
  • Send a CSV for each order to the shop admin (2 choosable file formats)
  • E-Mail-Attachments for the confirmation mails (for example AGB in german = General trading conditions)
  • choosable Item variants (colors and sizes by default)
  • Force customer to accept the General trading conditions (AGB) per checkbox
  • Offers, highlights and newly added items
  • Special preparation, weight and bulkily (can be used to calculated the shipping fee)
  • Ability to limit payment methods to specific user groups
  • Automatic creation of frontend users at first order
  • Remeber items in a memo, when a user is logged in
  • Discount percentage per user

Screenshots

Sorry, no screenshots! I made some, but...

The content to be stored had a compressed size of 442 K and thereby exceeded 100 K which is the limit for this extension!

Update: Screenshots are available here: http://www.ziererk.de/zk_products/

:-(

Users manual

There are multiple ways to create a shop. The old way (in my opinion) is to create sysfolders for the products and list and single sites where there products are displayed. If you want to do a bigger shop with typo3, this will become a little bit unhandy.

Here is the way, I build the shop for our customers:

Forget the original Shop Categories. I only use them for manufacturer separation. What I call “categories” are pages. Create a page hirachy like this:

Create extended pages and choose “Shop” at contains plugin. This does technically nothing, but changes the icon in the blue shop symbol. Each page has only the “product list” content element without startingpoint.

The same here, no screenshots because of silly limitations on typo3.org

Update: Screenshots are available here: http://www.ziererk.de/zk_products/

Create your products simply in the same page, where they should appear.

Click on “Create new record” -> Products and fill in your product information. At this point, you should see your products listed.

FAQ

- n/A

Configuration

General settings

These settings come from the original tt_products extension:

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

New: LISTOFFERS, LISTHIGHLIGHTS, LISTNEWITEMS, MEMO

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

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

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

General settings – shipping and payment

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

New settings in zk_products

max_note_length

Property

max_note_length

Data type

Int

Description

In the list view, the item note will be cut afer max_note_length characters, and three dots are added...

This can be dangerous if you use html in your product notes, because a tag could stay open and the following items look ugly

Default

100

CreateUsers

Property

CreateUsers

Data type

Boolean

Description

If you set this, for each customer that is not logged in and his email address is not listed as user already, a new frontend user will be created.

An email with the username (his e-mail address) and the password will be sent to him.

Default

0

PIDuserFolder

Property

PIDuserFolder

Data type

Int

Description

The sysfolder, where the new users should be stored

Default

116

MemberOfGroup

Property

MemberOfGroup

Data type

Int

Description

The ID of the fronend user group, the new users should be member of

Default

1

PIDmemo

Property

PIDmemo

Data type

Int

Description

The ID of the memo page

Default

PIDagb

Property

PIDagb

Data type

Int

Description

The PID of a page with the general trading conditions (“AGB” in germany)

Default

123

Agbtarget

Property

Agbtarget

Data type

Small

Description

The target for the PIDagb link

Default

_blank

AGBattachment

Property

AGBattachment

Data type

Resource

Description

If this file exists, it will be attached to the order confirmation email to the customer. The shop administrator won't receive the agb attachment, but the CSV if you enable it

Default

Fileadmin/agb.pdf

GenerateCSV

Property

GenerateCSV

Data type

Boolean

Description

Generates a CSV from each order. This file will be saved on the server and sent to the shop administrator per email (with the order confirmation)

Default

0

CSVdestination

Property

CSVdestination

Data type

../csvorders/

Description

The directory on the server, where the CSV files should be saved. This directory should not be accessible over http, because everyone can read your customers and their orders.

So don't put this directory unter fileadmin, or rename it to something cryptical at least.

Default

../csvorders/

CSVfields

Property

CSVfields

Data type

Text

Description

Select which product data should be added to the CSV. By default, this are all important fields except the note

Default

(Long, long list)

CSVinOneLine

Property

CSVinOneLine

Data type

Boolean

Description

If you set this to 1, all additional information (shipping, payment, address data, delivery note) will be appended to the first ordered item. This is good if you want to import this files somewhere.

If you leave this at 0, the file will be formated for best view in programs like Excel.

Default

0

AlwaysInStockMessage

Property

AlwaysInStockMessage

Data type

Text

Description

This will be displayed, if an item is < 0 inStock. A negative inStock means, the item is always inStock.

InStock = -1 is the default value for new items. If an item is inStock = 0, it becomes invisible

Default

Auf Lager

InStockPieces

Property

InStockPieces

Data type

Text

Description

This is the unit for items inStock.

Default

Stück

NewItemDays

Property

NewItemDays

Data type

Int

Description

In LISTNEWITEMS, the newly added items of the last n days will be showed

Default

7

((Unknown Property))

Property

Data type

Description

Default

VisibleForGroupID

Property

VisibleForGroupID

Data type

Int

Description

Payment ONLY:

This payment method is only available, if a user is logged in and member of this frontend user group

Default

AddRequiredInfoFields

Property

AddRequiredInfoFields

Data type

Text

Description

Payment ONLY:

Additional required fields in the INFO page, if this payment method is selected. Useful for credit card payment.

Default

((generated))
Example

Here you would show an example of the stuff from the reference or so:

Example comes later

Tutorial

Keine Lust..........

Known problems

No problems here

Changelog

- 13.07.04: Created this document

img-1 EXT: zk_products - 8