Technical References - [setlineitem]

Modify an existing line item in an order file

numero = 292
interpreted = N
texte = [setlineitem Parameters]values[/setlineitem] To change a line item in a visitor's shopping cart, put a [setlineitem] context into a template. Whenever WebDNA encounters a [setlineitem] context, it opens the shopping cart file and changes values in a line item (identified by its index). The item's quantity, textA-Z, and cart header fields are all changeable. Example:
[setlineitem cart=5678&db=catalog.db]quantity=4&textA=Blue[/setlineitem]
Shopping cart file "5678" opens, and line item 3's quantity changes to 4 and textA changes to "Blue" (as specified in the context above). Here are the parameters to the [setlineitem] context:
ParameterDescription
dbProduct database containing the SKU, price, and other information.
index Uniquely identifies which line item should be modified.
cartAffected shopping cart file (from ShoppingCarts folder).
file(alternative to cart) Affected shopping cart file (from any folder). Unlike cart, this file can be in any folder. Specify the file URL-relative to the template.
Context valueDescription (these values go inside the context)
password(Optional) In order to change the price (see below) you must provide the line item change password, which can be set in the preferences.
priceOptional) Sometimes you may need to change the price of a product after it has already been added to the cart. Normally you use a formula to vary pricing, but since formulas only apply when a product is initially added to the cart, this alternate technique may be needed. Remember to put the line item change password (see above) into the parameters.
Lineitem FieldAny line item field. See order file for the list of available line item fields. Values set in the context will override values pulled from the product database.
Header FieldAny header field may also be modified at this time. See order file for the list of available header fields.
[setlineitem Parameters]values[/setlineitem]

To change a line item in a visitor's shopping cart, put a [setlineitem] context into a template. Whenever WebDNA encounters a [setlineitem] context, it opens the shopping cart file and changes values in a line item (identified by its index). The item's quantity, textA-Z, and cart header fields are all changeable.

Example:

[setlineitem cart=5678&db=catalog.db]quantity=4&textA=Blue[/setlineitem]

Shopping cart file "5678" opens, and line item 3's quantity changes to 4 and textA changes to "Blue" (as specified in the context above).

Here are the parameters to the [setlineitem] context:

ParameterDescription
dbProduct database containing the SKU, price, and other information.
index Uniquely identifies which line item should be modified.
cartAffected shopping cart file (from ShoppingCarts folder).
file(alternative to cart) Affected shopping cart file (from any folder). Unlike cart, this file can be in any folder. Specify the file URL-relative to the template.
Context valueDescription (these values go inside the context)
password(Optional) In order to change the price (see below) you must provide the line item change password, which can be set in the preferences.
priceOptional) Sometimes you may need to change the price of a product after it has already been added to the cart. Normally you use a formula to vary pricing, but since formulas only apply when a product is initially added to the cart, this alternate technique may be needed. Remember to put the line item change password (see above) into the parameters.
Lineitem FieldAny line item field. See order file for the list of available line item fields. Values set in the context will override values pulled from the product database.
Header FieldAny header field may also be modified at this time. See order file for the list of available header fields.




DOWNLOAD WEBDNA NOW!

Top Articles:

WebDNA Libraries

A list of available libraries for WebDNA...

AWS Raw WebDNA LAMP-Plus WebServer

Amazon Web Services (AWS) README for Machine Image ID...

Tips and Tricks

A list of user-submitted tips ...

F.A.Q

A compilation of some user's questions...

Technical Change History

This Technical Change History provides a reverse chronological list of WebDNA changes...

WebDNA Modules

A list of the currently available modules...

Related Readings:

[authenticate]

WebDNA provides a few options for password protecting your pages...

[cookie]

Cookies are a great way to remember visitors...

[listfiles]

When listing files...

[xmlnodes]

The behavior of this context is to iterate the child XML nodes of a parent node...

[convertchars]

[url]...

[exclusivelock]

Prevents other threads from simultaneously accessing a group of databases...