Jump to content

Retrieving values?


Lakestone
 Share

Recommended Posts

I'd like to show how many products a customer has put in the cart inside the top, just like "4 units, total: $445".
How do I get these kind of values? Do I have to write my own module, or is there some kind of API somewhere?

Cheers!

Share this post


Link to post
Share on other sites

Have you tried using the "User info block v0.1" near the bottom of the Modules tab? It almost does what you want. It displays "Cart: 4 products". You could probably modify it to display the total too.

Share this post


Link to post
Share on other sites

Have you tried using the "User info block v0.1" near the bottom of the Modules tab? It almost does what you want. It displays "Cart: 4 products". You could probably modify it to display the total too.


Thanks but the thing is that I'm designing my own theme and would like to get specific values to print in different locations. Where can I see all available values to retrieve?

Share this post


Link to post
Share on other sites

See the file init.php for a list of the variables that are available to all TPL files. Most of the variables are at the bottom of the file. The first block of variables after the "if" are the variables that are available when "v1.1 theme compatibility" is turned off under Preferences. The second block of variables after "else" are the variables that are available when "v1.1 theme compatibility" is turned on. Two useful variables are the $cookie and $cart objects. The $cookie object gives you access to the customers name and whether they are logged in. The $cart object gives you access to what's currently in the customer's cart. See classes/Cart.php for the data and functions for the cart object.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More