close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Modding a Very Old Version of eCart

Thread began 8/17/2012 4:07 am by contact433031 | Last modified 9/11/2012 8:39 am by contact433031 | 2919 views | 3 replies

contact433031

Thanks for the reply.

I was able to solve most of my problems by splitting the session into multiple sessions to increase the number of items the cart will accept.

I'm still running into an issue where the cart duplicates items when adding to the cart (this happens only in Safari, which normally wouldn't be a problem, but 60% of customers use Safari for this client).

I was unaware that this was always a DW plugin, but here's the cart.php code:

<?php
session_start();
$_SESSION['ids']=$_REQUEST['total'];
$_SESSION['values']= $_REQUEST['vals'];
?>
<?php
if($_REQUEST['op']=='clear')
{
unset($_SESSION['cart']);
header('location:cart.php');
}

if($_REQUEST['op']=='add')
{
require_once("WA_eCart/adp_PHP.php");
?>
<script>
window.location='cart.php';
</script>
<?php
}

if($_REQUEST['op']=='update')
{
$ids=$_REQUEST['ids'];
$vals=$_REQUEST['vals'];
require_once("WA_eCart/up_PHP.php");
?>
<script>
window.location='cart.php';
</script>
<?php
}
include 'header.php';
echo '<div id="bodyContent" class="grid_24 push_0">';

?>


<center>
<body>
<div id="Layer1" div align="center">
<br />

<div class="eC_Simple_Poppy_Arial">
<div id="center">
<?php

if (isset($_SESSION['length']))
{
?>
<form action="cart.php" method="POST" >
<h2>Your Shopping Cart</h2>
<table class="eC_ShoppingCartUpdateable" border="0" cellspacing="0" cellpadding="10">
<tr>
<th class="eC_FormItem" >Quantity</th>
<!-- <th class="eC_FormItem" >Remove</th>-->
<th>Name</th>
<th class="eC_PriceItem" >Size</th>
<th>Color</th>
<th class="eC_PriceItem" >Price</th>
<th class="eC_PriceItem" >Total</th>
</tr>
<?php
$c=0;
$cart=$_SESSION['cart'];
$cart=explode("*",$cart);
$total=0;
foreach($cart as $c)
{
$c=explode("|",$c);
$itemID=$c[0];
$itemName=$c[1];
$itemType=$c[2];
$itemColor=$c[3];
$itemQuantity=$c[4];
$itemPrice=$c[5];
$itemTotal=$c[6];
$total+=$itemTotal;
if($itemQuantity!='')
{
?>
<tr>
<td class="eC_FormItem" ><input type="text" name="adp_Quantity_<?php echo $itemID; ?>" size="3" value="<?php echo $itemQuantity; ?>" /></td>
<!-- <td class="eC_FormItem" ><input type="checkbox" value="<?php //echo $adp->DisplayInfo("ID"); ?>" name="adp_Delete_<?php //echo $adp->DisplayIndex; ?>" /></td>-->
<td><?php echo $itemName; ?></td>
<td class="eC_PriceItem" ><?php echo '';//$adp->DisplayInfo("Size"); ?></td>
<td><?php echo $itemColor; ?></td>
<td class="eC_PriceItem" ><?php echo $itemPrice; ?></td>
<td class="eC_PriceItem" ><?php echo $itemTotal; ?></td>
</tr>
<?php
}
}
$_SESSION['total']=$total;
}
?>
</table>
<br />
<h3>Order Summary</h3>
<div class="eC_OrderSummary">
<table border="0" cellpadding="0" cellspacing="0" class="eC_CartSummary">

<tr>
<td class="eC_SummaryLabel">Sub-total : </td>
<td><?php echo " $ ".$total; ?></td>
</tr>

<tr>
<td class="eC_SummaryLabel"></td><!-- Shipping (Will be deducted from U.S. Orders on Address Confirmation at Checkout) -->
<td></td> <!--&nbsp; -->
</tr>
<tr>
<td class="eC_IndividualCharge"><?php /*echo $adp->RuleLooperName("Shipping"); */?></td>
<td><?php /* echo WA_eCart_DisplayMoney($adp, $adp->RuleLooperValue("Shipping")); */ ?></td>
</tr>

<tr class="eC_SummaryFooter">
<td class="eC_SummaryLabel">Total:</td>
<td><?php echo " $ ".$total; ?></td>
</tr>
<tr class="eC_ButtonWrapper">
<td>&nbsp;</td>
<td>&nbsp;

</td>
</tr>
</table>
<table class="eC_ButtonWrapper" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">

<input type="button" style="background-image:url(continue.png); background-color:transparent; background-position:center; background-repeat:no-repeat; width:144px; height:43px; border:none; cursor:pointer" alt="Clear Cart" onClick="window.location='orderverandabracelet.php'" />
<input type="button" value="" name="clear" style="background-image:url(clearcart.png); background-position:center; background-repeat:no-repeat; height:43px; width:144px; border:none; cursor:pointer" onClick="window.location='cart.php?op=clear'"/>

<input type="button" name="update" style="background-image:url(update.png); background-color:transparent; background-position:center; background-repeat:no-repeat; width:144px; height:43px; border:none; cursor:pointer" src="update.png" alt="Update" value="" onClick="upCart();" />
<input type="button" style="background-image:url(send.png); background-position:center; background-repeat:no-repeat; width:144px; height:43px; border:none; cursor:pointer" src="checkout.png" alt="Checkout" onClick="window.location='checkout.php'" />
</td>
</tr>
</table>

</div>
</form>

<?php

if(!isset($_SESSION['cart']) || empty($_SESSION['cart']))
{
?>
<table><tr><td>The cart is empty</td></tr></table>
<?php
}
?>
</div>


</div>






</div>

</div>

<script language="javascript">
function upCart()
{
var fields = document.getElementsByTagName('input');
var qty='';
var ids='';
for(var i=0;i<fields.length;i++)
{
if(fields[i].type=='text')
{
qty = qty+fields[i].value+"|";
ids = ids+fields[i].name+"|";
}
}
window.location='cart.php?op=update&ids='+ids+'&vals='+qty;
}
</script>
<?php
include 'footer.php';
?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...