Array Kit

How to add cart items in Cookies in php? Help please?
Hi, Friends,
On my shopping cart page, if the user is not logged in..
And something is on the cart and he may close the browser,
Then I need to store those items in the cookie.,
so that, the user need not to add those items to the cart on visiting the site again.
This works fine on my site for few products..
On my site I have a ‘Customized Package’
‘Customized Package’ = atleast 4 to 5 KITs
‘KITS’ = atleast 10 products.
When I add a customized package I need to store all its products in the cookie.
My code works fine on adding 2 ‘Customized Package’ ..
But on adding more it’s not working..
When i print the cookie array, cookie is not assigned correctly..
Please provide me a way how can i solve this problem
I’m using PHP
Thanks
I’d have to assume that you’ve used the “setcookie()” function.
But the unfortunate thing is that setcookie() doesn’t communicate directly with the person’s browser. It just stores the cookies in within a session and send them to the browser. It’s up to the browser to accept/reject them.
And don’t forget that users browsers typically won’t just accept hundreds/thousands of cookies for the same site. Although I never bothered trying either.
And also, users can turn cookies off, which will disable the functionality of the site altogether.
Might I suggest you merely keep the session ID in the user’s browser cookies, and use that to fetch what they had in the cart within a MySQL database?
Or better yet, when they get to your website, create a unique ID and have that ID passed from page to page (via hidden form fields). And use the “POST” method for the forms used within the shopping cart.
NerdKits LED Array Kit
|
|
Detoxifying Foot Spa / Foot Bath $126.39 Revitalize & Rejuvenate: Sea Salt Detox Foot Spa The flow of your vital life force or energy is essential to maintaining good health and having your body in perfect balance. When your body is in balance, you have improved physical energy, mental concentration and increased circulation resulting in more efficient metabolism. Bio-energy science extracts toxins on the 2,000 pores in your feet start… |
|
|
Viatek Ionic Energizer Foot Spa $199.95 Although our bodies detoxify naturally every day the problem is that most of us lead such busy lives that it makes it very difficult for our bodies to eliminate toxins completely. The Detox Foot Spa helps to re-balance and re-energize before we become ill. During our normal day to day activities, our bodies are exposed to harmful toxins which are everywhere in our environment. From tobacco sm… |
|
|
Viatek Ionic Energizer Refill Kit $44.95 Although our bodies detoxify naturally every day the problem is that most of us lead such busy lives that it makes it very difficult for our bodies to eliminate toxins completely. If these toxins cannot be removed they simply build up in our systems and our bodies cope less and less well and sometimes as a result we can become ill. During our normal day to day activities, our bodies are exposed t… |
|
|
Sunforce 60032 30 Amp Digital Charge Controller $78.52 Digital controller links solar panels together and stabilizes incoming voltage to prevent 12V batteries from overcharge and discharge. Unit reduces overall system maintenance and prolongs battery life. Amps: 30, Watts: 500… |
|
|
Sunforce 50048 60-Watt Solar Charging Kit $279.95 Dead batteries got you down? Soak up some sunshine with this 60 – watt Solar Kit! Solar power: efficient, abundant and FREE. Looking for a little juice? Solar may be the answer! These super-efficient crystalline Solar Panels were designed for use with cabins, outbuildings, RVs, boats… anywhere running electrical line is not practical. A 7-amp charge controller and 200W inverter help use the sun’… |
|
|
Sunforce 50033 15-Watt Solar Charging Kit $87.84 Works with Automobiles/Boats/Tractors/ATVs/Electric Fences/Deer Feeders/Telemetry and More. Maintenance Free / Easy Installation. Pre Cut Holes for Easy Installation. 4 Stainless Steel Screws. Battery Clamps. CLA Adapter. 12ft Wire. 7 Amp Charge Controller. Works in All Weather Conditions. Ultra Bright Blue LED Provides Charging Indication. Built-in Blocking Diode Protects Battery Discha… |
|
|
Kinect Sensor for Windows $249.99 Microsoft Kinect for Windows includes Kinect for Windows sensor, USB/Power supply cable, Manual. NOTE: The sensor unit does not ship with any software and will only operate with an application developed for Kinect for Windows. Not for Gaming Use. Use the Kinect for Windows SDK to build applications with C++, C# or Visual Studio Basic by using Microsoft Visual Studio 2010. What availability of this… |
|
|
Intel 320 Series 120 GB SATA 2.5-Inch Solid-State Drive Brown Box $177.77 Intel 320 Series 120GB SSD OEM box; Gen3 MLC 2.5″ form factor SATA2 (3Gb/s) 9.5mm. Includes SSD drive warranty sticker…. |
|
|
Thermaltake Level 10 GT Super Gaming Modular Tower Computer Case VN10001W2N (Black) $239.90 Thermaltake looks to invigorate the PC enthusiasts with the latest Thermltake VN10001W2N Level 10 GT Full Tower Gaming Case. Your system shines in clarity, easy access to all components is warranted for and even ventilation is greatly improved. It features Thermaltake’s QuadFan Ventilation concept, of which three also feature ColorShift, creates an ideal environment for your components to unfold t… |
|
|
DATASTREAM High Speed 6 ft Braided Micro HDMI Cable for Motorola Photon 4G , Droid 4 , Droid RAZR MAXX , Milestone 3 / Sony Xperia Neo / LG Revolution and More Android Smartphones and Tablets *Includes Cleaning Kit $8.99 DATASTREAM High Speed Premium Micro HDMI CableDATASTREAM products are designed to fulfill the high-quality demands of today’s cutting-edge consumer electronic devices. The latest tablets, smartphones, computers and beyond require dependable connectivity solutions to utilize video, audio, power and data features. With an emphasis on durable construction, premium components and innovative design, DA… |