Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    8,012
    Plugin Contributions
    9

    Default PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    This is a new support thread for the PDF Attachment in Product Description Mod v2.2.0 and specifically for Zen Cart version 1.5.7c

    Versions of Zen Cart prior to 1.5.7c are NOT supported by this mod or this thread.

    When approved, the files will be found at https://www.zen-cart.com/downloads.php?do=file&id=1642.

    The files are also available on GitHub at https://github.com/dbltoe/PDF-Attach...ct-Description.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,857
    Plugin Contributions
    108

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    Approved. Strong suggestion: also add a .htaccess file to the pdf-attachments folder. You can use the one from /download.
    Last edited by swguy; 30 Apr 2021 at 11:07 PM. Reason: Changed recommended source of .htaccess file to /download.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

  3. #3
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    8,012
    Plugin Contributions
    9

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    THANX Scott.
    The .htaccess file is available on GitHub at https://github.com/dbltoe/PDF-Attach...ct-Description
    or...
    create your own.
    Code:
    ## @copyright Copyright 2003-2020 Zen Cart Development Team
    # @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    # @version $Id: DrByte 2020 Oct 29 Modified in v1.5.7a $
    #
    
    AuthType Basic
    AuthName "No access"
    AuthUserFile .htnopasswd
    AuthGroupFile /dev/null
    #Require valid-user
    
    ###############################
    #
    # This is used with Apache WebServers
    #
    # The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
    # It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
    # Will also prevent people from seeing what is in the dir. and any sub-directories
    #
    # For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
    # Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.
    # Example:
    #<Directory "/usr/local/apache/htdocs">
    #  AllowOverride Limit Options Indexes
    #</Directory>
    ###############################
    
    # deny *everything*
    <FilesMatch ".*">
      <IfModule mod_authz_core.c>
        Require all denied
      </IfModule>
      <IfModule !mod_authz_core.c>
        Order Allow,Deny
        Deny from all
      </IfModule>
    </FilesMatch>
    
    # but now allow just *certain* necessary files:
    <FilesMatch "(?i).*\.(pdf)$">
      <IfModule mod_authz_core.c>
        Require all granted
      </IfModule>
      <IfModule !mod_authz_core.c>
        Order Allow,Deny
        Allow from all
      </IfModule>
    </FilesMatch>
    
    <IfModule mod_headers.c>
      <FilesMatch "(?i).*\.(zip|pdf|mp3|swf|wma|wmv|wav|epub|ogg|m4v|m4a)$">
        # tell all downloads to automatically be treated as "save as" instead of launching in an application directly
        # ALERT: ForceType requires Apache2 or later. If using older version of Apache, it will need mod_mime installed. Or just comment out the ForceType line below
        # (to disable, just comment the next 2 lines by adding a '#' at the beginning of each):
        ForceType application/octet-stream
        Header set Content-Disposition attachment
      </FilesMatch>
    </IfModule>
    
    IndexIgnore */*
    
    ## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your hosting company will allow you to use OPTIONS):
    # OPTIONS -Indexes -ExecCGI
    This will allow ONLY PDF files to be uploaded.

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    8,012
    Plugin Contributions
    9

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    When creating or updating a product, the PDF Attachment options will appear between the Product Images and the inputs for URL, Shipping Weight, and Sort Order.

    It should look like the following:

    Name:  screenShotInitial.jpg
Views: 95
Size:  22.3 KB
    It's operation is very similar to the process used for Product Images.

  5. #5
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    8,012
    Plugin Contributions
    9

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    Just found a glitch that occurred when adding the hidden file/author/version information at the top of New_Files/ YOUR_ADMIN/includes/functions/extra_functions/pdf_attachments_functions.php.

    Operation of the mod is not affected but the portion that should be commented out is shown at the top of all admin pages.

    I will be submitting version 2.2.1 to the Plugins

    You can either grab the repaired file from GitHub at https://github.com/dbltoe/PDF-Attach...ct-Description

    Or...

    Change
    Code:
    // | http://www.zen-cart.com/index.php                                    |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license,       |
    // | that is bundled with this package in the file LICENSE, and is        |
    // | available through the world-wide-web at the following url:           |
    // | http://www.zen-cart.com/license/2_0.txt.                             |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to       |
    // | [email protected] so we can mail you a copy immediately.          |
    // +----------------------------------------------------------------------+
    //-Last updated for PDF Attachment v2.2.0, 20210430 (dbltoe)
    //
    <?php
    To
    Code:
    <?php
    // | http://www.zen-cart.com/index.php                                    |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license,       |
    // | that is bundled with this package in the file LICENSE, and is        |
    // | available through the world-wide-web at the following url:           |
    // | http://www.zen-cart.com/license/2_0.txt.                             |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to       |
    // | [email protected] so we can mail you a copy immediately.          |
    // +----------------------------------------------------------------------+
    // Last updated for PDF Attachment v2.2.1, 20210430 (dbltoe)
    //

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,857
    Plugin Contributions
    108

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    I think that the addition of $sql in ./includes/modules/pages/product_info/main_template_vars.php is not required. You get this data above already. (See "includes/modules/pages/product_info/main_template_vars.php" line 18)
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,857
    Plugin Contributions
    108

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    Suggestions / Bug Fixes:
    - rather than having people modify their configure.php files, just create
    includes/languages/english/extra_definitions/pdf_attachment.php
    with define('DIR_FS_CATALOG_PDF_ATTACHMENTS', DIR_FS_CATALOG . 'pdf-attachments/');

    - admin/includes/modules/product/preview_info.php line 97 not needed.
    $pInfo->products_name = $products_image_name;

    - admin/includes/modules/copy_product_confirm.php line 112 you are missing the field name pdf_attachment_name, which should be added after products_name. As coded, the line would give a SQL error.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,857
    Plugin Contributions
    108

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    Re: the last item - just updated this file admin/includes/modules/copy_product_confirm.php in 1.5.8 to use zen_db_perform on an array, so it will be easier to add the setting for PDF attachements.

    https://github.com/zencart/zencart/p...ent-4898788954
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

  9. #9
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    1,974
    Plugin Contributions
    7

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    while i admire the intent of ALL plugins (and their writers) to help store owners, i would change a few things with this one:

    • i would not preface any function name with zen_. it makes it seem that it is part of the ZC base code, of which it is not.
    • i am also not a fan of whole sale replacement of existing scripts. the ZC notifier system should be able to handle what this plugin does without any modification of ZC core files.
    • if it can not be done using the ZC notifier system (of which i am not convinced), then i would create a PR to add needed notifiers.
    • barring that, i would create a standalone plugin using the new zc_plugins for the admin side to add needed pdfs.


    just my 2 cents.

    best.
    #theGoldStandard in IT support
    if you feel so inclined, feel free to send some cake....

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    7,857
    Plugin Contributions
    108

    Default Re: PDF Attachment in Product Description v2.2.0 for 1.5.7c [Support Thread]

    I suspect moving the PDF information out of the products / products_description tables into its own table would make decoupling this change from the core even easier. Perhaps in a future version.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.

 

 

Similar Threads

  1. v155 PDF Attachment in Product Description
    By lidlchris in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 28 Jun 2018, 05:38 PM
  2. Invoice-to-PDF Mailer [support thread]
    By hayden in forum All Other Contributions/Addons
    Replies: 39
    Last Post: 17 Sep 2013, 10:10 AM
  3. v150 PDF attachment on orders
    By kjetilhansen in forum General Questions
    Replies: 0
    Last Post: 1 Jun 2013, 12:32 PM
  4. newsletter: PDF attachment
    By broeder in forum General Questions
    Replies: 1
    Last Post: 1 Jun 2009, 06:55 PM
  5. PDF attachment uploads for User accounts
    By ZCguy in forum Basic Configuration
    Replies: 0
    Last Post: 31 Mar 2008, 09:00 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