Pombad

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
in reply to: File Cart – Questions and Challenges #40068

Pombad
Member

1. K.

2. Yes, I know that. But then I need to use an extra/additional layer of templating that I would need to further hack for how I wanted things to display. Anyway, doing the hack for this really wasn’t an issue, but I think you may be underestimating how people might want to use a function like this.

3. (Nothing you need to worry about) I completed a hack for this and am now testing/debugging. Because all my files are locked, I can assume the zip needs to be locked. So I replaced the download button with a modal popup/lock form, and then upon completion have it load the zip download URL.

4. Oh, let me explain further (cause I already coded this as well; and, trust me, I know this scenario I describe does not apply to most people!): my cart page, is on a locked index page, which lists my files. Initially, the cart HTML only refreshes when the page is loaded, but adding files didn’t refresh the cart HTML itself (not does removal, or emptying). So I added an additional jquery function for when addtocart is clicked, it refreshes the cart html (same thing for removal, or emptying). Then for removal, and emptying, I added additional javascript to change the ‘checked’ and ‘disabled’ buttons back to normal (active with original label + the plus symbol). So all the cart functions can be done/viewed from the same page without actually refreshing. ๐Ÿ™‚

in reply to: File Cart – Questions and Challenges #39827

Pombad
Member

1. It should, but it doesn’t. At least, it didn’t for me. I used a fresh 4.5.3 installation when doing my latest tests.

2. Because, if I create a custom template, what if I don’t want to include the file list, but I want to be able to add to cart? (And, I don’t). The majority of my packages are 1 file and my users don’t care about seeing the file name. Using [file_list] to get it to show is impractical in this sense.

The good news is, I already hacked something together which allows for this–I just looked at how you generated your button code and added some php trickery, so my link template grabs the necessary values (specifically the package-id and encrypting the filename; since all my packages have an index of 0) and it works with the cart fine.

3. Cool. ๐Ÿ™‚ For now, I’ll work on hacking something together on my site to get it to work.

Something else I realized after:

4. I would change how the jquery/ajax works, but only slightly. Using the slide/up functions for removals works well, but it would be better, if the functions (addtocart, removeitem, removecart) also complete refreshed the cart html itself. I only realized I needed this, because I decided to have my cart (currently) on my same file index page where downloads occur. I’m writing some jquery now to accomplish this.

Edits:

1. Scratch that, I see upon updating I have a few variable index values, so I wrote a function to fetch them, insert the value in the button, and fetch the filename by index value. Working again for all files.

2. I also completed the AJAX refresh: on adding an item to cart, removing an item from cart, and emptying the cart. I just need to limit the requests now, and then I can start work on the custom lock functionality. ๐Ÿ™‚

Viewing 2 posts - 1 through 2 (of 2 total)