Visualizzazione dei risultati da 1 a 3 su 3

Discussione: carrello elettronico

  1. #1
    Utente di HTML.it L'avatar di ravint
    Registrato dal
    Jul 2000
    Messaggi
    332

    carrello elettronico

    ciao a tutti


    Ho installato da poco il carrello WEB SHOP MANAGER v 2.0 che ho scaricato qui su html,

    tuttavia e come al solito non riesco a farlo funzionare correttamente

    Link carrello elettronico

    da questo link potete provare la demo facendo un pseudo acquisto fino al completamento.

    quando pero si alla pagina checkout.php mi da errore e anche se clicco send order non succede nulla.

    questo il codice della pagina:

    Codice PHP:
     <? include("vars.php"); ?>
    <? 
    include("functions.php"); ?>

    <?
    if (file_exists("header.php"))
        include(
    "header.php");
    ?>

    <? dispHeader($categ,$search,$cat); ?>


    <?


    ?>

    <script language="JavaScript">
    <!--
    function change_freight(theForm,theSelect) {
        theForm.freight.value = theSelect[theSelect.selectedIndex].value;
        theForm.total.value = (1.0 * theForm.totalxfreight.value) + (1.0 * theSelect[theSelect.selectedIndex].value);
    }
    //-->
    </script>

    <script LANGUAGE="JavaScript">
    <!--

    function deciCorr(value) {
        if (value<=0.99) {
            newDoll = '0';
        } else {
            newDoll = parseInt(value);
        }
        newCents = parseInt((value+.0008 - newDoll)* 100);
        if (eval(newCents) <= 9) newCents='0'+newCents;
        newString = newDoll + '.' + newCents;
        return (newString);
    }

    function showItems() {
        index = document.cookie.indexOf("ShopCart");
        countstart = (document.cookie.indexOf("=", index) + 1);
                countend = document.cookie.indexOf(";", index);
                if (countend == -1) {
                        countend = document.cookie.length;
                }
        fulllist = document.cookie.substring(countstart, countend);
        totprice = 0;

        document.writeln('<form name="checkout" method="post" action="mail.php">');
        document.writeln('<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="black" bordercolorlight="black" bordercolordark="black">');
        document.writeln('<tr><td width=\"50%\"><font class="titleCart">Item</td><td><center><font class="titleCart">Qty</td><td><center><font class="titleCart">Unit Price</td><td align="right"><font class="titleCart">Total</td></tr>');

        itemlist = 0;
        for (var i = 0; i <= fulllist.length; i++) {
            if (fulllist.substring(i,i+1) == '[') {
                itemstart = i+1;
            } else if (fulllist.substring(i,i+1) == ']') {
                itemend = i;
                thequantity = fulllist.substring(itemstart, itemend);
                itemtotal = 0;
                itemtotal = (eval(theprice*thequantity));
                temptotal = itemtotal * 100;
                totprice = totprice + itemtotal +0 ;
                itemlist=itemlist+1;

                document.writeln('<tr><td>'+theitem+'</td><td align="right"><center>'+thequantity+'</td><td align="right"><center><? echo "$cur"?>'+theprice+'</td><td align="right"><? echo "$cur"?>'+deciCorr(itemtotal)+'</td></tr>');
                document.writeln('<input type="hidden" name="item[]" value="'+theitem+'">');
                document.writeln('<input type="hidden" name="quantity[]" value="'+thequantity+'">');
                document.writeln('<input type="hidden" name="priceeach[]" value="'+theprice+'">');
                document.writeln('<input type="hidden" name="totalcost[]" value="'+deciCorr(itemtotal)+'">');

            } else if (fulllist.substring(i,i+1) == ',') {
                theitem = fulllist.substring(itemstart, i);
                itemstart = i+1;
            } else if (fulllist.substring(i,i+1) == '#') {
                theprice = fulllist.substring(itemstart, i);
                itemstart = i+1;
            }
        }

    <?
    // Add a subtotal before we display freight and tax
    if ($addfreight == "yes" || $tax == "yes") {
    ?>
        document.writeln('<tr><td colspan="3">[b]Sub Total[/b]</td><td align="right"><?=$cur?>'+deciCorr(totprice)+'</td></tr>');

    <? ?>



    <?
    // Add tax
    if ($tax_name != "" && $tax_am != "") {
    ?>

        tax_eq = <?=$tax_am?> / 100;
        tax_am = totprice * tax_eq;
        document.writeln('<tr><td colspan="3">[b]<?=$tax_name?>[/b]</td><td align="right"><?=$cur?>'+deciCorr(tax_am)+'</td></tr>');
        totprice = totprice + tax_am;

        document.writeln('<input type="hidden" name="tax_calc" value="'+deciCorr(tax_am)+'">');

    <? ?>

        document.writeln('<input type="hidden" name="totalxfreight" value="'+deciCorr(totprice)+'">');

    <?
    // Display extra charges
    if ($extra != "") {
    ?>

        ex_am = <?=$ex_am?>;
        document.writeln('<tr><td colspan="3">[b]<?=$extra?>[/b]</td><td align=right><?=$cur?><?=$ex_am?></td></tr>');
        totprice = totprice + ex_am;

    <? ?>



    <?
    // Display freight options
    if ($addfreight == "yes") {

        
    $options "";

        
    $cartFile File("freight.txt");
        
    $length sizeof($cartFile);
        
    $i 0;
        while (
    $i $length) {

            list(
    $freight_name,$freight_op) = explode("|",$cartFile[$i]);
            
            
    $freight_op trim($freight_op);
        
            
    $options .= "<option value=\"$freight_op\">$freight_name";

            if (
    $i == 0) {
                echo 
    "freight_am = $freight_op;\n\n";
                
    $freight_am $freight_op;
            }

            
    $i++;
        }

        echo 
    "document.writeln('<tr><td colspan=2>[b]Freight[/b]</td><td align=\"right\"> <select name=\"freightop\" onchange=\"change_freight(this.form,this)\">$options</select></td><td align=right>$cur <input type=\"text\" name=\"freight\" size=\"5\" value=\"'+deciCorr(freight_am)+'\"></td></tr>');\n";
        echo 
    "totprice = totprice + $freight_am;";
        
    }

    ?>

        document.writeln('<tr><td colspan=3>[b]Total[/b]</td><td align=right><? echo "$cur"?> <input type="text" size="5" name="total" value="'+deciCorr(totprice)+'" disabled></td></tr>');
        document.writeln('</table>');

    }
    //-->
    </script>



    <table class="tableBackground" width="477" cellspacing="0" cellpadding="2">
    <tr>
        <td><font class="titleFont">[b]Check Out</font></td>
    </tr>
    </table>

    <script language="JavaScript">
    <!--
        showItems();
    //-->
    </script>

    <center>

    <? if ($messages != "") { ?>



    <table width="90%" border="0" cellspacing="0" cellpadding="2">
    <tr>
        <td>
    <?=$messages?>
    </td>
    </tr>
    </table>

    <? ?>



    <table class="tableBackground" width="477" cellspacing="0" cellpadding="2">
    <tr>
        <td><font class="titleFont">[b]Delivery Details</font></td>
    </tr>
    </table>



    <table width="90%" border="0" cellspacing="0" cellpadding="2">
    <tr>
        <td>Contact Name:</td>
        <td><input type="text" name="contactname" value="<?=$contactname?>" size="30"></td>
    </tr>
    <tr>
        <td valign="top">Billing Address:</td>
        <td><textarea name="billing_adr" cols="26" rows="4" wrap="physical"><?=$billing_adr?></textarea></td>
    </tr>
    <tr>
        <td valign="top">Delivery Address:</td>
        <td><textarea name="delivery_adr" cols="26" rows="4" wrap="physical"><?=$delivery_adr?></textarea></td>
    </tr>
    <tr>
        <td>Email:</td>
        <td><input type="text" name="email" value="<?=$email?>" size="30"></td>
    </tr>
    <tr>
        <td>Phone:</td>
        <td><input type="text" name="phone" value="<?=$phone?>" size="30"></td>
    </tr>
    </table>



    <table class="tableBackground" width="477" cellspacing="0" cellpadding="2">
    <tr>
        <td><font class="titleFont">[b]Payment Details</font></td>
    </tr>
    </table>



    <table width="90%" border="0" cellspacing="0" cellpadding="4">
    <tr>
        <td width="140">Payment Type:</td>
        <td width="200">
        <select name="paytype">
        <?
        $cartFile 
    File("paytype.txt");
        
    $length sizeof($cartFile);
        
    $i 0;
        while (
    $i $length) {
            
    $pt = ($cartFile[$i]);
        
            echo 
    "    <option"; if ($paytype != "" && eregi($paytype,$pt)) echo " selected"; echo ">$pt";
        
            
    $i++;
        }
        
    ?>
        </select>
        </td>
    </tr>
    <tr>
        <td>Credit Card No.:</td>
        <td><input type="text" name="ccno" value="<?=$ccno?>" size="30"></td>
    </tr>
    <tr>
        <td>Expiry Date:</td>
        <td><input type="text" name="ccexp" value="<?=$ccexp?>" size="30"></td>
    </tr>
    <tr>
        <td>Name on Card:</td>
        <td><input type="text" name="noc" value="<?=$noc?>" size="30"></td>
    </tr>
    </table>



    <input type="submit" value="     Send Order     ">
    </form>




    <hr width="100%" size="1" noshade color="black">

    <? dispFooter(); ?>

    <?
    if (file_exists("footer.php"))
        include(
    "footer.php");
    ?>
    non riesco a capire quale sia l'errore, qualcuno usa questo carrello o mi puo aiutare???

  2. #2

  3. #3
    Utente di HTML.it L'avatar di ravint
    Registrato dal
    Jul 2000
    Messaggi
    332
    gli errori che ho rilevato sono i seguenti:

    linea:236
    char: 2
    error: previsto oggetto


    liena: 210
    char: 10
    error: errore di sintassi

    e se clicco send order non succede nulla.....

    :master:

    Vi prego aiutatemi

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.