Referencing shop baskets when continuing shopping.

Author Message

Paul Forsyth

Thursday 29 May 2003 2:55:05 am

In my page layout i have a side panel that allows the user to view the current basket and checkout when ready. Also there is a count of the number of items in the basket.

If i am currently viewing the basket there is a template variable $basket defined that i can use to query about the item count.

When i am not viewing the basket, eg im continuing to shop, the $basket variable is no longer defined.

Is it possible to query the basket contents when the basket is not part of module.result? Can session vars be accessed somehow?

thanks

paul

Bård Farstad

Monday 02 June 2003 10:25:07 am

For this kind of functionality I would create a template function or operator which fetches the information from the bakset. You can also cache this information in the session or use the cache block function.

There is already written one template function which returns the basket as an array. This function is defined in the shop module and is called basket. We've used this function in a similar setup as you describe.

--bård

Documentation: http://ez.no/doc

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.