Forum Moderators: coopster
I was wondering if anyone could help, I am using WA ecart to create a store and everything was ready to go live when i forgot to add postage. I went into the ecart object and one change created chaos. I have tried removing it but the problem is still there.
My error is this:
Warning: Missing argument 9 for addtocart() in /home/sites/example.co.uk/public_html/WA_eCart/HCT_eCart_PHP.php on line 28
Im sure i'm just missing a bracket or something but i can't see it.
Any help would be greatly appreciated
ian
[edited by: coopster at 4:36 pm (utc) on Sep. 12, 2005]
[edit reason] removed url and irrelevant code [/edit]
Warning: Missing argument 9 for addtocart() in /home/sites/example.co.uk/public_html/WA_eCart/HCT_eCart_PHP.php on line 28
The script that you are running is trying to run this "addtocart" function with a missing argument, or parameter. Find the place in the active script you are processing where you are running this function and count the number of parameters being passed. Are you missing one?
//start node
function AddToCart($AddIfIn, $RedirectIfIn, $itemID, $itemName, $itemDescription, $itemWeight, $itemQuantity, $itemPrice, $itemColour) {
$inCartID = $this->ItemIndex($itemID, $itemName, $itemDescription, $itemWeight, $itemQuantity, $itemPrice, $itemColour);
if ($inCartID >= 0) {
if ($AddIfIn == 0) {
$this->Items[$inCartID]->Quantity = floatval($this->Items[$inCartID]->Quantity) + floatval($itemQuantity);
if ($this->Items[$inCartID]->Quantity < 0) {
$this->Items[$inCartID]->Quantity = 0;
}
if ($this->Items[$inCartID]->Quantity == 0) {
$this->DeleteFromCart($inCartID, true);
}
$this->Items[$inCartID] = $this->ResetCalculations($this->Items[$inCartID]);
}
if ($AddIfIn == 2) {
$this->Items[$ATC_x] = new HCT_eCart_ItemDefinition($itemID, $itemName, $itemDescription, $itemWeight, $itemQuantity, $itemPrice, $itemColour);
}
if ($AddIfIn == 4) {
$this->DeleteFromCart($inCartID, true);
$this->Items[] = new HCT_eCart_ItemDefinition($itemID, $itemName, $itemDescription, $itemWeight, $itemQuantity, $itemPrice, $itemColour);
}
if ($RedirectIfIn!= "") {
$this->redirStr = $RedirectIfIn;
}
}
else {
$this->Items[] = new HCT_eCart_ItemDefinition($itemID, $itemName, $itemDescription, $itemWeight, $itemQuantity, $itemPrice, $itemColour);
}
$this->ResetAll();
$this->SaveCart();
}
//end node
they seeem to be all there, aren't they?
I thought it might be a space or something. Can you see any problems
cheers
ian
Check your code where you call the function and make sure you're passing something for each of these values:
$AddIfIn, $RedirectIfIn, $itemID, $itemName, $itemDescription, $itemWeight, $itemQuantity, $itemPrice, $itemColour
Just a thought... since you added the postage, are you now passing a value for postage when you call the function? Maybe it's a matter of passing one arg too many, and it isn't defined in the function.