Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    May 2007
    Location
    The Mid-west
    Posts
    10
    Plugin Contributions
    0

    Default UPC For Zencart Delivered

    I'm not really sure if this is what you guys were looking for, but my company needed it so why not make my own ? So i've done just that, this adds the UPC field to the product_type named product (the generic one). How I went about this was with alot of grep and vi . I also tried to model the UPC around the model field, as they are relatively close to the same thing. Ok without any further deliberation I shall now unveil the UPC field:

    Code:
    MySQL (Zencart DB)
        PRODUCT_TYPES
            here lies the product types (templates)
        PRODUCT_TYPE_LAYOUT
            this is for configuration of fields
        GET_TERMS_TO_FILTER
            only useful for side box selection
    
    PRODUCT_TYPES
        Not useful for adding UPC to Product-General
    
    PRODUCT_TYPE_LAYOUT
        add new row
        INSERT INTO product_type_layout(configuration_title, configuration_key, configuration_value, configuration_description, product_type_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show UPC Number', 'SHOW_PRODUCT_INFO_UPC', 1, 'Display Model Number on Product Info 0=off 1=on', 1, 10, now(), now(), NULL, "zen_cfg_select_drop_down(array(array('id'=>'1', 'text'=>'True'), array('id'=>'0', 'text'=>'False')), ");
    
    PRODUCTS
        add new field
        ALTER TABLE products ADD products_upc VARCHAR(12) DEFAULT(NULL);
    
    ./zencart/admin/includes/modules/product
        this has governing scripts over the general product type
        collect_info.php
            * add products_upc => '' to $parameters associative array
            * add p.products_upc to database query on line 60 apprx.
            */ add the following to the collection form
                <tr>
                    <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
                </tr>
                <tr>
                    <td class="main"><?php echo TEXT_PRODUCTS_UPC; ?></td>
                    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_input_field('products_upc', $pInfo->products_upc, zen_set_field_length(TABLE_PRODUCTS, 'products_upc')); ?></td>
                </tr>
            /*
        collect_info_metatags.php
            * add products_upc => '' to the $parameters associative array
            * add p.products_upc to the SQL query on line 34 apprx
            * add p.products_upc to the SQL query on line 42 apprx
            */ add to line 148 apprx
                '&nbsp;&nbsp;&nbsp;<strong>' . TEXT_PRODUCTS_UPC . '</strong>&nbsp;' . $pInfo->products_upc
            /*
        preview_info.php
            * add p.products_upc to SQL query on line 18 apprx
        preview_info_meta_tags.php
            * add p.products_upc to SQL query on line 18 apprx
            */ add to line 59 apprx
                <td class="main" valign="top">
                   <?php echo '<strong>' . TEXT_PRODUCTS_UPC . '</strong>&nbsp;' . ($pInfo->metatags_upc_status == '1' ? $pInfo->products_upc : TEXT_META_EXCLUDED); ?>
                </td>
            */
    ./zencart/admin/includes/modules/
        update_product.php
            * add products_upc => zen_db_prepare_input($_POST['products_upc']) to $sql_data_array associative array at line 33 apprx
        copy_to_confirm.php
            * add products_upc to the SQL query on line 35 apprx
            * add products_upc to the SQL query on line 53 apprx
            * add '" . zen_db_input($product->fields['products_upc']) . "', to line 65 apprx
        category_product_listing.php
            */ add to line 214 apprx
                case (7):
                    $order_by = " order by p.products_upc DESC, pd.products_upc";
            /*
            * add p.products_upc to line 245 apprx
            * add p.products_upc to line 266 apprx
            */ add to line 332 apprx
                <td class="dataTableContent"><?php echo $products->fields['products_upc']; ?></td>
            /*
    ./zencart/includes/modules/pages/product_info/
        main_template_vars.php
            * add p.products_upc to line 56 apprx
            * add $products_upc = $product_info->fields['products_upc']; to line 102 apprx
            */ add to line 168 apprx
                $flag_show_product_info_upc = zen_get_show_product_switch($_GET['products_id'], 'upc');
            /*
    ./zencart/includes/templates/template_default/templates/
        tpl_product_info_display.php
            */ add to line 123
                <?php echo (($flag_show_product_info_upc == 1 and !empty($products_upc)) ? '<li>' . TEXT_PRODUCT_UPC . $products_upc . '</li>' : '') . "\n"; ?>
            /*
    ./zencart/includes/modules/pages/advanced_search_result/
        header_php.php
            To line 136 apprx 'PRODUCT_LIST_UPC' => PRODUCT_LIST_UPC,
            */ line 167 apprx
    case 'PRODUCT_LIST_UPC':
        $select_column_list .= 'p.products_model';
    break;
            /*
            */ line 302 apprx
    LIKE '%:keywords%'
    OR p.products_upc
            /*
            */ line 423 apprx
    case 'PRODUCT_LIST_UPC':
        $order_str .= "p.products_upc " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_upc";
    break;
            /*
    ./zencart/includes/index_filters/
        default_filter.php
            */ Line 116 apprx
    case 'PRODUCT_LIST_UPC':
        $listing_sql .= "p.products_upc " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_upc";
    break;
            /*
    ./zencart/includes/modules/pages/index/
        main_template_vars.php
            */ line 163 apprx
    case 'PRODUCT_LIST_UPC':
        $select_column_list .= 'p.products_upc, ';
    break;
            /*
    ./zencart/includes/modules/
        product_listing.php
            */ line 95 apprx
    case 'PRODUCT_LIST_UPC':
        $lc_align = '';
        $lc_text = $listing->fields['products_upc'];
    break;
            /*
    This should be enough to get the UPC field nice and presentable, it can be entered in admin interface, viewed in preview, viewed by customer, and is searchable as well. If there is any request for it (I may do it anyway) I shall make a product type maker, cause I may end up having to make one for my job anyway. I can also make a script for this if anyone asks.

    Thanks for reading and any contributions or ideas of things I may have done wrong will be much apprciated,
    --Axpen

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

    Default Re: UPC For Zencart Delivered

    I am positive that this would be of value to many on the forum...

    Was this a modification to the "Products General" type?
    Zen-Venom Get Bitten

  3. #3
    Join Date
    May 2007
    Location
    The Mid-west
    Posts
    10
    Plugin Contributions
    0

    Default Re: UPC For Zencart Delivered

    Yes I modified the product general type

  4. #4
    Join Date
    Jun 2007
    Posts
    167
    Plugin Contributions
    0

    help question Re: UPC For Zencart Delivered

    This looks exactly like what I need! Can you tell me the file path and file name I need to use? Thanks!

  5. #5
    Join Date
    May 2007
    Location
    The Mid-west
    Posts
    10
    Plugin Contributions
    0

    Default Re: UPC For Zencart Delivered

    That code snippet isn't just for one file it's a combination of multiple files and even some SQL code to ALTER your database fields. It's not too structured for ease of readability, when I did this I was writing as I worked, so it's not too pretty. I'll post again by the end of this week with a more exhaustive and better looking tutorial/walk-through for you and others. I would just make a script or module but I have yet to grasp a good link for help making a module for Zen Cart. So until such a time I will work on this tutorial. Thank you for your interest in my addition and I look forward to assisting you in this matter.

    --Alex

  6. #6
    Join Date
    Jun 2007
    Posts
    167
    Plugin Contributions
    0

    Default Re: UPC For Zencart Delivered

    Great! I look forward to using your work!

  7. #7
    Join Date
    May 2007
    Location
    The Mid-west
    Posts
    10
    Plugin Contributions
    0

    Default Re: UPC For Zencart Delivered

    I am working on a little tutorial right now, I got caught up in some road blocks like leaving my howtos at my job, but I should have that tutorial up by late sunday-early next week. I apologize for the delay, just letting you know I didn't forget about you .

  8. #8
    Join Date
    Jun 2007
    Posts
    167
    Plugin Contributions
    0

    Default Re: UPC For Zencart Delivered

    Quote Originally Posted by axpen View Post
    I am working on a little tutorial right now, I got caught up in some road blocks like leaving my howtos at my job, but I should have that tutorial up by late sunday-early next week. I apologize for the delay, just letting you know I didn't forget about you .
    Thanks for the follow up - Mucho appreciado!

  9. #9
    Join Date
    May 2007
    Location
    The Mid-west
    Posts
    10
    Plugin Contributions
    0

    Default Re: UPC For Zencart Delivered

    Ok sorry again about the wait, i've decided not to post about how to do it, rather make a module for you. I figured that would be best and easiest, and thusly is what is taking longer. I will have the module up later this evening. I will however warn you that since Zencart hasn't implemented admin overrides the would be trivial task of uploading files to the CUSTOM directory will instead be covered by other means. As I have detailed instructions in my README file I shan't delve into the details here, but I will be replacing my first post with a better formated text of my README.

    Again thank you for your interest in my efforts, you can also expect an invoice module and POS module from me over the course of the next few months.

    --Alex

  10. #10
    Join Date
    May 2007
    Location
    The Mid-west
    Posts
    10
    Plugin Contributions
    0

    Default Re: UPC For Zencart Delivered

    Alright, I apologize for the delay of posting, I got tied up at work a bit. But without further adeiu I have the finished module. After getting approval and fix ups from some other members I shall then release it under the Zencart modules.

    Thanks for your patience,
    --Alex

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. UPC for google
    By kitcorsa in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 12 Oct 2011, 12:27 PM
  2. Numix Product Fields for upc
    By new2u in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 18 Sep 2010, 07:13 AM
  3. upc AND item number for products
    By neobonzi in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 24 Jul 2008, 09:21 PM
  4. Using UPC to get information for books, cds, movies
    By dinki in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 9 May 2008, 04:57 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