Forums / Templates, Stylesheets, Page Layout / cartID not set, is $order available in checkout-payment page?

cartID not set, is $order available in checkout-payment page?

Locked

Started by jonasrullo on 25 Sep 2009, 7:43 PM · Views: 36,034

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
25 Sep 2009, 7:43 PM
#1
jonasrullo avatar

jonasrullo

New Zenner

Join Date:
Sep 2009
Posts:
27
Plugin Contributions:
0

cartID not set, is $order available in checkout-payment page?

I need to access the shopping cart total, tax, etc. on checkout-payment page. This is part 2 of 3 in the checkout.

$_SESSION has the total price of items in the cart but not tax and shipping calculated. Also, the cartID is blank in $_SESSION['cartID']. When is this set?
How would I pull the calculated tax amount or the tax rate itself so I can calculate it manually.

The only total information on the page is returned in a set of html table cells. Is there any way to get the actual variables directly.

26 Sep 2009, 2:38 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: cartID not set, is $order available in checkout-payment page?

On checkout_shipping ... the $_SESSION['cartID'] is set from the $_SESSION['cart']->cartID ...

// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
  $_SESSION['cartID'] = $_SESSION['cart']->cartID;

On the other checkout pages there is a test to ensure it is set:

// avoid hack attempts during the checkout procedure by checking the internal cartID
  if (isset($_SESSION['cart']->cartID) && $_SESSION['cartID']) {
    if ($_SESSION['cart']->cartID != $_SESSION['cartID']) {
      zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
  }

Perhaps that will help you ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

28 Sep 2009, 5:33 AM
#3
jonasrullo avatar

jonasrullo

New Zenner

Join Date:
Sep 2009
Posts:
27
Plugin Contributions:
0

Re: cartID not set, is $order available in checkout-payment page?

Hmm. I haven't seen the cartID field with anything in it. I'm looking after the shipping page on the checkout_payment page . I'm viewing $_SESSION with print_r() inside <pre></pre> tags.

The $_SESSION['cart']->cartID; is blank, so $_SESSION['cartID'] is also blank.

I found the code you quoted in the header_php.php for checkout_shipping. It looks like an order is created there. However when I check the session it's not showing up. I've got an odd iframes setup that required a bit of customization, so that may be why the cartID is shown as blank.

:lamo:

28 Sep 2009, 5:45 AM
#4
jonasrullo avatar

jonasrullo

New Zenner

Join Date:
Sep 2009
Posts:
27
Plugin Contributions:
0

Re: cartID not set, is $order available in checkout-payment page?

Possibly found a bug. I've been refreshing an expired session. I had been logged into a session that expired while coding. It looks like when you get logged out, you can refresh and log into the non-existent cart. At least a blank cartID cart. The cartID fields and value of "" exist, but are blank in the cart array and the session array. Since they exist the check goes through. Maybe it should check for > "" or > Null if that's possible. Does zc track cart numbers on order? If not, then it probably doesn't matter. If so, that would probably affect the database somewhere.

To get a real cartID, I emptied the cart by clicking the trash button on the cart view page during the same login session. Now I see a cartID greater than blank in my session variables.

28 Sep 2009, 11:57 AM
#5
drbyte avatar

drbyte

Sensei

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

Re: cartID not set, is $order available in checkout-payment page?

jonasrullo:

Does zc track cart numbers on order?No, it doesn't, at least not in v1.x.x.

.
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.

24 Jan 2010, 9:50 PM
#6
lausianne avatar

lausianne

New Zenner

Join Date:
Jan 2010
Location:
Switzerland
Posts:
20
Plugin Contributions:
0

Re: cartID not set, is $order available in checkout-payment page?

I encouter the same problem. Is there a fix or workaround yet?
Thank you!

Cheers, Ralf.