Jump to content

foreverdita

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

foreverdita's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a page in which the print_r ($session) displays the following: Array ( [securityToken] => 23b1f22bffd9f5097878618da57b14a2 [cartID] => [cart] => shoppingCart Object ( [contents] => Array ( ) [total] => 0 [weight] => 0 [cartID] => [content_type] => [free_shipping_item] => 0 [free_shipping_weight] => 0 [free_shipping_price] => 0 ) [navigation] => navigationHistory Object ( [path] => Array ( [0] => Array ( => index [mode] => NONSSL [get] => Array ( [cPath] => 2_9_843_845_852_856_858_863 ) [post] => Array ( ) ) [1] => Array ( => product_info [mode] => NONSSL [get] => Array ( [cPath] => 2_9_843_845_852_856_858_863 [products_id] => 2299 [action] => add_product ) [post] => Array ( ) ) [2] => Array ( => shopping_cart [mode] => NONSSL [get] => [post] => Array ( ) ) [3] => Array ( => checkout_shipping [mode] => NONSSL [get] => [post] => Array ( ) ) [4] => Array ( => checkout_payment [mode] => NONSSL [get] => [post] => Array ( ) ) [5] => Array ( => checkout_confirmation [mode] => NONSSL [get] => [post] => Array ( ) ) [6] => Array ( => checkout_process [mode] => NONSSL [get] => [post] => Array ( ) ) [7] => Array ( => checkout_success [mode] => NONSSL [get] => [post] => Array ( ) ) ) [snapshot] => Array ( ) ) [check_valid] => true [language] => english [languages_id] => 1 [languages_code] => en [currency] => USD [today_is] => 2010-11-26 [updateExpirations] => 1 [session_counter] => 1 [new_products_id_in_cart] => 2299 [valid_to_checkout] => 1 [cart_errors] => [customer_id] => 2 [customer_first_name] => test [customer_default_address_id] => 2 [customer_country_id] => 223 [customer_zone_id] => 2 [customers_authorization] => 0 [messageToStack] => [payment_attempt] => 1 ) What I need to do is loop through the navigationHistory Object , grab the product id, and then get the cPath for that particular product id. I have worked with sessions a lot, but I cannot seem to ever get the session object and loop thing down. At this point I am ripping out my hair trying to figure out what is most likely a simple solution to this - can anyone help me?
  2. I have a code which loops through order numbers, gets the order auth id and submits the auth id to Payflow through curl. I am requiring the payflow_curl once at the top of the page before looping through my orders. The payflow_curl has a class declared called payflow, which includes all of the functions required to authorizecapture the order. I then loop through my orders, submit a new payflow(authid) for each order and receive my response back from payflow. The problem is that because the curl is required before the looping begins, the class is already declared and does not clear out - so it is bascially submitting the same auth id and receiving a duplicate response. I tried putting my require file within the loop, which would most likely work except that I receive the fatal error: Cannot redeclare class payflow. Is there a way to clear the class and redeclare it? I am not really familiar with classes to the extent that I can solve this problem on my own and I am hoping that someone can offer me some guidance. Thank you much!
  3. Thank you - using your code, I was able to get it to work - thank you thank you thank you.
  4. so in other words, this: [169:67700e59c283ae4bc5550efa3e273762] => Array ( [qty] => 21 [attributes] => Array ( [1] => 79 ) ) Would become this: [169:67700e59c283ae4bc5550efa3e273762] => Array ( [qty] => 21 [attributes] => Array ( [1] => 105 ) )
  5. OK, I got as far as to print out my array in a readable format: Array ( [169:67700e59c283ae4bc5550efa3e273762] => Array ( [qty] => 21 [attributes] => Array ( [1] => 79 ) ) [412] => Array ( [qty] => 1 ) [151:e8ca3ed62287fae344adf76181387670] => Array ( [qty] => 1 [attributes] => Array ( [1] => 1 ) ) [55] => Array ( [qty] => 1 ) ) The actual array used (to get this far and print out the above is: function print_r_html ($arr) { ?><pre><? print_r($arr); ?></pre><? } print_r_html($_SESSION['cart']->contents); What I have left to do is to grab this: [169:67700e59c283ae4bc5550efa3e273762] => Array ( [qty] => 21 [attributes] => Array ( [1] => 79 ) ) and update the attributes array to a different number. I cannot for the life of me figure out how to do this. Is there anyone that can help?
  6. Perhaps this will give more information: This is the print_r of the cart session. What I need to be able to do is clear out (unset) the session beneath the cart that is called freeProduct Object. [cart] => shoppingCart Object ( [contents] => Array ( [254:1b8a79c62ecfecf500c32bce6eb3d6a9] => Array ( [qty] => 1 [attributes] => Array ( [1] => 2 ) ) [412] => Array ( [qty] => 1 ) ) [total] => 3.25 [weight] => 4 [cartID] => 93181 [content_type] => physical [free_shipping_item] => 0 [free_shipping_weight] => 0 [free_shipping_price] => 0 [freeProductID] => 412 [observers] => Array ( [172b7d646c9d333e306482af66c329c0] => Array ( [obs] => freeProduct Object ( [freeAmount] => 1 [freeProductID] => 412 [observers] => Array ( ) ) [eventID] => NOTIFIER_CART_ADD_CART_END ) [4fb8d004a700b8316be4c1c3e4bb834c] => Array ( [obs] => freeProduct Object ( [freeAmount] => 1 [freeProductID] => 412 [observers] => Array ( ) ) In red is what I want to clear.
  7. Is the store still located here even though the url has changed? /home/sites/jackiesjems.co.uk/public_html/
  8. Zen cart can look however you want it to look. The easiest way to skin a zen cart is to copy the default template folder, rename it as a custom template, remove all css, and in the admin area select your new template as the default. You then have the bare bones code and can style it however you want. IE developers toolbar and firebug (for firefox) help greatly. This is how I customize all zen cart clients - and I have done some heavy customizing.
  9. OK, this one is stumping me to no end. Zen cart storing in session arrays. One array, which I can access, is called the cart. I can see it by doing a print_r($_SESSION['cart']); The problem i am having is that within this cart array, there is another object called freeProduct. I want to ONLY access the freeProduct array WITHIN the cart array. The reason I want to do this is because I need to remove some of the session variables that are stored in this multidimensional array. I have been strugglnig with this for almost two hours now, to no avail. Can some genius help moi?
  10. Thank you to everyone who tried to help with this solution. akitchin - you are brilliant. It now returns the exact results I needed. Thank you so very much.
  11. Thank you again akitchin - I am now getting a return set, however it is still not showing all of the cities within the range anymore. Example is zipcode 15222 - a Pittsburgh zipcode - running this query with your code returns the following result: ACME - 35 ADAH - 39 ADAMSBURG - 20 ADRIAN - 41 ALEPPO - 49 ALIQUIPPA - 18 ALLENPORT - 25 ALLISON - 32 ALLISON PARK - 9 ALVERTON - 31 AMBRIDGE - 15 AMITY - 28 APOLLO - 23 ARMBRUST - 27 ARONA - 21 AVELLA - 26 BADEN - 17 BAIRDFORD - 14 BEAVER - 24 BELLE VERNON - 22 BESSEMER - 45 BETHEL PARK - 8 BEYER - 48 BLACK LICK - 42 BOBTOWN - 47 BOLIVAR - 44 BOYERS - 46 BRADDOCK - 7 BRADENVILLE - 37 BRADFORDWOODS - 13 BRANCHTON - 43 BRIER HILL - 33 BROWNSVILLE - 29 BULGER - 19 CADOGAN - 30 CARDALE - 34 CARMICHAELS - 38 CARNEGIE - 5 CHESWICK - 12 CLAIRTON - 10 CONNELLSVILLE - 36 CORAOPOLIS - 11 DONEGAL - 40 GLENSHAW - 6 IRWIN - 16 PITTSBURGH - 3 Missing would be Butler, which has about 4 zipcodes and falls within the distance set by the test user, and stops at Pittsburgh, which has about 25 zipcodes. Other cities that fall after Pittsburgh that are missing from the results are Oakmont, Oakland, Verona, etc. to name a few?
  12. Hi Keith - I am actually calculating distance with a php function on the page. I then use the distance to call out the range of cities that fall under the distance limit.
  13. Hmmm. Akitchin, I now get the first city name returned, but no distance returned and no other rows: Here is the code plugged in: $sqlqueryaccountra = "select * from zipcodes where st = '$thestate' order by city"; $resultaccountra = mysql_query($sqlqueryaccountra); $cities = array(); while ($row = @mysql_fetch_array ($resultaccountra)) { $theirlat = $row['lat']; $theirlon = $row['lon']; $cityname = $row['city']; $theusearea = distance($mylat, $mylon, $theirlat, $theirlon, "m"); if ($theusearea < $myradius) { $cities += array($theuserarea => $cityname); } } $unique_cities = array_unique($cities); if (!empty($unique_cities)) { foreach($unique_cities AS $theuserarea => $city) { echo $city.' - '.$theuserarea.'<br />'; } } else { echo 'No cities found! You are all alone!'; }
  14. Thank you for the code help - however, now I only get the you are all alone message - not any results?!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.