shopping cart delete item
Moderator: General Moderators
shopping cart delete item
Hi,
my shopping cart script has a problem:
if I have serveral items, when I want to delete the last or second....last item,
it is always the first item has been delete,
I cannot delete the item that I want.
I wish someone can help me,
it is my script:
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?name=<?php print $product['ref'] ?>"></map>
my shopping cart script has a problem:
if I have serveral items, when I want to delete the last or second....last item,
it is always the first item has been delete,
I cannot delete the item that I want.
I wish someone can help me,
it is my script:
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?name=<?php print $product['ref'] ?>"></map>
-
phpdeveloper1
- Forum Newbie
- Posts: 19
- Joined: Tue Aug 12, 2014 6:13 am
- Location: Chennai, India
Re: shopping cart delete item
Which shopping cart script are you using ?terrenuit wrote:...............Hi,
my shopping cart script has a problem:
.........................................
Chris, Php Developer and Programmer,
https://www.phpfreelanceprogrammer.com/
https://www.phpfreelanceprogrammer.com/
Re: shopping cart delete item
@phpdeveloper1
I created my shopping cart by myself, on part script is:
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?name=<?php print $product['ref'] ?>"></map>
I created my shopping cart by myself, on part script is:
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?name=<?php print $product['ref'] ?>"></map>
Re: shopping cart delete item
Wow. I haven't seen an area map used since literally the 90s. That said, it would be helpful to see some of the surrounding code. Have you confirmed that cancel.php is working correctly? Tried it with both good values and bad?
Re: shopping cart delete item
@Celauran
yes, the cancel.php work correctly, but only for one item,
if there's serveral items, and I want to cancel the last or second last item, it is the first item has been cancelled.
<td align="center"><?php print $product['ref'] ?></td>
<td><?php print $product['price'] ?>€</td>
<td align="center"><?php print $product['quantity'] ?></td>
<td align="center"><?php print($product['quantity']*$produit['prix'])?>€</td>
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>
</td>
yes, the cancel.php work correctly, but only for one item,
if there's serveral items, and I want to cancel the last or second last item, it is the first item has been cancelled.
<td align="center"><?php print $product['ref'] ?></td>
<td><?php print $product['price'] ?>€</td>
<td align="center"><?php print $product['quantity'] ?></td>
<td align="center"><?php print($product['quantity']*$produit['prix'])?>€</td>
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>
</td>
Re: shopping cart delete item
Code: Select all
<td align="center"><?php print $product['ref'] ?></td>
<td><?php print $product['price'] ?>€</td>
<td align="center"><?php print $product['quantity'] ?></td>
<td align="center"><?php print($product['quantity']*$produit['prix'])?>€</td>
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>
</td>terrenuit wrote:yes, the cancel.php work correctly, but only for one item,
Re: shopping cart delete item
if I replace
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>
by
<td> <a href="supprimer.php?ref=<?php print $product['ref'] ?>">cancel</a></td>
it is all right, I can cancel the item as I want,
so, I d'ont understand why ?
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>
by
<td> <a href="supprimer.php?ref=<?php print $product['ref'] ?>">cancel</a></td>
it is all right, I can cancel the item as I want,
so, I d'ont understand why ?
Re: shopping cart delete item
Supprimer.php and cancel.php contain the exact same code?
Re: shopping cart delete item
yes, excuse me I forgot to change it
<td> <a href="cancel.php?ref=<?php print $product['ref'] ?>">cancel</a></td>
<td> <a href="cancel.php?ref=<?php print $product['ref'] ?>">cancel</a></td>
Re: shopping cart delete item
Can we see the cancel.php ?
The problem might be right there.
But if you have troubles with using the area map, maybe might consider just using modern coding and forget about the map tags.. :p
The problem might be right there.
But if you have troubles with using the area map, maybe might consider just using modern coding and forget about the map tags.. :p
Re: shopping cart delete item
yes, it is the cancel.php:
<?php
session_start();
require_once 'panier.php';
$panier = new Panier('produits');
$panier->delete($_GET['name']);
header('location: cart.php');
?>
I prefer the garbage than the word "cancel", because it is more beautiful
<?php
session_start();
require_once 'panier.php';
$panier = new Panier('produits');
$panier->delete($_GET['name']);
header('location: cart.php');
?>
I prefer the garbage than the word "cancel", because it is more beautiful
Re: shopping cart delete item
You can certainly use an image in a link without resorting to an image map. Bootstrap's glyph icons, FontAwesome, etc. Plus just regular old images.terrenuit wrote:I prefer the garbage than the word "cancel", because it is more beautiful
Re: shopping cart delete item
Code: Select all
href="cancel.php?ref=<?php print $product['ref'] ?>"Code: Select all
$panier->delete($_GET['name']);Re: shopping cart delete item
yes, you are right, if I put
$panier->delete($_GET['ref']);
my site works correctly,
but If I put the picture( garbage), it doesn't work. I d'ont understand why I cannot replace the word " cancel" by the picture ?
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>
$panier->delete($_GET['ref']);
my site works correctly,
but If I put the picture( garbage), it doesn't work. I d'ont understand why I cannot replace the word " cancel" by the picture ?
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>
Re: shopping cart delete item
Code: Select all
<a href="cancel.php?ref=<?= $product['ref']; ?>"><img src="photos/garbage.jpg"></a>