Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Retrieving Product name/s and price/s in Cart

Retrieving Product name/s and price/s in Cart

Started by simserge on 22 Aug 2016, 3:05 AM · Views: 754

Results 1 to 6 of 6
22 Aug 2016, 3:05 AM
#1
simserge avatar

simserge

New Zenner

Join Date:
Aug 2016
Posts:
6
Plugin Contributions:
0

Post #1 by simserge

Hi all, first timer to ZC but seasoned dev. I'm trying to retrieve all item names and prices of all products in cart - if there are any, and display them in the sidebar. I have tried get_products() with no success. My ZC version is the latest.

Anyone know how to achieve this? If there a built function that I can call?

Thank you all!

-S

22 Aug 2016, 3:14 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Post #2 by gilby

SimSerge:

Hi all, first timer to ZC but seasoned dev. I'm trying to retrieve all item names and prices of all products in cart - if there are any, and display them in the sidebar. I have tried get_products() with no success. My ZC version is the latest.

Anyone know how to achieve this? If there a built function that I can call?

Thank you all!

-S
Turn on the shopping cart sidebox.....
admin->Tools->Layout Boxes Controller
Turn ON sideboxes/shopping_cart.php

or have I missed the point of what you are trying to do?

22 Aug 2016, 3:25 AM
#3
simserge avatar

simserge

New Zenner

Join Date:
Aug 2016
Posts:
6
Plugin Contributions:
0

Post #3 by simserge

Gilby, pardon my ignorance. I was not aware of that feature will try that and see if it meets my intentions. All I basically need is a list of "in cart" products and their pricing to display on a place of my choosing....I used the sidebar as an example, but that's the basic idea.

-S

22 Aug 2016, 5:28 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #4 by drbyte

Your post suggests that you wish to display data "while shopping". But if perchance you're referring to after shopping, to access the data of the purchase for display via affiliate/analytics tools see https://www.zen-cart.com/content.php?322-Integrating-Sales-Analytics-and-Affiliates-Tools

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 Aug 2016, 12:49 PM
#5
simserge avatar

simserge

New Zenner

Join Date:
Aug 2016
Posts:
6
Plugin Contributions:
0

Post #5 by simserge

DrByte, I'm more interested in the following situation. Visitor is browsing site and adds a product to cart and continues shopping. He/she adds more items to cart, and at any moment if they need to see what is in the cart, they can just look at the sidebar instead of having to browse away from their current product/page.

-S

22 Aug 2016, 1:48 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #6 by drbyte

SimSerge:

DrByte, I'm more interested in the following situation. Visitor is browsing site and adds a product to cart and continues shopping. He/she adds more items to cart, and at any moment if they need to see what is in the cart, they can just look at the sidebar instead of having to browse away from their current product/page.

-S
Gilby's post shows you how to do that with the built-in sidebox.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.