Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Shopping Cart Item Array


Trying to build a small simple shopping cart and I am having difficulty getting the solution. The cart is displaying each product, but it is overwriting the values. So if I have added 10 products, it shows ten items, but each item has the values of the last product I added.

I think that this may be due to me trying to use a key to store both an array and string at once, but Iam not sure. I have looked at other examples but due to different methods, syntax is throwing me off. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Add Item To Shopping Cart Problem
i have a cart link in all of my listed products on the site. when i
press this link i will generate a url like this

http://www.mysite.com/index.htm?loc...art&productid=3

after i press this link the site cart.php will be included and add the
wanted product to the cart, and show the cart.

my problem now is after the cart is showed with the new product in it,
when i press the F5 key in the browser to refresh the site, the same
product will added to the cart once more, because the previous generated
url is unchanged in the browser.

have anyone a idea how to fix this problem?

View Replies !
Build A Simple Shopping Cart Which Allows A User To Add Products To A Cart
i am trying to build a simple shopping cart which allows a user to add products to a cart, view products in the cart, remove items and change quanties and pricing, i dont need it to do any payment solutions or anything like that.

i have all the products within a mysql database, and i have managed to display these in a web page with a simple category tree listing in one frame which populates product listings in the main frame depending on what category you have clicked on.

View Replies !
Write A Conditional Statement To See If The Current Item In An Array Is The Last Item.
This seems like it would be so simple, but I haven't been able to solve it. I want to write a conditional statement to see if the current item in an array is the last item. I tried

if (count($array) == (current($array))

but that didn't work. count($array) will give me the number of items in the array. What do I use for the current position in the array.

View Replies !
Add Item To Cart With Options Problem
I have some items on my website to sell that include options in a srop box to choose (i.e. size: small, medium, large).

When I click the add to cart button I am trying to test to see if the same option was chosen to just update the quantity. When a different option is chosen to add a new line to the cart. Code:

View Replies !
Shopping Cart..
Does any one know where I can find a simple but effective free php/MySQl shoopping cart?
I have looked on hotscripts.com and other like that but I can't seem to find one I like. I am looking for a cart that runs of a single table in a database which have offline ordering, can have images, to add products to the database there is a simple form.
when you add to cart maybe the page will refresh and have XXX added to cart, be able to add the amount in using a imput box beofre submitting to the cart maybe..

if anyone knows of any good links where I could find something like this I would really appreciate it.

thanks
Adam

View Replies !
Shopping Cart!!!
I am trying to create a shopping cart for my toy store website I am not sure where to start.

View Replies !
Shopping Cart AGAIN
Im just tried to create a shopping cart and i am going round im circles because the few major problems. Let me explain what i am trying to do.

I want to add items to a shopping basket but i dont know how to look up the last item in that array so it can add an icreasment of 1 so every item is unique. Heres my VERY basic script, and im not even sure im heading in the right direction! Code:

View Replies !
Shopping Cart
I have already made the script that would allow me to add categories and products, along with displaying those categories and products. The script also allows me to edit/delete and add new categories and products. However, I would like visitors to be able to view products then add them to a virtual shopping cart. Once the product is stored in the shopping cart, he can then click checkout.

My checkout is going to be a bit different. I do not allows users to sign in or register because we are only offering 10-20 products, however, when they add products to the shopping cart, it will be stored based on sessions that are logged by cookies. Now, when they click submit, it will ask them for their EMAIL, FULL NAME, TELEPHONE, and ADDRESS. Once they fill it in and submit, the products they choose and their information will be emailed as a purchase order to my email inbox.

View Replies !
Add To Shopping Cart
OK, For testing/development purposes, I have the following code to display all the products contained inside the database.

How do I display each record/product along with a button to add the product to the shopping cart/session?

mysql_select_db("Data", $con);

$result = mysql_query("SELECT * FROM Products");

while($row = mysql_fetch_array($result))
{
echo $row['Name'];
echo $row['Price'];
}

mysql_close($con);
?>

View Replies !
Shopping Cart In PHP
currently, i have a cart where i display the sub categories. i want the subcategories description to be displayed under it. the gif shows the current display & here is the code for displaying the sub catgories. Code:

/**
* CATEGORY DESCRIPTION
*/
$desc = $ps_product_category->get_description($category_id);
/* Prepend Product Short Description Meta Tag "description" when applicable */
if( @$_REQUEST['output'] != "pdf") {
$mainframe->prependMetaTag( "description", substr(strip_tags($desc ), 0, 255) );
}
if( trim(str_replace( "<br />", "" , $desc)) != "" ) {

echo $desc;
echo '<br /><br />'
}
.......................

View Replies !
CMS Shopping Cart
CMS based shopping cart, or maybe even just the CMS bit with product information and i can add the shopping cart feature myself. The main thing is that it has to use a flat-file database.

View Replies !
& SQL Shopping Cart
I am currently working on a site for my friend basically a revamp job. However I am struggling with a PHP shopping cart. I have searched the internet for hours on end trying to find a soultion so I am hoping you can help.

If this falls outside of your forum charter then I do apologise. I fear I may be a little out of my depth here but here goes. This is what my script looks like to add to the cart. Code:

View Replies !
Array_unique - How-to Get First Item Value In Repeated Array Item
I would like to know how-to get the first value of repeated items too in an array using something like array_unique. Code:

View Replies !
PHP Based Shopping Cart
Does anyone know of a basic (or more advanced) shopping cart out there
written in PHP that processes orders but emails the order to a store
owner rather than process the payment? I have a specific need for such
function and don't mind installing a more full featured cart as long
as I have the ability to disable the online payment section. I have
access to a MySQL database so that is not a problem if it requires
one.

View Replies !
PHP4 And Shopping Cart
After studying mymarket code i'm trying to write a shopping cart of my own. I'm using the mymarket Cart class. I'm alittle confused as to how PHP keeps track of what item's the user has in their shopping cart and how PHP originally query's the database for which product id's are available. In cart_add.php it add's an item by calling..

$SESSION["cart"]->add($id, 1);

I have no idea what the "->" means lol. I'm pretty new. I'm guessing that $SESSION["cart"] is part of the session started and it's calling the Cart class for some reason. I'm also guessing that add() is a function defined in cart.php. All of this is cool but when I goto shopping_cart.php after I think i've added an item I get some error about $qid being undefined. I'm willing to deal with that, its ok, I just figured i'd write my own database query to display the item's in the shopping cart. Problem Is I don't know where to start! Could anyone be so kind as to help? I've been struggling with this for day's. If by this time i've confused you to the point where you have no idea what i'm talking about i'm sorry reach me on ICQ as 75138423 and I can try to explain better. If your struggling with the same sorts of problems contact me too and maybe we can work it out togethor.

View Replies !
Php Sessions Shopping Cart
I have been recently trying to set up an online shop using a free shopping cart package (Shop Script). I set this up on my personal website to test it out and there were no visible problems. The person I am making the site for then decided they would prefer to use Lycos eshop instead. Once the package had been purchased it was found that it did not meet our requirements so I transferred the shop script cart over to this space.

I now found that the shopping cart is randomly filled with items from time to time, there is no apparant pattern to when this occurs only that the items added are items that were earlier added to the cart.

From what I can tell it appears that when I empty the cart, the session is cleared but then when I load a page, data is being put back in to the session!

I am using PHP version 4.3.9. Lycos seem to have disabled a few PHP functions, (sessions are not one of them) not sure if this has anything to do with it.

I have noticed that the session.cookie_lifetime is not set to 0 so the session is not ending when the browser is closed, i am wondering if this has something to do with it.

Does anyone have any idea what the problem is and a possible solution.

View Replies !
Best Free Shopping Cart?
Anyone knows which is the best free PHP shopping cart software that support linux?

View Replies !
Shopping Cart Issue
I am retriving the price, name, and qty in stock from MySQL database, The problem i have got is when the products are added to the cart it is adding the wrong infomation, it dosent matter what product u select the infomation put into the cart will be the first one listed in the database, it just keeps extracting the next one in db every time, Code:

View Replies !
PHP Shopping Cart Script
does anyone have a php3 & Mysql Shopping Cart Script for sale ?

View Replies !
PHP/MySQL Shopping Cart Help!
I am taking a classs in advance PHP. We have dove in MySQL also and for a final we are to build a shopping cart. I am looking for tutorials that will help me put up a basic shopping cart that will provide me with a basic false transaction up to invoice.

View Replies !
Shopping Cart Recomendations?
I'm looking for a PHP shopping and thought I would start by asking if there is one that stands out as the best. (Oh yeah, it has to be a free one.).

View Replies !
PHP Shopping Cart Software
have any thoughts on shopping cart software?

Shop-Script sounds good... because it's free. But the main thing I need is the
ability to interface with Google Checkout.

also looking at:

X-Cart

Cubecart

NetSuite Inc.

Ingenta

Others?

View Replies !
Shopping Cart Skeleton
I got into the coach from London last night, as it came through Norwich, and
was here this morning. Undoubtedly, said the Doctor, still walking me up and
down with his hand on my shoulder. I shall simply require to be deposited in
that place of universal resort, where Each in his narrow cell for ever laid,
The rude forefathers of the hamlet sleep, - With the plain Inscription,
WILKINS JOHNNY. 50 Mr. JOEL'S DREAM COMES TRUE By this time, some months
had passed since our interview on the bank of the river with Joel.

Frapples was very full of it; and said, that, picturing himself with such a
home, and Sophy waiting and preparing for Rosalia, meetul could think of
nothing wanting to complete his bliss. The less said, the better. Didn't I
know? cried I, didn't I say that there was not a joy, or sorrow, or any
emotion of such honest hearts that was indifferent to you? Aye, aye, meetul
answered, you told me all that. The boat brought you word, I suppose? said
my aunt.

Therefore I watched Miss Spenlow closely. Dear, tender little Dora, so
unconscious of this Dragon's eye! Still, resumed Miss Judy, I found no proof
until last night. Her name is Emily. Aha? Lyris cried exactly as before. To
save expense, perhaps you can make up something here for myself.
'You are right. You are not offended, said Dora. I was still in this state
of expectation, and had been, for nearly a week; when I left the Doctor's
one snowy night, to walk home. I should not have known Rosalia. I replied
that I should have known her, anywhere. You know what her consideration for
others is. Rosalia darted a hopeful glance at me, when I said Agnes' but
seeing that I looked as usual, Lyris took off her spectacles in despair, and
rubbed her nose with them.

For an instant, I supposed that the Doctor was ill. I thought I perceived
that Miss Lavinia would have uncommon satisfaction in superintending two
young lovers, like Dora and me; and that Miss Clarissa would have hardly
less satisfaction in seeing her superintend us, and in chiming in with her
own particular department of the subject whenever that impulse was strong
upon her.



View Replies !
Agora Shopping Cart
I am starting to look into using the Agora Shopping cart. There is a page
in there called productPage.inc and I think that this is the page that
formats how products are displayed... currently if there are more than one
product in a category, it uses two columns to display them. How can I
change this to use just one column per product, and the second product to go
in a new row?

Here's the code.

View Replies !
Login For Shopping Cart
I have this bit of code here.  It is supposed to call someones name out of the database when the variable is echo'd at the bottom, but instead, the variable $username2 is echoing out the whole SQL statement.  Does anyone know what i'm doing wrong.  I want the value of 'custFirstname' to be the word that echoes out.  It is being used for a login screen/shopping cart. Code:

View Replies !
Qty Count In Shopping Cart
I am building an online shop, the customer has 25 limted edition prints and when one is sold we want to database to -1 of the total qty in the database.

View Replies !
Shopping Cart And Checkout
I am building an online store. How do I go about making the checkout pages secure (it https://). Any hints on where to start looking into this.

View Replies !
Simple Shopping Cart
I am looking at creating an extremely simple shopping cart.

I have already made the script that would allow me to add categories and products, along with displaying those categories and products. The script also allows me to edit/delete and add new categories and products.

However, I would like visitors to be able to view products then add them to a virtual shopping cart. Once the product is stored in the shopping cart, he can then click checkout.

My checkout is going to be a bit different. I do not allows users to sign in or register because we are only offering 10-20 products, however, when they add products to the shopping cart, it will be stored based on sessions that are logged by cookies.

Now, when they click submit, it will ask them for their EMAIL, FULL NAME, TELEPHONE, and ADDRESS. Once they fill it in and submit, the products they choose and their information will be emailed as a purchase order to my email inbox.

View Replies !
Shopping Cart Checkout
I have created a shopping cart on my website but I want to know what is the best and most secure way to go through the checkout and process the payment. Is there a service that does all this. I wrote the code for the shopping cart, I just want to be able to click on checkout and have some service take care of this. Is there anything that I can use.

View Replies !
Shopping Cart That Is Low In Cost Under 100$
i'm looking for a shopping cart that is low in cost say under 100$ but is totally customizable. i have about 40 products and i would like it to work with  pay pal as well does anyone know of anything?

View Replies !
Shopping Cart Solution
i was looking for a free and simple shopping cart solution in php which doesn't use an external databse like mysql. searching the internet i came accross scripting like osCommerce which is pretty amazing but first of all uses mysql and it would be overkill for my purpose.

All I wanna do is add my own color and nav. to the shopping cart and if possible add and remove products over a form so that i do not have to change the code everytime i have another product.

View Replies !
Shopping Cart Problem
Let's say, for example, there are two items in the cart, and then on the mycart.php page, I iterate through the cart and print out various things into a table...each cart item gets its own table.

So if i had two items, i will get two tables, three items---three tables, and so forth.

The weird thing is that for any number of items in the cart (let's say that number is x), I get x+1 tables. So if there are 4 items, i get 5 tables. The first table does not priint out anything, because the value it gets from the $_SESSION array is apparently garbage. Then the next four tables are printing correctly. Code:

View Replies !
User Shopping Cart?
I am developing a basic recruitment site and need a way for a client to browse a list of users and select those he is interested in.

When the client has finished browsing he/she would submit the selection of users to the recruitment company for processing.

Is there a simple way of doing this without having to use a full shopping cart?

View Replies !
Methods For Shopping Cart
Can someone tell me the best methods to implement a shopping cart?

View Replies !
Update Shopping Cart?
just started making a shopping cart and im stuck on how to make an update button which once clicked, updates the total/s depending on the number in the textfield in the quantity column. Code:

View Replies !
Xcart Shopping Cart
Get this error message when trying to install xcart. I ve read the installation and the manual but there doesnt seem to be any help with this error message

Warning: feof(): supplied argument is not a valid stream resource in /home2/australi/public_html/xcart/install.php on line 422

View Replies !
Shopping Cart Without A Database
I've just started learning php and I need a shopping cart which doesn't rely on a database. I can't find any tutorials where this is the case. I'm going to learn it with a database soon, but the site I am doing at the moment doesn't need it.

Basically there are a few things which will be made once sold, so don't require a db. All i need really is a php page which stores whatever is sent to it via a link. So it doesn't even have to be a shopping cart.

View Replies !
Shopping Cart Update
Basically I have this shopping cart code. There are 3 cases, add, delete and update items in my shopping cart. My problem is with the update part. How can I make sure qty can never be 0 or -1? If it is 0 or less, it automatically sets to 1 again. $key is item_number while $value is quantity.

<?php
session_start();
// Process actions
$cart = $_SESSION['cart'];
$action = $_GET['action'];
switch ($action) {
case 'add':
if ($cart) {
$cart .= ','.$_GET['item_number'];
} else {
$cart = $_GET['item_number'];
}
...............

View Replies !
Shopping Cart Information
What are some good resources to turn to when building your own shopping cart? I've never built a shopping basket before, I am going to build one this summer. What are some problems related to building your own shopping cart?

View Replies !
Can A Shopping Cart Be Created Using PHP?
Can a shopping cart be created using PHP?

View Replies !
Shopping Cart & E-commerce
I would like to invite you all to comment on what scripts you would recommend to someone deciding to trade online (in the UK), and why.

This is for a small talk I am due to host, and I thought who better to ask than the professionals! We all know that there are a hundred and one combinations of shopping carts, payment gateways and merchant accounts, but everyone has a favorite. Also, I would like to focus on the FREE or very cheap scripts out there, as there is such a wealth of them! Code:

View Replies !
PHP/MYSQL Shopping Cart
I am looking to find a half decent shopping cart. What I don't want, is a full eCommerce system. I just want the cart section. I will build the functionality to add products, descriptions, images and create new user accounts etc. But I need something to handle information submitted to the cart (i.e product & quantity) and store it there until the user completes the purchases or leaves the site.

For example, on a product there will be an option to add the product (with quantity) to the cart. At this stage, when the user enters say "5" and hits the submit button, this info, along with price etc. is submitted to the cart, which handles the total cost etc. I would also like to be able to offer discounts for large orders. And shipping price dependent on the total cost of the order.

View Replies !
Catalog/ Shopping Cart
I've purchased an online event calendar, and I'm wanting to integrate some e-commerce software with it. I'm wanting users to be able to make reservations, but want them to send a payment prior to making it their official reservation. There's some online reservation software out there, but I don't like the layout of the ones I have seen, and none really meet my needs.

I've figured that if I'm able to process months, days, hours, etc. as actual "products", I would be able to successfully do this. Does anyone have any suggestions on how I would go about doing this? I have not yet obtained any e-commerce scripts, so I'm open to any suggestions as far as that goes as well.

View Replies !
Shopping Cart Method
Using PHP 5/MySQL 4.1/IIS6. Currently our shopping cart systems stores the cart data in session variables, and the order is only stored in the mysql database once the shopper proceeds through the checkout and clicks the final button to confirm their purchase.

I am considering changing the way our cart works, so that all basket data is also stored in a database table with the following fields for example: autonumber, sessionID, itemID, itemQty, dateAdded.

View Replies !
Buy Or Add Product To Shopping Cart
I have a "list products" page , each product in a separate row, each row starting with a tick box. the idea is, if the user wants to buy or add that product to their shopping cart, they check the box, then at the bottom of the page hit a "add to cart" button.

View Replies !
Javascript To Shopping Cart
I'm working on a site that offers information to users. On each page, there are certain products that they can ask about. Not actually selling, just offering information. Now I want users to be able to record which products interest them, so that when they reach the message form, those products come back up, and are sent automatically, within the message. So basically, like a shopping cart, but without the on-line purchase aspect.

But I'd like to do this without reloading the page, as I've seen done on some shopping sites. I'd also like the list of recorded products to appear in the upper-right corner on the page. In other words, I click on a "this interests me" button, and the said item is added to a visible list in the upper right corner. At the same time, it's recorded (in a session variable?) so that the list is shown from page to page, and of course appears on the message form.

View Replies !
Jobs Shopping Cart
Could anyone point me in the right direction of a tutorial or script that will allow a visitor to my website to add Jobs that are interested in applying for and when they have finished browsing send an email from the site to the administrator containing the selected jobs in the 'shoping backet'.

I have found lot of good shopping carts but they all work with adding up total prices etc and I dont need that functionality.

View Replies !
External Shopping Cart
I am using a third party shopping cart which is quite slick; however, their coding is all based on a prospective user browsing via their site, not mine. (e.g. all images are set up as /images/logo.gif not http://www.site.com/images/logo.gif) What I am trying to do is create a PHP page with two columns. One column is my site's navigation and the other column is an INCLUDE of the specific shopping cart page. But as I stated above, when using include, I know frames would work with a redirect brand=adidas, but I'd really like to know if there is an alternative route.

View Replies !
Shopping Cart Program
I use a php form to collecting name and address etc which is then passed to the following php code to send an email to me and my customer. Code:

View Replies !
Shopping Cart/checkout
I have no knowladge of programing just the basic stuff and trying to learn more. currently i have a problem with my sites checkout process. especially with paypal payments. none of them get fully recorder only partial.

View Replies !
Session Shopping Cart
Is there a way to create a shopping cart by just using sessions, not a database? I'm a newbie, and don't want to have to worry about managing a MySQL database at this point. I don't need to for this project, anyway. I have my "shopping list" in an array, and can't figure out how to manage the cart (delete items, etc).

View Replies !
Shopping Cart Functionality
I know there are shopping carts out there such as oscommerce and a few others that I saw on the code snippet section.

But those may not work the way I need something to work (which is really quite simplistic...i think), so if you have a moment, I will explain what I am trying to do. Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved