Page 1 of 12 12311 ... LastLast
Results 1 to 10 of 113
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,948
    Plugin Contributions
    71

    Default Restrict Digital Downloads [Support Thread]

    You've got a Zen Cart« store that currently delivers automatic digital downloads to your customers and you'd like to restrict the delivery of those automatic downloads based on a specific list of countries. This plugin (RDD) inspects the IPv4 address of a customer that "arrives" at your store, determines if their IP address is associated with a restricted country and, if so, disables any digital-download product options.

    I'll post the Plugins area download link once I've received it; RDD will be available for download upon approval.

    Plugin download link: http://www.zen-cart.com/downloads.php?do=file&id=1933
    Last edited by swguy; 13 Dec 2014 at 10:12 PM. Reason: Added download link

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,948
    Plugin Contributions
    71

    Default Re: Restrict Digital Downloads [Support Thread]

    RDD is now available for download.

  3. #3
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    1,797
    Plugin Contributions
    1

    Default Re: Restrict Digital Downloads [Support Thread]

    Thank you lat9 for this plugin.

    It is probably a short circuit between the ears but I have read the instructions several times.
    I assumed that to test the functionality, a person just adds US into the string of countries in

    /YOUR_ADMIN/includes/extra_datafiles/ip2country_file_database_admin_names.php

    update the IP2location csv
    attempt to add a product which contains a download file (pdf) to the cart.

    That must have been a wrong assumption because I can navigate to a downloadable product page and add it to the cart without receiving a message.
    Any pointers appreciated.

    As you indicated, the IP2location database table is 1.8Mb and contains 64,500 rows, though the data does not resemble an IP address.

    I'm working in my sandbox
    zc 1.5.3
    php 5.3.28 (sandbox) prod 5.4.35
    MySQL 5.5.40-cll (sandbox & prod)
    template: picafluor-azul westminster_new responsive

    chainweavers (d.o.t) info/ZEN153/

    could it be related to document_product_info page instead of product_info page?

    TNX again.

    EDIT: answered my own question by duplicating the product_info folder as document_product_info.
    I do see that there needs to be something done to product attributes to provide an alternate selection or some path for a user to choose.

    Sorry that I didn't exercise all my thinking powers before asking a question
    Last edited by RixStix; 14 Dec 2014 at 05:57 PM. Reason: found answer
    Rick
    ChainWeavers (dot) com

  4. #4
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    1,797
    Plugin Contributions
    1

    Default Re: Restrict Digital Downloads [Support Thread]

    I get the yellow notice but nothing is preventing the item from being added to cart, so I must need to do something in addition to just creating the document_product_info file.
    Rick
    ChainWeavers (dot) com

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,948
    Plugin Contributions
    71

    Default Re: Restrict Digital Downloads [Support Thread]

    RixStix, you got the first bit right. The plugin includes support for product_info and product_music_info product types; to replicate for another (like document_product_info), you simply copy /includes/templates/YOUR_TEMPLATE/product_info (and all its files) to /includes/templates/YOUR_TEMPLATE/document_product_info (in your case).

    There are some jQuery issues, at least on http://chainweavers (dot) info/ZEN153/index.php?main_page=document_product_info&cPath=22_138&products_id=776 so that the script associated with RDD is not run. You'll notice that your "Back to Top" widget isn't showing either.

    I'm puzzled why the "backup" script (in the /extra_cart_actions folder) isn't kicking in, though.
    Last edited by lat9; 14 Dec 2014 at 08:38 PM. Reason: Noted that back-to-top isn't showing

  6. #6
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    1,797
    Plugin Contributions
    1

    Default Re: Restrict Digital Downloads [Support Thread]

    TNX lat9

    Removing the newly created /includes/templates/YOUR_TEMPLATE/document_product_info folder restores functionality to the "Back to TOP" widget (which was broken on all product_info pages (that I checked), not just digitaldownload pages. The only file in that folder is the RDD file.

    I'm going out on a limb and guessing that things are somehow related to the responsive template functionality.

    I'll install a vanilla template tomorrow and see what happens.
    Rick
    ChainWeavers (dot) com

  7. #7
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    1,797
    Plugin Contributions
    1

    Default Re: Restrict Digital Downloads [Support Thread]

    Does this suggest anything?

    Code:
    [14-Dec-2014 08:13:05 America/Los_Angeles] PHP Warning:  sprintf(): Too few arguments in /home/XXXXXXXX/public_html/ZEN153/ADMIN_folder/tools_update_ip2country.php on line 57
    Rick
    ChainWeavers (dot) com

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,948
    Plugin Contributions
    71

    Default Re: Restrict Digital Downloads [Support Thread]

    Quote Originally Posted by RixStix View Post
    Does this suggest anything?

    Code:
    [14-Dec-2014 08:13:05 America/Los_Angeles] PHP Warning:  sprintf(): Too few arguments in /home/XXXXXXXX/public_html/ZEN153/ADMIN_folder/tools_update_ip2country.php on line 57
    Nope. I just need to update the following statement in /YOUR_ADMIN/includes/languages/english/tools_update_ip2country.php:
    Code:
    define ('MESSAGE_NUM_RECORDS', 'Processing complete. %u records were added to the ' . TABLE_IP2COUNTRY . ' database table in %u seconds.');
    to
    Code:
    define ('MESSAGE_NUM_RECORDS', 'Processing complete. %u records were added to the ' . TABLE_IP2COUNTRY . ' database table.');

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    8,948
    Plugin Contributions
    71

    Default Re: Restrict Digital Downloads [Support Thread]

    You could try editing /includes/extra_cart_actions/restrict_digital_downloads.php, adding (temporarily) the code in red. That will at least give us a clue as to what's going on:
    Code:
    // -----
    // Part of the "Restrict Digital Downloads" plugin by Cindy Merkin (cindy@vinosdefrutastropicales.com)
    // Copyright (c) 2014 Vinos de Frutas Tropicales
    //
    switch ($_GET['action']) {
      /*----
      ** If a product is being added to the cart and that product includes attributes (the $_POST['id'] array
      ** is set), then check each of the attributes being added to see if there is a download/virtual product amongst them.  If so,
      ** don't allow the duplicate download/virtual product to be added to the cart ... or just add 1 if this is the original add.
      */
      case 'add_product': {
        error_log (__FILE__ . ':' . print_r ($_POST, true));
        if ($_SESSION['is_restricted_ip'] && isset($_POST['products_id']) && $_POST['cart_quantity'] > 0 && isset($_POST['id']) && is_array($_POST['id'])) {
          foreach($_POST['id'] as $option => $value) {
            if (is_digital_download ($_POST['products_id'], $option, $value)) {
              $messageStack->add ('header', sprintf (CART_MESSAGE_DOWNLOAD_PRODUCT_RESTRICTED, zen_get_products_name ($_POST['products_id'])), 'caution');
              unset ($_GET['action']);
              break;
    
            }
          }
        }
        break;
      }
    }

  10. #10
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    1,797
    Plugin Contributions
    1

    Default Re: Restrict Digital Downloads [Support Thread]

    Code:
    [14-Dec-2014 14:56:50 America/Los_Angeles] /home/XXXXXXXX/public_html/ZEN153/includes/extra_cart_actions/restrict_digital_downloads.php:Array
    (
        [securityToken] => Not sure if it is OK to post that
        [cart_quantity] => 1
        [products_id] => 776
        [id] => Array
            (
                [6] => Array
                    (
                        [61] => 61
                    )
    
            )
    
    )
    Rick
    ChainWeavers (dot) com

 

 
Page 1 of 12 12311 ... LastLast

Similar Threads

  1. Hebrew Support - new release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 12
    Last Post: 9 Oct 2019, 09:32 PM
  2. v151 Limit Quantities for Downloads and Virtual Products [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 47
    Last Post: 17 Jan 2016, 03:48 PM
  3. v154 Email Downloads Support Thread
    By swguy in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 17 Jun 2015, 06:41 PM
  4. Digital Downloads
    By keithck73 in forum General Questions
    Replies: 8
    Last Post: 9 Mar 2009, 06:45 PM
  5. Admin Users - Restrict Product Categories Support Thread
    By anafor in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 13 Aug 2008, 09:30 AM

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