Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2009
    Posts
    31
    Plugin Contributions
    0

    Default Modding Stock by Attribute to have SKUs / Model Number

    I know that alot of people have been trying to establish a SKU for Product variants. It seems to me that all that is needed is to add a another Column to database of "Stocks by Attributes". I did this and have been able to output the model #'s to the admin by editing the output code in the admin/products_with_attributes_stock.php file (haven't gotten to adding it to shopping cart and what not yet).

    What I am having trouble with is making it so that I can add skus in the admin section like you are able to do with the attribute inventory. Would anybody happen to know the code to do this.

    I think maybe this is what everybody may be looking for in order to have SKU's for Product attributes. Unfortunately my PHP skills are not up to par yet.

  2. #2
    Join Date
    Mar 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: Modding Stock by Attribute to have SKUs / Model Number

    For those of you wondering to output the attribute sku in Admin -> Products with attributes stock I first added another column to the table products_with_attributes_stock called attributes_sku

    then to display this info I added or changed the following code in admin/products_with_attributes_stock.php

    Changed
    PHP Code:
    echo '<th class="stockAttributesHeadingStockId">'.PWA_STOCK_ID.'</th><th class="stockAttributesHeadingVariant">'.PWA_VARIANT.'</th><th class="stockAttributesHeadingQuantity">'.PWA_QUANTITY_IN_STOCK.'</th><th class="stockAttributesHeadingEdit">'.PWA_EDIT.'</th><th class="stockAttributesHeadingDelete">'.PWA_DELETE.'</th>'

    To

    PHP Code:
    echo '<th class="stockAttributesHeadingStockId">'.PWA_STOCK_ID.'</th><th class="stockAttributesHeadingVariant">'.PWA_VARIANT.'</th><th class="stockAttributesHeadingSku">'.PWA_ATTRIBUTES_SKU.'</th><th class="stockAttributesHeadingQuantity">'.PWA_QUANTITY_IN_STOCK.'</th><th class="stockAttributesHeadingEdit">'.PWA_EDIT.'</th><th class="stockAttributesHeadingDelete">'.PWA_DELETE.'</th>'
    and added


    PHP Code:
    echo '<td class="stockAttributesCellSku">'."\n";
                echo 
    $attribute_products->fields['attributes_sku'];
                echo 
    '</td>'."\n"
    right after

    PHP Code:
    sort($attributes_output);
                echo 
    implode("\n",$attributes_output); 



    and to admin/includes/languages/english/products_with_attributes_stock.php

    I added
    PHP Code:
    define('PWA_ATTRIBUTES_SKU''Attributes SKU'); 
    and to admin/includes/stock_attributes.css

    I changed

    PHP Code:
    .stockAttributesHeadingStockId,
    .
    stockAttributesHeadingVariant,
    .
    stockAttributesHeadingQuantity,
    .
    stockAttributesHeadingEdit,
    .
    stockAttributesHeadingDelete {
        
    border-bottom1px solid #ccc;
        
    width:18%;

    to

    PHP Code:
    .stockAttributesHeadingSku,
    .
    stockAttributesHeadingStockId,
    .
    stockAttributesHeadingVariant,
    .
    stockAttributesHeadingQuantity,
    .
    stockAttributesHeadingEdit,
    .
    stockAttributesHeadingDelete {
        
    border-bottom1px solid #ccc;
        
    width:18%;

    and changed

    PHP Code:
    .stockAttributesCellStockId,
    .
    stockAttributesCellVariant,
    .
    stockAttributesCellQuantity,
    .
    stockAttributesCellEdit,
    .
    stockAttributesCellDelete {
        
    border-bottom1px dotted #ccc;

    to

    PHP Code:
    .stockAttributesCellSku,
    .
    stockAttributesCellStockId,
    .
    stockAttributesCellVariant,
    .
    stockAttributesCellQuantity,
    .
    stockAttributesCellEdit,
    .
    stockAttributesCellDelete {
        
    border-bottom1px dotted #ccc;

    This mod served my purposes so if any of you would like to take it any further, such as output this info to orders and or shopping cart or make the Attribute SKU editable via the admin please do so

  3. #3
    Join Date
    Feb 2008
    Posts
    569
    Plugin Contributions
    0

    Default Re: Modding Stock by Attribute to have SKUs / Model Number

    Is this working? Has it been tested?

  4. #4
    Join Date
    May 2009
    Posts
    15
    Plugin Contributions
    0

    Default Re: Modding Stock by Attribute to have SKUs / Model Number

    Has there been any change or new information on these mods. I desperately need to be able to attach model numbers/SKU by attribute rather than to simple product description.

    Help Please!

 

 

Similar Threads

  1. Stock by Attributes Model Number
    By ryanb4614 in forum General Questions
    Replies: 0
    Last Post: 6 Dec 2010, 03:47 AM
  2. I have lost my Model Number
    By RsUnv in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 1 Jul 2010, 10:42 AM
  3. Model Number-Weight-Stock
    By Squeakywheels in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 24 Mar 2009, 07:22 PM
  4. Attributes and model numbers (skus)
    By magneteye in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 20 Feb 2008, 02:42 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