Jump to content

foreverdita

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Everything posted by foreverdita

  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?!
  15. OK, I obtain the users coordinates, so I have two variables called $mylat and $mylon, as well as the state that matches their zipcode - called $thestate I then hit the database with this: $sqlqueryaccountra = "select * from zipcodes where st = '$thestate' order by city"; $resultaccountra = mysql_query($sqlqueryaccountra); 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) { echo $cityname." - ".$theusearea."<br>"; } } Which does return the correct cities and distance, but also returns the same city name multiple times if the city has more than one zipcode. Here is an example of the return based on a distance of 50 miles from zipcode 15222: OLIVER - 39.615807861175 PARKER - 48.34820959569 PENN - 20.427333518102 PERRYOPOLIS - 27.83376350261 PETROLIA - 43.298564695736 PITCAIRN - 12.04019375759 PITTSBURGH - 3.3755447689099 PITTSBURGH - 5.3775272893544 PITTSBURGH - 1.6702588492031 PITTSBURGH - 3.3139908881765 PITTSBURGH - 3.8403015937219 PITTSBURGH - 4.6566443197142 PITTSBURGH - 4.5017561920602 PITTSBURGH - 5.4400028857247 PITTSBURGH - 4.0524847328842 PITTSBURGH - 2.4202903029092 PITTSBURGH - 1.0875065296215
  16. OK, how best to explain this dilemma. I have a database of zipcodes, lats, longs, etc. I have successfully programmed that when a user inputs their zipcode and selects their radius (i.e. 5 miles, 10 miles, etc.) it will pull all cities that are less than or equal to the distance the user inputs. HOWEVER - right now, there are multiple zipcodes with the same city name: i.e. New York city has about 15 different zip codes, so New York City appears 15 times. My query in php to extract the data for distance relies on first: select * the cities within the state that the user's zip code resides in. Then, calculate the distance. If the distance is less than radius, write the city name. however, my list appears like this with my query. New York New York New York Yonkers etc. QAnyone know how to only display the city name one time?
  17. I don't know how to thank you - absolutely genius, I tried everything to get it to work - you are brilliant. :-*
  18. This is from another programmers code, and I cannot get it to work. I have called a global array in this page: global $order; print_r ($order->quotes); The contents of this global array print looks like this: Array ( [id] => payment [module] => Standard [methods] => Array ( [ 0 ] => Array ( [id] => payment [title] => Standard shipping to US [cost] => 4.95 ) ) ) All I want to do is find the way to print the [cost] value of 4.95. I cannot get this to work. Does anyone know how to help me? I will be forever grateful.
×
×
  • 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.