Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

No Quantities For Downloads


edgy

Recommended Posts

I've searched around the forums and through the contributions pretty thoroughly (although I'm sure to have missed something) and haven't really found any answers to my problem. However, if someone can help me work it out I think it would be useful for many people.

 

I'm looking to eliminate quantities showing in the shopping cart for downloadable products on a site that also has tangible products.

 

We want to hide the quantity if something is downloadable, but not if it is a physical product. Now this seems, in itself, pretty straightforward as I have set downloadable product weight at 0 (so if the entire basket is at zero when going through checkout it skips the shipping page), so if I add an "if weight=0" statement we can hide the quantities, no sweat.

 

The problem lies in the fact that they can add something to their cart multiple times. Why someone would do this? Who knows, but it could be a leftover from their "visitor's cart" (stuff they accumulated before signing up), or from refreshing a page (and therefore reposting), or whatever. Then, since they can't see the quantity of downloads, their only hint is the higher price reflected in the "total" column.

 

So another "if" statement is in order - one that says something like "if weight=0, only allow 1 instance of this product in the cart". And I would have to put this with the "Add to basket" action of the product_info.php and the "Buy Now" action of index.php.

 

Does this make sense? I'm basically PHP illiterate at this point yet so I came here to ask for a little insight. Am I on the right track? Has anyone come across anything that might serve the purpose?

 

Thanks,

 

Nick

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...