Page 175 of 359 FirstFirst ... 75125165173174175176177185225275 ... LastLast
Results 1,741 to 1,750 of 3589
  1. #1741
    Join Date
    Jun 2012
    Location
    Florida
    Posts
    123
    Plugin Contributions
    5

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by gohealth View Post
    This is what the error looks like. Not only does it show a product that has quantity, but also has some formatting issues in the drop downs.
    Attachment 13212

    Again, any thoughts greatly appreciated. Note, I have done another clean install on another test site with the exact same issues.
    The file located at:
    includes\languages\english\extra_definitions\products_with_attributes.php
    is where the issue resides, simply update the file with a text editor and remove the <b> </b> found around the text.

    As a note, I removed these from the next version we will post.
    Backup Files and Databases First. GitHub
    Suggestions, Plugins, etc. used at your own risk.

  2. #1742
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    Idea or Suggestion Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by gohealth View Post
    This is what the error looks like. Not only does it show a product that has quantity, but also has some formatting issues in the drop downs.
    Attachment 13212

    Again, any thoughts greatly appreciated. Note, I have done another clean install on another test site with the exact same issues.
    Shouldn't this simply hidden when it is sold out instead of saying 'Out of Stock' ?

    How can I make it so that when there are total of ;
    Item size 'S' with 5 quantity
    Item size 'M' with 5 quantity
    Item size 'L' with 5 quantity

    Then ... when the ..

    1. Item size 'S' is sold out, Size attribute 'S' is hidden (not visible) to the customers. Leaving only Size 'M' and size 'L'
    2. Item size 'M' is sold out, Size attribute 'M' is hidden not visible to the customers. Leaving only Size 'L'
    3. Item size 'L' is sold out, All size attribute are hidden not visible to the customers. Leaving only 'OUT OF STOCK' for the product showing default Zencart 'OUT-OF-STOCK' ICON..

    Of course above is only an example. In reality it applies to which ever size in what ever order happens (sold).

    Love to be able to do that and looking forward to some solutions.
    Last edited by oavs; 27 Oct 2013 at 09:48 AM.
    Downunder QLD

  3. #1743
    Join Date
    Jun 2011
    Posts
    91
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by oavs View Post
    Shouldn't this simply hidden when it is sold out instead of saying 'Out of Stock' ?

    How can I make it so that when there are total of ;
    Item size 'S' with 5 quantity
    Item size 'M' with 5 quantity
    Item size 'L' with 5 quantity

    Then ... when the ..

    1. Item size 'S' is sold out, Size attribute 'S' is hidden (not visible) to the customers. Leaving only Size 'M' and size 'L'
    2. Item size 'M' is sold out, Size attribute 'M' is hidden not visible to the customers. Leaving only Size 'L'
    3. Item size 'L' is sold out, All size attribute are hidden not visible to the customers. Leaving only 'OUT OF STOCK' for the product showing default Zencart 'OUT-OF-STOCK' ICON..

    Of course above is only an example. In reality it applies to which ever size in what ever order happens (sold).

    Love to be able to do that and looking forward to some solutions.
    This version will show "Out of Stock" when the product level is zero. It was written to work that way. If you want to completely hide the attribute when stock is zero, you will need to find and older version and replace the file /YOUR_ADMIN/products_with_attributes_stock.php with this file

    PHP Code:
    <?php
    /**
     * @package admin
     * @copyright Copyright 2003-2006 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: products_with_attributes_stock.php 389 2008-11-14 16:02:14Z hugo13 $
     */

    require('includes/application_top.php');
    require(
    DIR_WS_CLASSES 'currencies.php');
    require(
    DIR_WS_CLASSES 'products_with_attributes_stock.php');


    $stock = new products_with_attributes_stock;

    if(isset(
    $_SESSION['languages_id'])){ $language_id $_SESSION['languages_id'];} else { $language_id=1;}

    if(isset(
    $_GET['action']))
    {
        
    $action $_GET['action'];
    }
    else
    {
        
    $action '';
    }

    switch(
    $action)
    {
        case 
    'add':
            if(isset(
    $_GET['products_id']) and is_numeric((int)$_GET['products_id']))
            {
                
    $products_id = (int)$_GET['products_id'];
            }
            if(isset(
    $_POST['products_id']) and is_numeric((int)$_POST['products_id']))
            {
                
    $products_id = (int)$_POST['products_id'];
            }

            if(isset(
    $products_id))
            {

                if(
    zen_products_id_valid($products_id))
                {

                    
    $product_name zen_get_products_name($products_id);
                    
    $product_attributes $stock->get_products_attributes($products_id$language_id);

                  
    $hidden_form .= zen_draw_hidden_field('products_id',$products_id)."\n";
                }
                else
                {

                    
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCKzen_get_all_get_params(array('action')), 'NONSSL'));
                }
            }
            else
            {

                
    $query 'SELECT DISTINCT
                            attrib.products_id, description.products_name
                          FROM 
                            '
    .TABLE_PRODUCTS_ATTRIBUTES.' attrib, '.TABLE_PRODUCTS_DESCRIPTION.' description
                          WHERE 
                            attrib.products_id = description.products_id and description.language_id='
    .$language_id.' order by description.products_name';

                
    $products $db->execute($query);
                while(!
    $products->EOF)
                {
                    
    $products_array_list[] = array(
                    
    'id' => $products->fields['products_id'],
                    
    'text' => $products->fields['products_name']
                    );
                    
    $products->MoveNext();
                }
            }
            break;
        case 
    'edit':
            
    $hidden_form '';
            if(isset(
    $_GET['products_id']) and is_numeric((int)$_GET['products_id']))
            {
                
    $products_id $_GET['products_id'];
            }

            if(isset(
    $_GET['attributes']))
            {
                
    $attributes $_GET['attributes'];
            }

            if(isset(
    $products_id) and isset($attributes))
            {
                
    $attributes explode(',',$attributes);
                foreach(
    $attributes as $attribute_id){
                    
    $hidden_form .= zen_draw_hidden_field('attributes[]',$attribute_id)."\n";
                    
    $attributes_list[] = $stock->get_attributes_name($attribute_id$language_id);
                }
                
    $hidden_form .= zen_draw_hidden_field('products_id',$products_id)."\n";
            }
            else
            {
                
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCKzen_get_all_get_params(array('action')), 'NONSSL'));
            }

            break;

        case 
    'confirm':
            if(isset(
    $_POST['products_id']) and is_numeric((int)$_POST['products_id']))
            {

                if(!isset(
    $_POST['quantity']) || !is_numeric($_POST['quantity']))
                {
                    
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCKzen_get_all_get_params(array('action')), 'NONSSL'));
                }
                
    $products_id $_POST['products_id'];
                
    $product_name zen_get_products_name($products_id);
                if(
    is_numeric($_POST['quantity']))
                {
                    
    $quantity $_POST['quantity'];
                }

                
    $attributes $_POST['attributes'];
        
                foreach(
    $attributes as $attribute_id)
                {
                    
    $hidden_form .= zen_draw_hidden_field('attributes[]',$attribute_id)."\n";
                    
    $attributes_list[] = $stock->get_attributes_name($attribute_id$_SESSION['languages_id']);
                }
                
    $hidden_form .= zen_draw_hidden_field('products_id',$products_id)."\n";
                
    $hidden_form .= zen_draw_hidden_field('quantity',$quantity)."\n";
                
    $s_mack_noconfirm .="products_id=" $products_id "&"//s_mack:noconfirm
                
    $s_mack_noconfirm .="quantity=" $quantity "&"//s_mack:noconfirm

                
    if(sizeof($attributes) > 1)
                {
                    
    sort($attributes);
                    
    $stock_attributes implode(',',$attributes);
                }
                else
                {
                    
    $stock_attributes $attributes[0];
                }
                
    $s_mack_noconfirm .='attributes=' $stock_attributes '&'//kuroi: to pass string not array

                
    $query 'select * from '.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.' where products_id = '.$products_id.' and stock_attributes="'.$stock_attributes.'"';
                
    $stock_check $db->Execute($query);

                if(!
    $stock_check->EOF)
                {
                    
    $hidden_form .= zen_draw_hidden_field('add_edit','edit');
                    
    $hidden_form .= zen_draw_hidden_field('stock_id',$stock_check->fields['stock_id']);
                    
    $s_mack_noconfirm .="stock_id=" $stock_check->fields['stock_id'] . "&"//s_mack:noconfirm
                    
    $s_mack_noconfirm .="add_edit=edit&"//s_mack:noconfirm
                    
    $add_edit 'edit';
                }
                else
                {
                    
    $hidden_form .= zen_draw_hidden_field('add_edit','add')."\n";
                    
    $s_mack_noconfirm .="add_edit=add&"//s_mack:noconfirm
                
    }

            }
            else
            {
                
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCKzen_get_all_get_params(array('action')), 'NONSSL'));
            }
            
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK$s_mack_noconfirm "action=execute"'NONSSL')); //s_mack:noconfirm
            
    break;
        case 
    'execute':
            
    $attributes $_POST['attributes'];
            if (
    $_GET['attributes']) { $attributes $_GET['attributes']; } //s_mack:noconfirm

            
    $products_id $_POST['products_id'];
            if (
    $_GET['products_id']) { $products_id $_GET['products_id']; } //s_mack:noconfirm

            
    $quantity $_GET['quantity']; //s_mack:noconfirm
            
    if ($_GET['quantity']) { $quantity $_GET['quantity']; } //s_mack:noconfirm
            
    if(!is_numeric((int)$quantity)) //s_mack:noconfirm
            
    {
                
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCKzen_get_all_get_params(array('action')), 'NONSSL'));
            }

            
    /*
            michael mcinally <[email protected]>
            heavily modified version to allow inserting "ALL" attributes at once
            also should probably run this SQL command as well:
            ALTER TABLE `products_with_attributes_stock` ADD UNIQUE `products_id_stock_attributes` (`products_id`, `stock_attributes`);
            */
            
    if(($_POST['add_edit'] == 'add') || ($_GET['add_edit'] == 'add')) //s_mack:noconfirm
            
    {
                if (
    preg_match("/\|/"$attributes)) {

                    
    $arrTemp preg_split("/\,/"$attributes);
                    
    $arrMain = array();
                    
    $intCount 0;
                    for (
    $i 0;$i sizeof($arrTemp);$i++) {
              
    $arrTemp1 preg_split("/\|/"$arrTemp[$i]);
              
    $arrMain[] = $arrTemp1;
                        if (
    $intCount) {
                            
    $intCount $intCount sizeof($arrTemp1);
                        } else {
                            
    $intCount sizeof($arrTemp1);
                        }
                    }
                    
    $intVars sizeof($arrMain);
                    
    $arrNew = array();
                    if (
    $intVars >= 1) {
                        eval(
    '
                        for ($i = 0;$i < sizeof($arrMain[0]);$i++) {
                            if ($intVars >= 2) {
                                for ($j = 0;$j < sizeof($arrMain[1]);$j++) {
                                    if ($intVars >= 3) {
                                        for ($k = 0;$k < sizeof($arrMain[2]);$k++) {
                                            if ($intVars >= 4) {
                                                for ($l = 0;$l < sizeof($arrMain[3]);$l++) {
                                                    if ($intVars >= 5) {
                                                        for ($m = 0;$m < sizeof($arrMain[4]);$m++) {
                                                            if ($intVars >= 6) {
                                                                for ($n = 0;$n < sizeof($arrMain[5]);$n++) {
                                                                    $arrNew[] = array($arrMain[0][$i], $arrMain[1][$j], $arrMain[2][$k], $arrMain[3][$l], $arrMain[4][$m], $arrMain[5][$n]);
                                                                }
                                                            } else {
                                                                $arrNew[] = array($arrMain[0][$i], $arrMain[1][$j], $arrMain[2][$k], $arrMain[3][$l], $arrMain[4][$m]);
                                                            }
                                                        }
                                                    } else {
                                                        $arrNew[] = array($arrMain[0][$i], $arrMain[1][$j], $arrMain[2][$k], $arrMain[3][$l]);
                                                    }
                                                }
                                            } else {
                                                $arrNew[] = array($arrMain[0][$i], $arrMain[1][$j], $arrMain[2][$k]);
                                            }
                                        }
                                    } else {
                                        $arrNew[] = array($arrMain[0][$i], $arrMain[1][$j]);
                                    }
                                }
                            } else {
                                $arrNew[] = array($arrMain[0][$i]);
                            }
                        }
                        '
    );
                    }
                    for (
    $i 0;$i sizeof($arrNew);$i++) {
                        
    $strAttributes implode(","$arrNew[$i]);
                        
    $query 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$strAttributes.'",'.$quantity.') ON DUPLICATE KEY UPDATE `stock_attributes` = "'.$strAttributes.'", `quantity` = '.$quantity;
                        
    $db->Execute($query);
                    }
                } else {
                
    $query 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$attributes.'",'.$quantity.')';
                    
    $db->Execute($query);
                }
            }
            elseif((
    $_POST['add_edit'] == 'edit') || ($_GET['add_edit'] == 'edit')) //s_mack:noconfirm
            
    {
                
    $stock_id $_POST['stock_id']; //s_mack:noconfirm
                
    if ($_GET['stock_id']) { $stock_id $_GET['stock_id']; } //s_mack:noconfirm
                
    if(!is_numeric((int)$stock_id)) //s_mack:noconfirm
                
    {
                    
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCKzen_get_all_get_params(array('action')), 'NONSSL'));
                }

                
    $query 'update `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` set quantity='.$quantity.' where stock_id='.$stock_id.' limit 1';
                    
    $db->Execute($query);
            }
            

            
    $stock->update_parent_products_stock($products_id);
            
    $messageStack->add_session('Product successfully updated''success');
            
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL'));

            break;
        case 
    'delete':
            if(!isset(
    $_POST['confirm']))
            {
                
    // do nothing
            
    }
            else
            {
                
    // delete it
                
    if($_POST['confirm'] == TEXT_YES){
                    
    $query 'delete from '.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.' where products_id="'.$_POST['products_id'].'" and stock_attributes="'.$_POST['attributes'].'" limit 1';
                    
    $db->Execute($query);
                    
    $stock->update_parent_products_stock((int)$_POST['products_id']);
                    
    $messageStack->add_session('Product Variant was deleted''failure');
                    
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL'));
                } else {
                    
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL'));
                }
            }
            break;

        case 
    'resync':
            if(
    is_numeric((int)$_GET['products_id'])){

                
    $stock->update_parent_products_stock((int)$_GET['products_id']);
                
    $messageStack->add_session('Parent Product Quantity Updated''success');
                
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL'));

            } else {
                
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL'));
            }
            break;
      case 
    'resync_all':
        
    $stock->update_all_parent_products_stock();
        
    $messageStack->add_session('Parent Product Quantities Updated''success');
        
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL'));    
      break;
      case 
    'auto_sort':
        
    // get all attributes
        
    $sql $db->Execute("SELECT stock_id, stock_attributes FROM " TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " ORDER BY stock_id ASC;");
        
    $count 0;
        while (!
    $sql->EOF) {
          
    // get main attribute only for sort
          
    $attributes explode(','$sql->fields['stock_attributes']);
          
    $main_attribute_id $attributes[0];
          
    // get the sort order
          
    $sort_query "SELECT pa.products_attributes_id, pov.products_options_values_sort_order as sort 
                         FROM " 
    TABLE_PRODUCTS_ATTRIBUTES " pa
                         LEFT JOIN " 
    TABLE_PRODUCTS_OPTIONS_VALUES " pov on (pov.products_options_values_id = pa.options_values_id)
                         WHERE pa.products_attributes_id = " 
    $main_attribute_id "
                         LIMIT 1;"
    ;
          
    $sort $db->Execute($sort_query); 
          
    $sort $sort->fields['sort'];
          
    // update sort in db
          
    $db->Execute("UPDATE " TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " set sort = '" $sort "' WHERE stock_id = '" $sql->fields['stock_id'] . "' LIMIT 1;");
          
    $count++;
          
    $sql->MoveNext();
        }
        
    $messageStack->add_session($count ' stock attributes updated for sort by primary attribute sort order''success');
        
    zen_redirect(zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL'));                   
      break;
        default:
            
    // Show a list of the products

            
    break;
    }


    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>">
    <title><?php echo TITLE?></title>
    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
    <link rel="stylesheet" type="text/css" href="includes/products_with_attributes_stock_ajax.css" media="all" id="hoverJS">
    <script language="javascript" type="text/javascript" src="../ajax/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="../ajax/jquery.form.js"></script>
    <script language="javascript" type="text/javascript" src="../ajax/products_with_attributes_stock_ajax.js"></script>
    <script language="javascript" type="text/javascript" src="includes/menu.js"></script>
    <script language="javascript" type="text/javascript" src="includes/general.js"></script>
    <script type="text/javascript">
    <!--
    function init()
    {
        cssjsmenu('navbar');
        if (document.getElementById)
        {
            var kill = document.getElementById('hoverJS');
            kill.disabled = true;
        }
    }
    // -->
    </script>
    </head>
    <body onLoad="init()">
    <!-- header //-->
    <?php
    require(DIR_WS_INCLUDES 'header.php');
    ?>
    <!-- header_eof //-->
    <div style="padding: 20px;">

    <!-- body_text_eof //-->
    <!-- body_eof //-->
    <?php

    switch($action)
    {
        case 
    'add':


            if(isset(
    $products_id))
            {

                echo 
    zen_draw_form('final_refund_exchange'FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'action=confirm''post'''true)."\n";
                echo 
    $hidden_form;

                echo 
    '<p><strong>'.$product_name.'</strong></p>'."\n";

                foreach(
    $product_attributes as $option_name => $options)
                {
    // MULTI
                    
    $arrValues = array();
                    if (
    is_array($options)) {
                        if (
    sizeof($options) > 0) {
                            foreach (
    $options as $k => $a) {
                                
    $arrValues[] = $a['id'];
                            }
                        }
                    }
                    
                    
    array_unshift($options, array('id' => implode("|"$arrValues), 'text' => 'All'));
                    echo 
    '<p><strong>'.$option_name.': </strong>';
                    echo 
    zen_draw_pull_down_menu('attributes[]',$options).'</p>'."\n";

                }

                echo 
    '<p><strong>' PWA_QUANTITY '</strong>'.zen_draw_input_field('quantity').'</p>'."\n";

            }
            else
            {

                echo 
    zen_draw_form('final_refund_exchange'FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'action=add''post'''true)."\n";
                echo 
    zen_draw_pull_down_menu('products_id',$products_array_list)."\n";
            }

    ?>
        <p><input type="submit" value="<?php echo PWA_SUBMIT ?>"></p>
        </form>
    <?php
    break;
        case 
    'edit':

            echo 
    zen_draw_form('final_refund_exchange'FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'action=confirm''post'''true)."\n";
            echo 
    '<h3>'.zen_get_products_name($products_id).'</h3>';

            foreach(
    $attributes_list as $attributes)
            {
                echo 
    '<p><strong>'.$attributes['option'].': </strong>'.$attributes['value'].'</p>';
            }

            echo 
    $hidden_form;
            echo 
    '<p><strong>Quantity: </strong>'.zen_draw_input_field('quantity'$_GET['q']).'</p>'."\n"//s_mack:prefill_quantity
    ?>
        <p><input type="submit" value="<?php echo PWA_SUBMIT ?>"></p>
        </form>
    <?php
    break;
        case 
    'delete':
            if(!isset(
    $_POST['confirm']))
            {

                echo 
    zen_draw_form('final_refund_exchange'FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'action=delete''post'''true)."\n";
                echo 
    PWA_DELETE_VARIANT_CONFIRMATION;
                foreach(
    $_GET as $key=>$value)
                {
                    echo 
    zen_draw_hidden_field($key,$value);
                }
    ?>
         <p><input type="submit" value="<?php echo TEXT_YES ?>" name="confirm"> * <input type="submit" value="<?php echo TEXT_NO ?>" name="confirm"></p>
         </form>
    <?php  
            
    }
            break;
        case 
    'confirm':

            echo 
    '<h3>Confirm '.$product_name.'</h3>';

            foreach(
    $attributes_list as $attributes)
            {
                echo 
    '<p><strong>'.$attributes['option'].': </strong>'.$attributes['value'].'</p>';
            }

            echo 
    '<p><strong>Quantity</strong>'.$quantity.'</p>';
            echo 
    zen_draw_form('final_refund_exchange'FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'action=execute''post'''true)."\n";
            echo 
    $hidden_form;
    ?>
        <p><input type="submit" value="<?php echo PWA_SUBMIT ?>"></p>
        </form>

    <?php     
    break;
        default:
        echo 
    '<div id="hugo1" style="background-color: green; padding: 2px 10px;"></div>';    
        echo 
    '<form method="get" action="' zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL') . '" id="pwas-search" name="pwas-search">Search:  <input id="pwas-filter" type="text" name="search"/><input type="submit" value="Search" id="pwas-search-button" name="pwas-search-button"/></form><span style="margin-right:10px;">&nbsp;</span>';
        echo 
    '<a href="' zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'''NONSSL') . '">Reset</a><span style="margin-right:10px;">&nbsp;</span><a href="' zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK'action=auto_sort''NONSSL') . '">Sort</a>';
        echo 
    '<span id="loading" style="display: none;"><img src="../images/ajax-loader2.gif" alt="" /> Loading...</span><hr />';
        echo 
    '<a class="forward" style="float:right;" href="'.zen_href_link(FILENAME_PRODUCTS_WITH_ATTRIBUTES_STOCK"action=resync_all"'NONSSL').'"><strong>Sync All Quantities</strong></a><br class="clearBoth" /><hr />';
        echo 
    '<div id="pwa-table">';
        echo 
    $stock->displayFilteredRows();
        echo 
    '</div>';
    break;
    }
    ?>
    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES 'footer.php'); ?>
    <!-- footer_eof //-->
    <br />
    </div>
    </body>
    </html>
    <?php require(DIR_WS_INCLUDES 'application_bottom.php'); ?>

  4. #1744
    Join Date
    Jun 2012
    Location
    Florida
    Posts
    123
    Plugin Contributions
    5

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by oavs View Post
    Shouldn't this simply hidden when it is sold out instead of saying 'Out of Stock' ?

    How can I make it so that when there are total of ;
    Item size 'S' with 5 quantity
    Item size 'M' with 5 quantity
    Item size 'L' with 5 quantity

    Then ... when the ..

    1. Item size 'S' is sold out, Size attribute 'S' is hidden (not visible) to the customers. Leaving only Size 'M' and size 'L'
    2. Item size 'M' is sold out, Size attribute 'M' is hidden not visible to the customers. Leaving only Size 'L'
    3. Item size 'L' is sold out, All size attribute are hidden not visible to the customers. Leaving only 'OUT OF STOCK' for the product showing default Zencart 'OUT-OF-STOCK' ICON..

    Of course above is only an example. In reality it applies to which ever size in what ever order happens (sold).

    Love to be able to do that and looking forward to some solutions.
    There are several ways to do what you are asking, you will need to try each to see which one you prefer.


    The first is simply to edit the language file and change ' Out of Stock: ' to ''
    includes\languages\english\extra_definitions\products_with_attributes.php


    Another option is as easy, change the settings in the Configuration/Stock page.
    Set the "Check stock Level" to false
    and
    set the Allow checkout to false.
    Backup Files and Databases First. GitHub
    Suggestions, Plugins, etc. used at your own risk.

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

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Nice to see this update done:
    Stock by Attributes - Version: 1.5.2 This update Ports (merged) the functionality from:
    http://www.zen-cart.com/downloads.php?do=file&id=1355
    stock_by_attributes_1.4.13_with_my_stock_id_MOD version 1.0.2 by rhuseby.
    Combining this functionality into the "main" (original) version of SBA means that there is one less variant out there to add to the confusion that is SBA.. Well done! Maybe I'll give this version of SBA another looksee.. Seems like there's been some good movement..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  6. #1746

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Hi!

    Just installed this and it seems to be working in most cases. The problem I'm having is on an item with 2 attributes. When I set one of the items to 0 (out of stock), as a customer I don't see that item as out of stock until I add it to my cart, but the problem is when I add the same item with a different attribute and it ALSO show as out of stock when it really is not.

    Click image for larger version. 

Name:	SBA.jpg 
Views:	103 
Size:	13.3 KB 
ID:	13326

    First one has no stock, when added to cart it informs me such... ok
    Second one has 11 items in stock, when added to cart, it says the same thing as the first item... not ok

    Click image for larger version. 

Name:	SBA2.PNG 
Views:	100 
Size:	25.1 KB 
ID:	13327

    I have a different product that has only one attribute and it's working as expected and showing 'out of stock' on the product page.

    Thanks,
    Leslie
    I was floating in a peaceful sea...rescued by a sinking ship.

  7. #1747
    Join Date
    Nov 2013
    Posts
    24
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Good afternoon,
    The search function doesn't really help me find the answer and this is a very long thread to read through start-to-finish, so I thought I'd just ask:

    I have a custom template, and I have added the plugin to my install. The administration works fine and I can add attribute stock fine, but in the product area it only displays the overall quantity not the breakdown of in stock items. Do I need to change something to do so? I did upload the template files included in the plugin to the template directory.

    Cheers,
    Peter M Dodge

  8. #1748
    Join Date
    Sep 2013
    Location
    United Kingdom
    Posts
    11
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Hi,

    Just installed this on zen cart 1.5.1 and it works a treat, but I have a small issue. We used to be able to into an order and add products to the order and resend the invoice for payment. This module seems to have removed this facility from the order.php page. Can this be put back in?

    Also, not sure is this applies to this thread, but is there any way that the (+£2.00) can disappear from the attribute on the product page and just show the full price when you choose the attribute?

    Cheers, Phil.

  9. #1749
    Join Date
    Sep 2013
    Location
    United Kingdom
    Posts
    11
    Plugin Contributions
    0

    Default Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+

    Hello,

    Also when setting these attributes I get mysterious text appearing as below. How do I get rid of this please?

    Click image for larger version. 

Name:	zensnip.JPG 
Views:	103 
Size:	12.8 KB 
ID:	13328

  10. #1750
    Join Date
    Jun 2012
    Location
    Florida
    Posts
    123
    Plugin Contributions
    5

    Default Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

    Quote Originally Posted by lunabug View Post
    Hi!

    Just installed this and it seems to be working in most cases. The problem I'm having is on an item with 2 attributes. When I set one of the items to 0 (out of stock), as a customer I don't see that item as out of stock until I add it to my cart, but the problem is when I add the same item with a different attribute and it ALSO show as out of stock when it really is not.

    Click image for larger version. 

Name:	SBA.jpg 
Views:	103 
Size:	13.3 KB 
ID:	13326
    The "Multiple" attribute combination (two or more attributes in the same row), is not yet functional in this version, this is noted in the instructions on the Notes page. you can have these all listed in separate rows and it will work.

    I have been told there is a work-around if you must have multiple attributes in the same row, but stock checks will not be accurate, have a look at post:
    http://www.zen-cart.com/showthread.p...03#post1222803
    This shows an optional way to configure the multiple attributes per row, but remember it will be buggy when using this configuration.

    The best setup in this version is to configured as shown in the instructions, then the mod works as expected.
    Backup Files and Databases First. GitHub
    Suggestions, Plugins, etc. used at your own risk.

 

 

Similar Threads

  1. Problems with addon: Dynamic Drop Downs for Stock By Attribute
    By Dunk in forum All Other Contributions/Addons
    Replies: 56
    Last Post: 30 Apr 2014, 07:55 PM
  2. MySQL Problem with Product with Attribute Stock addon
    By rtwingfield in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Sep 2011, 03:35 PM
  3. Hide Zero Quantity Attributes with attribute-stock addon
    By leevil123 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Feb 2010, 05:06 PM
  4. Replies: 4
    Last Post: 22 Jan 2010, 10:43 PM
  5. Price Products in the grid by 'Stock by Attribute' addon?
    By Salixia in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Oct 2009, 06:03 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