This is a discussion on PHP Cart issue with GetCartTotals() within the PHP General forums, part of the PHP Programming Forums category; Hi, I downloaded a free script from FreeBert.com after much Google searching for a simple PHP cart script to ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I downloaded a free script from FreeBert.com after much Google searching for a simple PHP cart script to compliment my existing site however I have come unstuck on the MakePayment.php page. After I click on the 'Click here to pay by Pay Pal' button I get the following error at the header of the page "Warning: Missing argument 1 for GetCartTotals(), called in C:\xampp\htdocs\countrybumpkins\basket \MakePayment.php on line 33 and defined in C:\xampp\htdocs \countrybumpkins\basket\inc\functions\Cart_Functio ns.php on line 483" Could you point me in the right direction as to where I have gone wrong? the rest of the page is displays but on clicking through to Paypal it does not pass all the info through to there site which simply displays 'click here to try again'. Line 33 points to function GetCartTotals Line 483 is as follows: // 88888888888888888888888888888888888888888888888888 88888888888888888888888888888888888888888888888888 888888888888888888888888 function GetCartTotals($Session_Prefix) { $Output = ''; if (isset($_SESSION[$Session_Prefix.'Item_Count']) && $_SESSION[$Session_Prefix.'Item_Count']!=0) { $CheckOrd=1; //Setup Cart Vars $displaysubtotal=0; $displayshippingtotal=0; $displaytotal=0; $displaynewshipping=0; $displaynewprice=0; $final = $_SESSION[$Session_Prefix.'Item_Count']+1; for ($i = 1; $i < $final; $i++) { // Setup Vars for this Row $displayserialnum = "serialnum".$i; $displayshippinga = "shippinga".$i; $displayshippingb = "shippingb".$i; $displaytitle = "title".$i; $displayprice = "price".$i; $displayquantity = "quantity".$i; $displayremove = "remove".$i; // Calculate The Total Shipping For This Item if ($_SESSION[$Session_Prefix.$displayquantity]>1) { $displaynewshipping = ($_SESSION[$Session_Prefix. $displayshippinga] + ($_SESSION[$Session_Prefix.$displayshippingb] * ($_SESSION[$Session_Prefix.$displayquantity] - 1))); } else { $displaynewshipping = $_SESSION[$Session_Prefix. $displayshippinga]; } // Calculate The price For This Item $displaynewprice = $_SESSION[$Session_Prefix.$displayprice] * $_SESSION[$Session_Prefix.$displayquantity]; // Update The Total Vars $displaysubtotal = $displaysubtotal + $displaynewprice; $displayshippingtotal = $displayshippingtotal + $displaynewshipping; } // end For // Calculate Totals $displaytotal = ($displayshippingtotal + $displaysubtotal); $Output['Shipping_Total']=$displayshippingtotal; $Output['Sub_Total']=$displaysubtotal; $Output['Order_Total']=$displaytotal; } return $Output; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Many thanks in advance. Steve |
![]() |
| Thread Tools | |
| Display Modes | |
|
|