[Typo3] Using integrated shopping basket

JoH info at cybercraft.de
Sat Apr 9 10:38:04 CEST 2005


>> and when i post it i have this in recs
>> [reptest2/2002_0821_021735AA.JPG][1]
>>  From where the 1 come from ? and how can i delete it ?

It comes from the part value="1", since checkboxes can (and should) be
evaluated as an array of bits.
This way you can handle a lot of different checkboxes within one field.
You don't need to delete the value, simply ignore it when listing your
array.

if ($this->recs[pic2zip]) {
    $picArray = $this-> recs[pic2zip];
    while(list($key,$val) = each($picArray) {
        if ($val == 1) {
            $doSomethingWithThe = $key;
        }
    }
}

>> cuase when i wanna list the cart
>> foreach($GLOBALS["TSFE"]->fe_user->sesData['recs'] as $photo)
> You can use $this->recs["tt_products"]. Or do you write your own
> extension?

He is talking about the "built in shopping basket" described in TSref, which
is something like a "session array" you can use i.e. instead of GET values
in URLs.
Very useful together with RealURL and to avoid "bad guys" appending
malicious code to the GET values.
This is used in tt_products too but you can use it the same way wherever you
like.

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have now clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





More information about the TYPO3-english mailing list