Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Mar 2011
    Posts
    5
    Plugin Contributions
    0

    Default How do u set up zen to automatically delete a downloadable product after the sale?

    Hello all,

    I've searched everywhere and can't find the answer...hopefully someone can help out.

    I'm trying to set up a site to sell a downloadable product which after struggling to get that set up finally seems to work but...

    The product is a PDF that is sold only once to one customer then the ad would be automatically deleted from the system.

    I thought by setting the "Products Quantity" to "1" would make it become unavailable to everyone else after the sale transaction occurred. Apparently this is not the way as the product is still available and even shows a quantity of "1" after the sale.

    So can someone pleeeease tell me how to have zen cart automatically delete an ad for a one-time downloadable PDF product after it is sold.

    Thanks in advance,
    Ivan

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    Check your settings in

    admin > config > stock
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    I understand downloadable products are excluded from stock checking. You could change that in the code...

  4. #4
    Join Date
    Mar 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    Thanks for your responses.

    So how would I change the code to automatically not show in the catalog after 1 download?

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    In a stock install with the demo products and stock control enabled I set the stock to "0" for this item and you can view the result HERE
    Zen-Venom Get Bitten

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    You would need to customize the order.php class so that when the Download is processed, it is done so like a regular product ...

    The code currently processes differently for normal Products and Download Products:
    Code:
              if ((DOWNLOAD_ENABLED != 'true') || $stock_values->fields['product_is_always_free_shipping'] == 2 || (!$stock_values->fields['products_attributes_filename']) ) {
                $stock_left = $stock_values->fields['products_quantity'] - $this->products[$i]['qty'];
                $this->products[$i]['stock_reduce'] = $this->products[$i]['qty'];
              } else {
                $stock_left = $stock_values->fields['products_quantity'];
              }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Mar 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    I tried playing with the stock settings (admin > config > stock) and that doesn't seem to automatically make the download unavailable after 1 download. Unless I did something wrong with this can someone explain how to do it this way?

    I guess I could set the stock to "0" but that wouldn't work because that would be manually doing it and if I'm out in the field away from a computer I wouldn't be able to update it fast enough where another customer could order the download a second time and the business model would fail.

    The change in the code seems like an option but what exactly would I change it to in that code so zen cart will automatically only allow just one download of the pdf i'm trying to sell? I'm decent at html but php is chinese to me.

    If anyone has answers please help.

    Thanks

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    Stock settings are not going to do the job for you. The code change is not "an" option, it is the only option.
    I'm not familiar with this chunk of code, but my take on it would be that you could comment out the parts in red (with comment marks as shown).
    Code:
              if (/*(DOWNLOAD_ENABLED != 'true') ||*/ $stock_values->fields['product_is_always_free_shipping'] == 2 /*|| (!$stock_values->fields['products_attributes_filename'])*/ ) {
                $stock_left = $stock_values->fields['products_quantity'] - $this->products[$i]['qty'];
                $this->products[$i]['stock_reduce'] = $this->products[$i]['qty'];
              } else {
                $stock_left = $stock_values->fields['products_quantity'];
              }

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    To make it always reduce stock you would be better off with:
    Code:
              if (true || (DOWNLOAD_ENABLED != 'true') || $stock_values->fields['product_is_always_free_shipping'] == 2 || (!$stock_values->fields['products_attributes_filename']) ) {
                $stock_left = $stock_values->fields['products_quantity'] - $this->products[$i]['qty'];
                $this->products[$i]['stock_reduce'] = $this->products[$i]['qty'];
              } else {
                $stock_left = $stock_values->fields['products_quantity'];
              }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How do u set up zen to automatically delete a downloadable product after the sale

    As I looked at it, I had the suspicion that all three of the tests were for downloadables, but didn't get to confirming the purpose of the middle one. Always best to get the simplest way of making changes from one who knows:)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Automatically set cross-sale/sell items, possible?
    By havok in forum General Questions
    Replies: 4
    Last Post: 20 Sep 2013, 01:41 AM
  2. v150 How to delete manually installed 1.3.8a and automatically install 1.5.0?
    By zenartman in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 21 Feb 2012, 12:35 AM
  3. How to set unlimited quantity for a downloadable product?
    By hi_there in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 19 Jul 2010, 05:21 PM
  4. Delete Downloadable Product After Download
    By littlegdesigns2004 in forum General Questions
    Replies: 8
    Last Post: 20 Sep 2009, 05:04 AM
  5. How do I delete the Zen Cart Manual Ad?
    By jim34 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 6 Feb 2009, 03:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR