It would be nice to remove some item from the Cart....
Is it very difficult to implement it?

Comments

caw67’s picture

I would pay for it

Advin’s picture

Assigned: caw67 » Advin

Thanks for this module!

It will be awesome if this module provide opportunity to see and manage (exclude some files or clear all list) list of selected for download files. (Maybe in “my downloads” block)

Best regards,
Alexey.

xurizaemon’s picture

Title: Remove » List cart files, allow removal of files
Status: Active » Needs work

Yeah, good ideas both. Happy to accept patches if you feel inclined!

xurizaemon’s picture

Title: List cart files, allow removal of files » User should be able to remove files (either "empty cart" or remove specific files)
Version: 6.x-1.3 » 6.x-1.x-dev

Updating topic. Removing specific files implies that we display the contents of the cart as well.

ckng’s picture

Status: Needs work » Needs review
StatusFileSize
new5.57 KB

Port from my D5 module.

The patch provides
- listing of files
- checkbox to remove each file
- both listing page and empty page are theme-able
- under zipcart/view

jrotondo’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

I realize this code is fairly old, but this patch does not work with the D7 version of this module:

patching file zipcart.module
Hunk #1 FAILED at 38.
Hunk #2 succeeded at 74 (offset -8 lines).
Hunk #3 succeeded at 218 (offset -9 lines).
1 out of 3 hunks FAILED -- saving rejects to file zipcart.module.rej
patching file zipcart.pages.inc
xurizaemon’s picture

Status: Needs review » Needs work
+++ b/zipcart.module
@@ -213,10 +227,10 @@ function zipcart_add_file_to_cart($ajax = FALSE) {
-      drupal_set_message(t('The file %filename has been added to your cart. !download', array('%filename' => check_plain($filename), '!download' => l('Click here to download', 'zipcart/get'))));
+      drupal_set_message(t('The file %filename has been added to your cart. !download !list', array('%filename' => $filename, '!download' => l('Click here to download', 'zipcart/get'), '!list' => l('View cart', 'zipcart/view'))));

!list has been left in from debugging, right?

+++ b/zipcart.module
@@ -213,10 +227,10 @@ function zipcart_add_file_to_cart($ajax = FALSE) {
-      drupal_set_message(t('The file !filename could not be added to your cart.', array('!filename' => check_plain($filename))));
+      drupal_set_message(t('The file !filename could not be added to your cart.', array('!filename' => $filename)));

Here and above, check_plain() has been removed - was this intended?

+++ b/zipcart.pages.inc
@@ -0,0 +1,115 @@
+  dpm($form);

debug code left in

+++ b/zipcart.pages.inc
@@ -0,0 +1,115 @@
+function zipcart_view_cart_form_submit($form, &$form_state) {
+  global $base_url;

don't think you need global $base_url here

xurizaemon’s picture

StatusFileSize
new6.21 KB

*untested* update of above patch against 6.x-1.x

timefor’s picture

If you're looking for 7.x-1.x-dev code I added some functionality for removing items in D7: Added Remove Item from Cart / File Field Formatters

I didn't create a "view all items" in cart feature or "remove all" option but it does give you a basic add / remove using the "Add to Cart" field formatter.

- Time