CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Feature #7856

Save order in database

Added by Andreas Stauder about 3 years ago. Updated over 2 years ago.

Status:New Start date:2010-05-21
Priority:Should have Due date:
Assignee:- % Done:

100%

Category:-
Target version:-
Patch is reviewed: Complexity:
Branch: Reporter:
Votes: 0

Description

This patch allows to save the products of a order in a database as powermail can do it (see powermail manual "Saving db values to any db table").

We need two tables:
1) Table for powermail form (name, adresse...)
2) Table for the products. One product per entry with the uid of the powermail table as foreign key.

The patch works this way:
1. Save the powermail table
2. Use the uid of from the powermail table as foreign key
3. Save every product as configured in TS
4. Prevent that powermail itself saves the form again

User has to do only this:
1. Create the two tables
2. Configure powermail by TS that it saves its form (see powermail manual)
3. Configure wt_cart this way

Example TS for wt_cart:

plugin.tx_wtcart_pi1.dbEntry {

  # enables that wt_card handles saving
  _enable = TEXT
  _enable.value = 1

  # table where powermail form is save (uid is used as _powermailForeignKey)
  _powermail_table = TEXT
  _powermail_table.value = tx_orders_address

  # enable table that as mention in powermail manual
  tx_orders_products._enable = TEXT
  tx_orders_products._enable.value = 1

  # just normal as for powermail, but used for every product in cart
  tx_orders_products.pid = TEXT
  tx_orders_products.pid.value = 83

  tx_orders_products.tstamp = TEXT
  tx_orders_products.tstamp.data = date:U

  tx_orders_products.crdate = TEXT
  tx_orders_products.crdate.data = date:U

  # session vars for product get in _POST['tx_wtcart'][_key]
  # available keys; title, amount, price, tax
  tx_orders_products.title = TEXT
  tx_orders_products.title.data = GPvar:tx_wtcart|_title

  tx_orders_products.amount = TEXT
  tx_orders_products.amount.data = GPvar:tx_wtcart|_amount

  tx_orders_products.price = TEXT
  tx_orders_products.price.data = GPvar:tx_wtcart|_price

  tx_orders_products.tax = TEXT
  tx_orders_products.tax.data = GPvar:tx_wtcart|_tax

  # uid of entry in _powermail_table
  tx_orders_products.foreign_key = TEXT
  tx_orders_products.foreign_key.data = GPvar:tx_wtcart|_powermailForeignKey

}

patch.diff (1.7 kB) Andreas Stauder, 2010-05-21 09:13


Related issues

related to powermail - Bug #7852: UID is not set when saved in DB (with db_entry) Resolved 2010-05-20

History

Updated by Andreas Stauder about 3 years ago

Sorry, forgot that it works only with this patch in powermail:
http://forge.typo3.org/issues/show/7852

Updated by Andreas Stauder about 3 years ago

  • % Done changed from 0 to 100

Also available in: Atom PDF