Page 78 of 113 FirstFirst ... 2868767778798088 ... LastLast
Results 771 to 780 of 1125
  1. #771
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Stocks by attributes

    **deleted -- nevermind -- I think I get it now**
    Last edited by DivaVocals; 28 Sep 2009 at 02:20 PM. Reason: asked a question then figured out the answer.. LOL

  2. #772
    Join Date
    Sep 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    From the WIKI:
    How can I show the amount of stock available next to each attribute on the product information page?
    This wiki page points to posts that are not publicly viewable. I have one attribute in a dropdown for a product and here is how I did it, hopefully this saves someone a little bit of time.

    zen cart version = 1.3.8a

    in includes\modules\attributes.php

    after
    Code:
    die('Illegal Access');
    }
    add the following:

    Code:
    //START PWA EDIT
      function zen_draw_pull_down_menu_disableable($name, $values, $default = '', $parameters = '', $required = false) {
        $field = '<select name="' . zen_output_string($name) . '"';
        if (zen_not_null($parameters)) $field .= ' ' . $parameters;
        $field .= '>' . "\n";
        if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);
        for ($i=0, $n=sizeof($values); $i<$n; $i++) {
          $field .= '  <option value="' . zen_output_string($values[$i]['id']) . '"';
          if ($default == $values[$i]['id']) {
            $field .= ' selected="selected"';
          }
          if ($values[$i]['disabled'] == true) $field .= ' disabled="disabled"';
          $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => ''', '<' => '&lt;', '>' => '&gt;')) . '</option>' . "\n";
        }
        $field .= '</select>' . "\n";
        if ($required == true) $field .= TEXT_FIELD_REQUIRED;
        return $field;
      }
    //END PWA EDIT

    after
    Code:
    if ($pr_attr->fields['total'] > 0) {
    add the following:

    Code:
    //START PWA EDIT
    $PWALookup = array();  
    $PWAQ = $db->Execute("
    select 
      products_with_attributes_stock.quantity as q, 
      products_attributes.options_values_id as id
      from products_with_attributes_stock
      left join products_attributes on products_with_attributes_stock.stock_attributes = products_attributes.products_attributes_id
      where products_with_attributes_stock.products_id='".(int)$_GET['products_id']."'
    ");
    if ($PWAQ->RecordCount() > 0) {
    do {
      $PWALookup[$PWAQ->fields['id']] = $PWAQ->fields['q'];
      $PWAQ->MoveNext();
    } while (!$PWAQ->EOF);
    }
    //END PWA EDIT
    find the following:

    Code:
    $products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
                      'text' => $products_options->fields['products_options_values_name']);
    replace with:

    Code:
    //START PWA EDIT
    $PWAkey = $products_options->fields['products_options_values_id'];
    $PWAAppend = "";
    $PWADisabled = false;
    if (array_key_exists($PWAkey ,$PWALookup)) {
        if ($PWALookup[$PWAkey] == 0) {
            //out of stock message
            $PWAAppend = " (Out of stock)";
            $PWADisabled = true;
        } else {
            //your IN STOCK message goes here
            $PWAAppend = " (".$PWALookup[$PWAkey]." in stock)";
        }
    }
    $products_options_array[] = array('id' => $products_options->fields['products_options_values_id'].$PWAHack,
    'text' => $products_options->fields['products_options_values_name'].$PWAAppend,'disabled'=>$PWADisabled);
    //END PWA EDIT
    find the following code

    Code:
    $options_menu[] = zen_draw_pull_down_menu('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_array, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '"') . "\n";
    replace with:

    Code:
    //START PWA EDIT
    $options_menu[] = zen_draw_pull_down_menu_disableable('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_array, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '"') . "\n";
    //END PWA EDIT

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

    Default Re: Stocks by attributes

    This appears to be geared towards showing stock for products with only one attribute.. I don't see how this works if you have product attribute variants.. Am I missing something??? Is this found on the Zen Cart Wiki??

    **goes off to look @ Zen Wiki**

  4. #774
    Join Date
    Jul 2008
    Location
    Whitley Bay, England
    Posts
    28
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Hi

    I'm using 1.3.8a and stock_by_attributes_4-7ajax
    other addons include, image handler, google checkout and a cherry_zen template.

    I think I installed the module correctly and it seems to work. I select a product variant in the products with attribute tab, add stock and sync. On checking the parent product stock level all is well it shows the added stock quantity of all the variants.

    On testing the checkout end, when I select an attribute, e.g. tie colour, and then add to basket, it and all other varients show as no stock.

    any ideas as to what I have done wrong????

    thanks

    Richard

  5. #775
    Join Date
    Oct 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    I'm using the newest version of Zencart and the newest version of this mod, I've also got the Multiadd and I think I've added all the right files.

    Problem I'm having is, I've got the stock attributes with stock levels and those are working fine, but in the shop the attributes box is empty, so it's not displaying s,m,l,xl,xxl etc I'm sure it's something simple but I've been through this thread and can't find something specifically relating to my issue.

    Any help would be great.

    Thanks

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

    Default Re: Stocks by attributes

    To quote a line I heard in a movie once.. "Drop that zero and get yourself a hero"

    Let me repeat again, what I have said in this thread (just one page up..)




    Of the three flavors of this mod:
    1. Kuroi's version 4.7
    2. MultiAdd version 4.7
    3. Ajax version 4.7
    I could never get the last two to work.. and since the contributors of both of these versions (MultiAdd or Ajax) have NOT ONCE supported their version of this mod, I do not use them.

    My research of the support threads for SBA (there are two pretty active ones) shows that the MultiAdd and Ajax versions are the ones with MULTIPLE problems. Most of the functional PROBLEMS people have with this mod all come from either the MultiAdd or the Ajax versions of Stock By Attributes.

    The ORIGINAL is still the best IMO.. So I use ONLY the version 4.7 of SBA that Kuroi wrote. Why deal with problematic mods which bring VERY little beneficial features to the table??) Kuroi is the ONLY mod author still actively answering questions in these support threads, so for my money this is the ONLY version of Stock By Attributes that I will use. (where are the authors of the troubled Multiadd and Ajax versions of this mod???) However I do like and use the stylesheets from the MultiAdd version because it visually makes a nice seperation between the parent product and the variants. However, THAT'S ALL that I used from that version!

    That said if you used Kuroi's version, it's a VERY straight forward install and should work right away.. No hacks or "adjustments" to this mod needed AT ALL! It just works as described..

    Kuroi's version of Stocks By Attributes is in the downloads section where you found the (IMO) half/non working MultiAdd and Ajax versions of this mod. The downloads preserves previous versions of add ons below the most current submissions. So if you scroll down and you will see version 4.7 (WITHOUT MultiAdd or Ajax after the version number) and a download link for that version.

    ETA
    Let me just add the link -- some folks have a hard time "finding" previous versions in the add-on section: http://www.zen-cart.com/index.php?main_page=download_contrib&contrib_id=310&update_id=9

    Quote Originally Posted by Tayste_2000 View Post
    I'm using the newest version of Zencart and the newest version of this mod, I've also got the Multiadd and I think I've added all the right files.

    Problem I'm having is, I've got the stock attributes with stock levels and those are working fine, but in the shop the attributes box is empty, so it's not displaying s,m,l,xl,xxl etc I'm sure it's something simple but I've been through this thread and can't find something specifically relating to my issue.

    Any help would be great.

    Thanks
    Last edited by DivaVocals; 1 Oct 2009 at 06:20 PM.

  7. #777
    Join Date
    Feb 2008
    Location
    Auckland, NZ
    Posts
    53
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    Does this work with text as i installed it and it doesnt appear to be working just comes up showing it as a drop down. Do i need to do anything to change it so i can use text?

  8. #778
    Join Date
    Oct 2009
    Posts
    4
    Plugin Contributions
    0

    Default Re: Stocks by attributes

    OK Thanks I've installed Kuroi's version but I still have the same problem, but I wasn't able to install his sql file as it said duplicate already there and like a total noob I can't figure out how to delete tables in MySQL all I can do is drop the table.

    So if anyone can instruct me on how to remove this mod completely and then do a fresh install (more so in the database) as I think overwriting all the files will mean I'm completely on Kuroi's version now.

    Here is a link to my one and only product you can see whats wrong with the attribute, maybe it's not this mod but any help would be greatly appreciated

    http://www.irbsandc.com/cart/index.p...products_id=13

    Cheers

    Quote Originally Posted by DivaVocals View Post
    To quote a line I heard in a movie once.. "Drop that zero and get yourself a hero"

    Let me repeat again, what I have said in this thread (just one page up..)




    Of the three flavors of this mod:
    1. Kuroi's version 4.7
    2. MultiAdd version 4.7
    3. Ajax version 4.7
    I could never get the last two to work.. and since the contributors of both of these versions (MultiAdd or Ajax) have NOT ONCE supported their version of this mod, I do not use them.

    My research of the support threads for SBA (there are two pretty active ones) shows that the MultiAdd and Ajax versions are the ones with MULTIPLE problems. Most of the functional PROBLEMS people have with this mod all come from either the MultiAdd or the Ajax versions of Stock By Attributes.

    The ORIGINAL is still the best IMO.. So I use ONLY the version 4.7 of SBA that Kuroi wrote. Why deal with problematic mods which bring VERY little beneficial features to the table??) Kuroi is the ONLY mod author still actively answering questions in these support threads, so for my money this is the ONLY version of Stock By Attributes that I will use. (where are the authors of the troubled Multiadd and Ajax versions of this mod???) However I do like and use the stylesheets from the MultiAdd version because it visually makes a nice seperation between the parent product and the variants. However, THAT'S ALL that I used from that version!

    That said if you used Kuroi's version, it's a VERY straight forward install and should work right away.. No hacks or "adjustments" to this mod needed AT ALL! It just works as described..

    Kuroi's version of Stocks By Attributes is in the downloads section where you found the (IMO) half/non working MultiAdd and Ajax versions of this mod. The downloads preserves previous versions of add ons below the most current submissions. So if you scroll down and you will see version 4.7 (WITHOUT MultiAdd or Ajax after the version number) and a download link for that version.

    ETA
    Let me just add the link -- some folks have a hard time "finding" previous versions in the add-on section: http://www.zen-cart.com/index.php?main_page=download_contrib&contrib_id=310&update_id=9

  9. #779
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stocks by attributes

    Quote Originally Posted by Tagyourbaby View Post
    Does this work with text as i installed it and it doesnt appear to be working just comes up showing it as a drop down. Do i need to do anything to change it so i can use text?
    It's been a long time since I've looked at this, but I suspect that it doesn't work with with text attributes, but maybe somebody who's used it more recently than me can chip in here ....
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #780
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Stocks by attributes

    Quote Originally Posted by Tayste_2000 View Post
    OK Thanks I've installed Kuroi's version but I still have the same problem, but I wasn't able to install his sql file as it said duplicate already there and like a total noob I can't figure out how to delete tables in MySQL all I can do is drop the table.

    So if anyone can instruct me on how to remove this mod completely and then do a fresh install (more so in the database) as I think overwriting all the files will mean I'm completely on Kuroi's version now.

    Here is a link to my one and only product you can see whats wrong with the attribute, maybe it's not this mod but any help would be greatly appreciated

    http://www.irbsandc.com/cart/index.p...products_id=13

    Cheers
    I haven't checked explicitly, but I'd be surprised if the other variants of the mod were using a different table structure, so you shouldn't need to re-install the SQL. If you did need to drop database tables you would use a tool such as phpMyAdmin.

    I fear that you may be looking for the problem with your attribute display in the wrong place. My version of stock by attributes doesn't go near that and nor does the multiadd version. I wondered if the AJAX version might have an impact (I haven't used it) but can't see anything on the page you gave that would do so.

    So I'm left wondering whether the problem is actually that there's something a little off in the way your option, the option values, or the product attribute have been set up.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 
Page 78 of 113 FirstFirst ... 2868767778798088 ... 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