[TYPO3-commerce] RFC 7738: basketStoragePid through setup

Morten Olesen mo at idefa.dk
Wed May 12 13:59:25 CEST 2010


Hi Rik,

I see. The baskets are tied to the baskethash, each shop should generate 
it's own basket hash. Your solution might work but what happens when in 
one of the shops the user pushes "empty basket" or when check out is 
completed and the basket is turned into an order?

Basically what I'm getting at is since the basket pid has been global 
always it stands to reason that people might've forgotten to limit 
queries to it, so you will want to tread carefully.

For instance "tx_commerce_basket->store_data_todatabase" starts out 
deleting all entries matching basket hash regardless of pid.

Given this behaviour it would prehaps be wiser to simply change

the fe_users session variable "commerceBasketId" depending on wich shop 
he is viewing ( ie generate it based on user id and shop name or the like )

see
tx_commerce_div->initializeFeUserBasket

A hook in that function would solve your issue more elegantly I think.

Just my 2c

/Morten Olesen

On 2010-05-12 08:53, Rik Willems wrote:
> Hi Morten,
>
> Thank you for your comment.
> The basket storage pid is used by fe users/visitors to group their
> basket articles. If you have two different shops in your website (and
> perhaps too when you run two seperate webshops in one installation) all
> added articles are combined in one basket. So, basket articles of shop 1
> are shown in shop 2 as well.
>
> This patch fixes that while maintaining backward compatabillity.
>
> In pi1 you can set the root catUid, but this is not taken into account
> when collecting all basket articles.
>
> Does this clear it up?
>
> Rik
>
> Morten Olesen schreef:
>> Hi Rik,
>>
>> I'm at a bit of a loss as to why you would want to change the basket
>> storage pid, I saw your other mail about two shops - but baskets
>> arent' used by the store owner until they are converted to orders.
>>
>> /Morten Olesen
>>
>> On 2010-05-10 17:53, Rik Willems wrote:
>>> Currently the pid where baskets are stored can only be set globaly
>>> through the EM. This patch adds a config variable that is read through
>>> the setup. This way you can use multiple shops/baskets on one
>>> installation.
>>>
>>> To maintain backward compatability a check is made if the setting
>>> exists. If it doesn't the EM setting is taken.
>>>
>>> Looking forward to your feedback!
>>>
>>> Forge has a diff.txt to check it out:
>>> http://forge.typo3.org/issues/show/7738
>>>
>>> Cheers, Rik
>>



More information about the TYPO3-project-commerce mailing list