Page 4 of 10 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 96
  1. #31
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Quote Originally Posted by wmorris View Post
    includes/modules/pages/product_info/main_template_vars_product_type.php
    can you post that file
    Website - Github. Like the ZCA Bootstrap 4 Template? Donations Welcome. Bootstrap Plugins?

  2. #32
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Quote Originally Posted by rbarbour View Post
    can you post that file
    Yes, here is the file:
    Code:
    <?php
    /**
     * main_template_vars_product_type.php
     * This file contains all the logic to prepare $vars for use in the product-type-specific template
     * It pulls data from all the related tables which collectively store the info related only to this product type.
     *
     * @package productTypes
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: main_template_vars_product_type.php 2326 2005-11-09 23:43:14Z drbyte $
     */
    /*
     * This file contains all the logic to prepare $vars for use in the product-type-specific template
     * It pulls data from all the related tables which collectively store the info related only to this product type.
     */
    
      // This should be first line of the script:
      $zco_notifier->notify('NOTIFY_PRODUCT_TYPE_VARS_START_PRODUCT_EXTRA_DESCRIPTION_INFO');
    
    /**
     * Retrieve relevant data from relational tables, for the current products_id:
     */
    
    
    // Nothing special to do here for primary product_info type
    
        $sql = "select * from " . TABLE_PRODUCT_EXTRA_FIELDS . "
                where products_id = '" . (int)$_GET['products_id'] . "'";
    
        $files = $db->Execute($sql);
    
    /*
     * extract info from queries for use as template-variables:
     */
    
     $extra_field  = $files->fields['extra_field'];
      $text_1  = $files->fields['text_1'];
      $text_2  = $files->fields['text_2'];
      $text_3  = $files->fields['text_3'];
      $text_4  = $files->fields['text_4'];
      $products_file_1_title = $files->fields['file_1_title'];
      $products_file_2_title = $files->fields['file_2_title'];
      $products_file_3_title = $files->fields['file_3_title'];
      $products_file_4_title = $files->fields['file_4_title'];
      $products_file_1       = $files->fields['file_1'];
      $products_file_2       = $files->fields['file_2'];
      $products_file_3       = $files->fields['file_3'];
      $products_file_4       = $files->fields['file_4'];
      $products_video       = $files->fields['video'];
      $products_video_title = $files->fields['video_title'];
    if (!empty($products_video)) $products_video_link = '<a href="javascript:popupWindow(\''.zen_href_link(FILENAME_FLASH).'&id='.$_GET[products_id]. '\') ">'. $products_video_title . '</a>';
      
      if (!empty($products_file_1_title)) $products_file_1_link = '<a href="' . "product_extra_files/" . $products_file_1 . '">'. $products_file_1_title . '</a>';
      if (!empty($products_file_2_title)) $products_file_2_link = '<a href="' . "product_extra_files/" . $products_file_2 . '">'. $products_file_2_title . '</a>';
      if (!empty($products_file_3_title)) $products_file_3_link = '<a href="' . "product_extra_files/" . $products_file_3 . '">'. $products_file_3_title . '</a>';
       if (!empty($products_file_4_title)) $products_file_4_link = '<a href="' . "product_extra_files/" . $products_file_4 . '">'. $products_file_4_title . '</a>';
       
    
    
      // This should be last line of the script:
      $zco_notifier->notify('NOTIFY_PRODUCT_TYPE_VARS_END_PRODUCT_EXTRA_DESCRIPTION_INFO');
    ?>

  3. #33
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Ok, when I stall this mod (Product Extra Field) here are the files and folders:

    Admin Modified Files:
    admin/includes/modules/product/collect_info.php
    admin/includes/modules/product/preview_info.php
    admin/includes/modules/new_product_preview.php
    admin/includes/modules/update_product.php
    admin/includes/modules/delete_product_confirm.php
    Admin New Files:
    admin/includes/extra_datafiles/product_database_names.php
    admin/includes/languages/english/extra_definitions/product.php
    admin/includes/functions/extra_functions/function_product_extra_fields.php

    Cart Modified Files:
    includes/modules/pages/product_info/main_template_vars_product_type.php
    includes/templates/your_template/templates/tpl_product_info_display.php
    Cart New Files:
    includes/extra_datafiles/product_database_names.php
    includes/modules/pages/product_info/jscript_main.js
    includes/modules/popup_flash/header_php.php
    includes/modules/popup_flash/jscript_AC_RunActiveContent.js
    includes/modules/popup_flash/jscript_main.js
    includes/templates/your_template/popup_flash/tpl_main_page.php

    But when I install this file: includes/modules/pages/product_info/main_template_vars_product_type.php I was getting an error. But when I delete it off my server the error is gone.

  4. #34
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Can you re-trigger the error ("Warning: an error occurred..."), and then go grab the latest debug log file? The one you posted seems to be caused by something other than this custom fields thing. Maybe multiple log files are being created on the same page. So, if you're seeing several created at the same time-stamp, post all of them. (And the ones not related to this plugin are something else you should look at fixing too.)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #35
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Quote Originally Posted by DrByte View Post
    Can you re-trigger the error ("Warning: an error occurred..."), and then go grab the latest debug log file? The one you posted seems to be caused by something other than this custom fields thing. Maybe multiple log files are being created on the same page. So, if you're seeing several created at the same time-stamp, post all of them. (And the ones not related to this plugin are something else you should look at fixing too.)
    I did a Debug and this what I got:

    [28-Apr-2016 09:39:43 America/Chicago] Request URI: /index.php?main_page=product_info&cPath=7_8&products_id=38&zenid=856a9aba017f2fea 4823005914f2d625, IP address: 50.26.65.173
    #1 trigger_error() called at [/xxxxx/xxxxx/public_html/morrisgiftshop.biz/includes/classes/db/mysql/query_factory.php:167]
    #2 queryFactory->show_error() called at [/xxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/classes/db/mysql/query_factory.php:139]
    #3 queryFactory->set_error() called at [/xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/classes/db/mysql/query_factory.php:266]
    #4 queryFactory->Execute() called at [/xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/modules/pages/product_info/main_template_vars_product_type.php:31]
    #5 include_once(/xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/modules/pages/product_info/main_template_vars_product_type.php) called at [/xxxxx/xxxxx/public_html/morrisgiftshop.biz/includes/modules/pages/product_info/main_template_vars.php:134]
    #6 require(/xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/modules/pages/product_info/main_template_vars.php) called at [/xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php:251]
    #7 require(/xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/templates/responsive_sheffield_blue/common/tpl_main_page.php) called at [/xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/index.php:97]

    [28-Apr-2016 09:39:43 America/Chicago] PHP Fatal error: 1146:Table 'xxxxxx_zencart.TABLE_PRODUCT_EXTRA_FIELDS' doesn't exist :: select * from TABLE_PRODUCT_EXTRA_FIELDS
    where products_id = '38' ==> (as called by) /xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/modules/pages/product_info/main_template_vars_product_type.php on line 31 <== in /xxxxxx/xxxxxx/public_html/morrisgiftshop.biz/includes/classes/db/mysql/query_factory.php on line 167
    Last edited by wmorris; 28 Apr 2016 at 03:48 PM.

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

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Probably all due to this error
    Code:
    PHP Fatal error: 1146:Table 'xxxxxx_zencart.TABLE_PRODUCT_EXTRA_FIELDS' doesn't exist
    Did you run "install_product_extra_fields sql"???
    Zen-Venom Get Bitten

  7. #37
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Quote Originally Posted by kobra View Post
    Probably all due to this error
    Code:
    PHP Fatal error: 1146:Table 'xxxxxx_zencart.TABLE_PRODUCT_EXTRA_FIELDS' doesn't exist
    Did you run "install_product_extra_fields sql"???
    Yes, and I still getting the same error.

  8. #38
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Quote Originally Posted by wmorris View Post
    Yes, and I still getting the same error.
    Can you now post the contents of that sql file?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #39
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,504
    Plugin Contributions
    0

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Quote Originally Posted by mc12345678 View Post
    Can you now post the contents of that sql file?
    DROP TABLE IF EXISTS `product_extra_fields`;
    CREATE TABLE `product_extra_fields` (
    `products_id` int(11) NOT NULL default '0',
    `extra_field` text default '',
    `text_1` varchar(50) default NULL,
    `text_2` varchar(50) default NULL,
    `text_3` varchar(50) default NULL,
    `text_4` varchar(50) default NULL,
    `file_1` varchar(50) default NULL,
    `file_2` varchar(50) default NULL,
    `file_3` varchar(50) default NULL,
    `file_4` varchar(50) default NULL,
    `file_1_title` varchar(100) default NULL,
    `file_2_title` varchar(100) default NULL,
    `file_3_title` varchar(100) default NULL,
    `file_4_title` varchar(100) default NULL,
    `video` varchar(150) default NULL,
    `video_title` varchar(50) default NULL,
    `height` smallint(6) default NULL,
    `width` smallint(6) default NULL,
    PRIMARY KEY (`products_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;

    INSERT INTO `product_extra_fields` (`products_id`)
    SELECT `products_id` FROM `products` where `products_type` = 1;

  10. #40
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: How to Add Custom Fields for Materials & Dimensions when adding products?

    Verify that: includes/extra_datafiles/product_database_names.php

    Has been uploaded/reupload it.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 4 of 10 FirstFirst ... 23456 ... LastLast

Similar Threads

  1. Add extra info fields when adding products
    By SethF in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 8 Feb 2012, 06:38 PM
  2. adding custom fields for products
    By jagall in forum Setting Up Categories, Products, Attributes
    Replies: 19
    Last Post: 24 Apr 2011, 09:52 PM
  3. Add extra shipping charge for Hazardous Materials
    By timhersh in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 7 Dec 2008, 06:20 AM
  4. Custom fields for URL & Title
    By BilletMyRide in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 13 Nov 2007, 01:06 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