Page 67 of 113 FirstFirst ... 1757656667686977 ... LastLast
Results 661 to 670 of 1125
  1. #661
    Join Date
    Mar 2009
    Posts
    5
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Well, what we want to display is basically an exact copy of the sql table "products_with_attributes_stock" with the option name displayed instead of the "stock_attributes" Field. You can see the table through phpMyAdmin.

    That info would go into the php file:

    tpl_product_info_display.php

    located...
    /includes/templates/template_default/templates

    You can see where the information for the bulleted list after the product description comes from. I would suppose that another php command could just be created right after the closing tag of the "Manufactured By" php command.

    Then it is just a matter of getting the syntax correct for displaying mysql information in tabular format using php. Examples can be found everywhere on the internet for this.

    That's what I've figured out so far, It's not much. I'll try to do some more work on it later tonight and post any findings I may come across.

    -Chris

  2. #662
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Stocks by attributes

    Dang dude!! You are DEFINITELY braver than me.. I am REALLY thinking that I may need to enlist some PHP help.. to do this.. It would probably take a PHP genius a hot second to do this while I was still futzing around with it..

    Quote Originally Posted by the44chris View Post
    Well, what we want to display is basically an exact copy of the sql table "products_with_attributes_stock" with the option name displayed instead of the "stock_attributes" Field. You can see the table through phpMyAdmin.

    That info would go into the php file:

    tpl_product_info_display.php

    located...
    /includes/templates/template_default/templates

    You can see where the information for the bulleted list after the product description comes from. I would suppose that another php command could just be created right after the closing tag of the "Manufactured By" php command.

    Then it is just a matter of getting the syntax correct for displaying mysql information in tabular format using php. Examples can be found everywhere on the internet for this.

    That's what I've figured out so far, It's not much. I'll try to do some more work on it later tonight and post any findings I may come across.

    -Chris

  3. #663
    Join Date
    Dec 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Quote Originally Posted by cropinstop View Post
    Found the solution.

    An "attribute stock exceeded" check is missing from "includes/modules/pages/checkout/header_php.php". This file is unique to the "Fast and Easy Checkout" contribution.

    Change ....
    @cropinstop: Thanks for reply! I'm having a problem with FEC: my installation of FEC made the checkout process STOP checking out the 'stock for attributes' stock COMPLETELY! So if there are stock left for an attribute and someone checks out, it doesn't reduce the stock. Any clue what's happening?

  4. #664
    Join Date
    Oct 2008
    Posts
    10
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Somebody was asking the reason why Stock by Attributes cannot delete variants in admin when you are using your own language that is not english.

    The problem is in confirm deletion form which is returning the word 'Yes' translated in your own language.

    The deletion routine is currently waiting for the string 'Yes' and not 'Si' or 'Oui' or whatever translation of 'Yes' is in your language so you need to change the line 309 of /admin/produtcs_with_attributes_stock.php.

    Code:
    if($_POST['confirm'] == 'Yes')
    to

    Code:
    if($_POST['confirm'] == TEXT_YES)
    Zencart 1.3.8a italian with SBA 4.7 Multi

    Regards and always many thanks for this great mods

  5. #665
    Join Date
    Jan 2005
    Location
    USA, St. Louis
    Posts
    3,710
    Plugin Contributions
    9

    Default Re: Stocks by attributes

    Quote Originally Posted by kellan4459 View Post
    I made a single SQL statement change that does the behavior that I was looking for in my original post. After reading some posts by Grayson I think I was able to do this properly. The version of zencart I have has since replaced main_template_vars_attributes.php with just attributes.php. What I wanted to do was prevent the option from showing if the individual product-option qty was 0. I made the following modification using a LEFT JOIN and then doing a check whether the quantity is greater than zero or IS NULL within the same sql statement. If > 0 then the individual product-option has qty available. If it IS NULL then there is not an entry for this product-option and it should be using the Main Item Qty.

    Code:
    $sql=	"SELECT  pov.products_options_values_id,
            pov.products_options_values_name,
            pa.*,
            pwas.*
            FROM   " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas ON pwas.stock_attributes = pa.products_attributes_id
            WHERE   pa.products_id = '" . (int)$_GET['products_id'] . "'
            and    pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
    		and    (pwas.quantity > 0 or pwas.quantity IS NULL)
            and    pa.options_values_id = pov.products_options_values_id
                  and       pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
    		$order_by;


    Do any of the senior zenners see any potential problems with this? Are there other areas that could potentially be broken by this modification that I may have missed?

    Thanks
    I'm trying to get a method where the drop down menu shows how many of each available items there are, but AT THE SAME doesn't show any zero items at all. I can only seem to get one or the other to work.

    Does anyone have it to where ZERO options don't show up, but the drop down menu tells you how many for each that ARE available?

    If someone has this working, would you mind attaching your attributes.php file?
    Thanks!
    Thanks!

  6. #666
    Join Date
    Jan 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    I second Jettrue, I'm trying to do the same, I just cannot get it to work....

    If someone has their php file would be massively appreciated.

    Nyssa.

  7. #667
    Join Date
    May 2008
    Location
    E. Stroudsburg, PA
    Posts
    4
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    I am on a Mac and using MAMP to host locally until I can get this thing built. I've used the Install SQL Patch function. I can't figure out how to upload the files correctly in my LOCAL directory.

    "If you are installing onto a new install or upgrade of Zen Cart 1.3.5 or later then with most good FTP programs (such as FileZilla) you can simply drag and drop the admin and includes directories into the root directory of your site. The files are already arranged in their directory structure."

    I tried grag and drop into my local folders at /Applications/MAMP/htdocs/NAME OF MY SITE/ but I can no longer log in afterwards. I tried using FileZilla and Fetch but can't seem to find the local direrctory. Any help with a step by step would be great. My co. is trying to sell off year dated shirts so I need this to work.

  8. #668
    Join Date
    May 2008
    Location
    E. Stroudsburg, PA
    Posts
    4
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    One more thing - I've been on this for 8 hours now and have read all 67 pages of this thread. A case of your fav. beverage to the person who solves this for me.

  9. #669
    Join Date
    Jan 2005
    Location
    USA, St. Louis
    Posts
    3,710
    Plugin Contributions
    9

    Default Re: Stocks by attributes

    Quote Originally Posted by SurrealDesign View Post
    I second Jettrue, I'm trying to do the same, I just cannot get it to work....

    If someone has their php file would be massively appreciated.

    Nyssa.
    I actually got it myself. I just add an if statement right before the section where the drop menu items are created. Anyway, I'm attaching my includes/modules/attributes.php. Use at your own risk and please test. This one will show how many items in stock in the drop down, but will NOT show a drop down item if its not in stock. I'm using the multiadd version, so I'm not sure if its compatible if you're using the other.

    If you want to just replace what I've changed, here's my chunk starting $sql starting around line 79 in my file, and ending RIGHT BEFORE this line:

    Code:
    if (((CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) or ((CUSTOMERS_APPROVAL_AUTHORIZATION == '1' or CUSTOMERS_APPROVAL_AUTHORIZATION == '2') and $_SESSION['customers_authorization'] == '') or (CUSTOMERS_APPROVAL == '2' and $_SESSION['customers_authorization'] == '2') or (CUSTOMERS_APPROVAL_AUTHORIZATION == '2' and $_SESSION['customers_authorization'] != 0) ) {
    Here's my chunk:

    Code:
    $sql=	"SELECT  pov.products_options_values_id,
            pov.products_options_values_name,
            pa.*,
            pwas.*
            FROM   " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa LEFT JOIN " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas ON pwas.stock_attributes = pa.products_attributes_id
            WHERE   pa.products_id = '" . (int)$_GET['products_id'] . "'
            and    pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
    		and    (pwas.quantity > 0 or pwas.quantity IS NULL)
            and    pa.options_values_id = pov.products_options_values_id
                  and       pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
    		$order_by;
    
      
                    $products_options = $db->Execute($sql);
    
                    $products_options_value_id = '';
                    $products_options_details = '';
                    $products_options_details_noname = '';
                    $tmp_radio = '';
                    $tmp_checkbox = '';
                    $tmp_html = '';
                    $selected_attribute = false;
    
                    $tmp_attributes_image = '';
                    $tmp_attributes_image_row = 0;
                    $show_attributes_qty_prices_icon = 'false';
                    while (!$products_options->EOF) {
                      // reset
                      $products_options_display_price='';
                      $new_attributes_price= '';
                      $price_onetime = '';
                      
                      
    
    if($products_options->fields['quantity'] > 0)
    {
    	$products_text_to_use = $products_options->fields['products_options_values_name'] . " (" .  $products_options->fields['quantity'] . " Available)"; //yes Available is improperly hard coded 
    	} 
    	else 
    	{
    	$products_text_to_use = $products_options->fields['products_options_values_name'];
    }
    
    
    if($products_options->fields['quantity'] > 0)
    {
       $products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
       'text' => $products_text_to_use);
        }
        else
        {}
    Attached Files Attached Files

  10. #670
    Join Date
    Jan 2005
    Location
    USA, St. Louis
    Posts
    3,710
    Plugin Contributions
    9

    Default Re: Stocks by attributes

    Never mind that, my version causes a problem if you don't define a value for every attribute you enter. Which is why I guess you have to have one or the other. Will see if I can figure something out.

 

 
Page 67 of 113 FirstFirst ... 1757656667686977 ... LastLast

Similar Threads

  1. v139h Stocks of certain products disappearing automatically
    By Lowwi in forum General Questions
    Replies: 4
    Last Post: 11 Aug 2015, 09:09 PM
  2. Installing Stocks by Attribute
    By dragon03kf in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Oct 2008, 07:42 PM
  3. Stocks by attributes
    By hcd888 in forum General Questions
    Replies: 1
    Last Post: 12 May 2008, 08:52 AM
  4. Multiple stocks per product
    By jaycode in forum General Questions
    Replies: 4
    Last Post: 5 Aug 2007, 11:55 AM
  5. Products with attribute stocks
    By Svanis in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 5 Jul 2006, 03:19 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