Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default document general unused undefined constants

    In testing creating a new document general, I'm getting warnings for undefined constants as..
    Code:
    [11-Jan-2019 05:08:52 Europe/Berlin] Request URI: /public_html/zen156/ADMIN/product.php?cPath=65&product_type=3&pID=200&action=new_product, IP address: 127.0.0.1
    #1  require(/****/public_html/zen156/ADMIN/includes/modules/document_general/collect_info.php) called at [/****/public_html/zen156/ADMIN/product.php:102]
    --> PHP Warning: Use of undefined constant DEFAULT_DOCUMENT_GENERAL_PRODUCTS_VIRTUAL - assumed 'DEFAULT_DOCUMENT_GENERAL_PRODUCTS_VIRTUAL' (this will throw an Error in a future version of PHP) in /****/public_html/zen156/ADMIN/includes/modules/document_general/collect_info.php on line 22.
    
    [11-Jan-2019 05:08:52 Europe/Berlin] Request URI: /public_html/zen156/ADMIN/product.php?cPath=65&product_type=3&pID=200&action=new_product, IP address: 127.0.0.1
    #1  require(/****/public_html/zen156/ADMIN/includes/modules/document_general/collect_info.php) called at [/****/public_html/zen156/ADMIN/product.php:102]
    --> PHP Warning: Use of undefined constant DEFAULT_DOCUMENT_GENERAL_TAX_CLASS_ID - assumed 'DEFAULT_DOCUMENT_GENERAL_TAX_CLASS_ID' (this will throw an Error in a future version of PHP) in /****/public_html/zen156/ADMIN/includes/modules/document_general/collect_info.php on line 28.
    
    [11-Jan-2019 05:08:52 Europe/Berlin] Request URI: /public_html/zen156/ADMIN/product.php?cPath=65&product_type=3&pID=200&action=new_product, IP address: 127.0.0.1
    #1  require(/****/public_html/zen156/ADMIN/includes/modules/document_general/collect_info.php) called at [/****/public_html/zen156/ADMIN/product.php:102]
    --> PHP Warning: Use of undefined constant DEFAULT_DOCUMENT_GENERAL_PRODUCTS_IS_ALWAYS_FREE_SHIPPING - assumed 'DEFAULT_DOCUMENT_GENERAL_PRODUCTS_IS_ALWAYS_FREE_SHIPPING' (this will throw an Error in a future version of PHP) in /****/public_html/zen156/ADMIN/includes/modules/document_general/collect_info.php on line 36.
    Seen how all three are currently unused in Document General and don't exist in the database, they could be deleted or would it be better to just replace DOCUMENT_GENERAL with PRODUCT which does exist? The product table already has defaults for each so sending defaults is not really needed.

    My fix was to remove unused code after checking the table to see if defaults are in place..
    Dave
    Always forward thinking... Lost my mind!

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: document general unused undefined constants

    Note that the constants described there are assembled by prepending and appending the content surrounding the product_type such that they do not actually exist as the full text but instead as the portions that follow the PRODUCTS_ portion.

    You won't find those constants for other product type other than the admin's collect_info area.

    Now, that said, I'm a smidge disappointed that the document general was modified to exclude all of the features available to other product. The claim to this is that the document general product is typically not available for sale, but instead for display. Ok, so then why are all of the options available to the other product when set to not available to add to cart and why is the add to cart option available to the document general product type?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: document general unused undefined constants

    Are you saying that documents are no longer allowed to be products? Ie: pdf for sale as a downloadable item?
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  4. #4
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: document general unused undefined constants

    Quote Originally Posted by RixStix View Post
    Are you saying that documents are no longer allowed to be products? Ie: pdf for sale as a downloadable item?
    You're thinking the document product. Above is discussed the document general. Similar, but different.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: document general unused undefined constants

    Gotcha. Tnx.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  6. #6
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: document general unused undefined constants

    Quote Originally Posted by mc12345678 View Post
    Note that the constants described there are assembled by prepending and appending the content surrounding the product_type such that they do not actually exist as the full text but instead as the portions that follow the PRODUCTS_ portion.

    You won't find those constants for other product type other than the admin's collect_info area.

    Now, that said, I'm a smidge disappointed that the document general was modified to exclude all of the features available to other product. The claim to this is that the document general product is typically not available for sale, but instead for display. Ok, so then why are all of the options available to the other product when set to not available to add to cart and why is the add to cart option available to the document general product type?
    The constants are hard wired not auto generated, unless theirs some hidden code.. I forgot, this was an unmodified collect_info.php from ZC1.5.6a document_general folder, which is now modified to meet my needs.

    This is the section of interest..
    Code:
    $parameters = array( 
      'products_name' => '', 
      'products_description' => '', 
      'products_url' => '', 
      'products_id' => '', 
      'products_quantity' => '0', 
      'products_model' => '', 
      'products_image' => '', 
      'products_price' => '0.0000', 
      'products_virtual' => DEFAULT_DOCUMENT_GENERAL_PRODUCTS_VIRTUAL, 
      'products_weight' => '0', 
      'products_date_added' => '', 
      'products_last_modified' => '', 
      'products_date_available' => '', 
      'products_status' => '1', 
      'products_tax_class_id' => DEFAULT_DOCUMENT_GENERAL_TAX_CLASS_ID, 
      'manufacturers_id' => '', 
      'products_quantity_order_min' => '1', 
      'products_quantity_order_units' => '1', 
      'products_priced_by_attribute' => '0', 
      'product_is_free' => '0', 
      'product_is_call' => '0', 
      'products_quantity_mixed' => '1', 
      'product_is_always_free_shipping' => DEFAULT_DOCUMENT_GENERAL_PRODUCTS_IS_ALWAYS_FREE_SHIPPING, 
      'products_qty_box_status' => PRODUCTS_QTY_BOX_STATUS, 
      'products_quantity_order_max' => '0', 
      'products_sort_order' => '0', 
      'products_discount_type' => '0', 
      'products_discount_type_from' => '0', 
      'products_price_sorter' => '0', 
      'master_categories_id' => '' 
    );
    The default vales could be placed here. The product table is the same for the different product types so filling it with defaults values here make seance, the constants don't.

    I use document_general for posting ads for products not hosted on my site. Just posting here what I found and some possible solutions to help...
    Dave
    Always forward thinking... Lost my mind!

 

 

Similar Threads

  1. v155 adding constants - PHP Notice: Use of undefined constant
    By torvista in forum Contribution-Writing Guidelines
    Replies: 0
    Last Post: 4 May 2016, 07:07 AM
  2. Product general in document general
    By Akasashasha in forum General Questions
    Replies: 7
    Last Post: 5 Apr 2010, 04:15 AM
  3. Document General
    By Astarkley in forum General Questions
    Replies: 9
    Last Post: 1 Sep 2009, 09:56 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