Zen Cart Logo
Forums / All Other Contributions/Addons / Stocks by attributes

Stocks by attributes

Locked

Views: 251,278

Results 761 to 780 of 1,126
This thread is locked. New replies are disabled.
11 Sep 2009, 5:54 PM
#761
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Stocks by attributes

exeter_acres:

Do you have a link to the Kuroi version? I cannot locate it.It's in the downloads section where you found 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.

16 Sep 2009, 4:46 PM
#762
mkonchalski avatar

mkonchalski

New Zenner

Join Date:
Dec 2008
Posts:
18
Plugin Contributions:
0

Re: Stocks by attributes

Can someone help me with this problem.

I am using Stock By Attributes MultiAdd but I'm running into a simple problem. I read the entire forum and can't find anything on it...

I need to set my stock quantity to Zero. I can do it by manually manipulating the database, but can't seem to get it to work from the Admin panel. Everytime I try I get a MySQL error that looks like this...

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' attribute_sku=0 where stock_id=68 limit 1' at line 1
in:
[update products_with_attributes_stock set quantity=, attribute_sku=0 where stock_id=68 limit 1]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I added the Attribute_sku. I've tried everything and can't get it to work. It just keeps the Quanit=, and places no value there. If I put in -0 it works though...I don't get it.... Please HELP!

26 Sep 2009, 9:42 PM
#764
magolines avatar

magolines

New Zenner

Join Date:
Jun 2008
Posts:
22
Plugin Contributions:
0

Re: Stocks by attributes

I have added the "Stock by Attribute" add-on and I was able to add my items. I added 82 items with 11 different categories.

My problem is, when I try and order the things it will let me order more of one atribute than I have, unless I order 83 of them. It is only looking at the prduct inventory to decide if it is out of stock, instead of the stock by attribute.

Does anyone know a fix for this?

Thanks,

Miriam

28 Sep 2009, 2:55 AM
#765
julxz avatar

julxz

New Zenner

Join Date:
Sep 2009
Posts:
1
Plugin Contributions:
0

Re: Stocks by attributes

Im using Stocks by attributes.. thank you for the contributor...

I have a problem with the inventory of each attributes.
Once someone ordered a particular product(Ex: Product A : Size: 8/27" Inseam), after the payment, it doesn't update the product attributes stock.

So if Size: 8/27" Inseam has 5 in stock, after the purchased have been done the remaining stock should be 4... But the add on doesnt deduct the stock, the remaining stock is still 5. What I am doing right now is updating it manually if someone purchase a particular item.

Hope someone could help me with this problem...

28 Sep 2009, 8:04 AM
#766
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

@magoline and @julxz

There are two main possibilities:

if you've installed the AJAX version then you won't have all the files needed - there's lots more about this earlier in the thread (the key missing file is includes/classes/order.php

if you've installed the MultiAdd version, or my version, but not managed to do it properly, i.e. the revised includes/classes/order.php file (yes that one again) hasn't replaced the default Zen Cart one then the mod won't work, and in the way you've described.

See too post #763. A touch embarrassing, but 100% accurate.

28 Sep 2009, 1:15 PM
#767
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stocks by attributes

deleted -- nevermind -- I think I get it now:laugh::laugh:

29 Sep 2009, 2:03 AM
#768
pineappleclock avatar

pineappleclock

New Zenner

Join Date:
Sep 2009
Posts:
1
Plugin Contributions:
0

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

die('Illegal Access');
}

add the following:

//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('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>' . "\n";
    }
    $field .= '</select>' . "\n";
    if ($required == true) $field .= TEXT_FIELD_REQUIRED;
    return $field;
  }
//END PWA EDIT

after

if ($pr_attr->fields['total'] > 0) {

add the following:

//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:

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

replace with:

//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

$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:

//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
29 Sep 2009, 2:32 AM
#769
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

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

30 Sep 2009, 9:40 PM
#770
richardh avatar

richardh

New Zenner

Join Date:
Jul 2008
Location:
Whitley Bay, England
Posts:
29
Plugin Contributions:
0

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

1 Oct 2009, 2:33 PM
#771
tayste_2000 avatar

tayste_2000

New Zenner

Join Date:
Oct 2009
Posts:
4
Plugin Contributions:
0

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

1 Oct 2009, 5:14 PM
#772
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

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.7I 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!:smile:

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

Tayste_2000:

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

2 Oct 2009, 1:38 AM
#773
tagyourbaby avatar

tagyourbaby

New Zenner

Join Date:
Feb 2008
Location:
Auckland, NZ
Posts:
53
Plugin Contributions:
0

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?

2 Oct 2009, 9:04 AM
#774
tayste_2000 avatar

tayste_2000

New Zenner

Join Date:
Oct 2009
Posts:
4
Plugin Contributions:
0

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 :D 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.php?main_page=product_info&cPath=1&products_id=13

Cheers

DivaVocals:

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. >

  1. Kuroi's version 4.7
  1. MultiAdd version 4.7
  1. 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!:smile:

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

2 Oct 2009, 9:12 AM
#775
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

Tagyourbaby:

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 ....

2 Oct 2009, 9:25 AM
#776
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

Tayste_2000:

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 :D 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.php?main_page=product_info&cPath=1&products_id=13

CheersI 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.

2 Oct 2009, 9:30 AM
#777
tayste_2000 avatar

tayste_2000

New Zenner

Join Date:
Oct 2009
Posts:
4
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

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.

Wouldn't surprise me :D I'll delete my attribute and start adding it again.

Thanks

2 Oct 2009, 9:34 AM
#778
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stocks by attributes

Tayste_2000:

Wouldn't surprise me :D I'll delete my attribute and start adding it again.Before you rush out to do that, since the attribute did appear to be there, I'd check that you have the option values correctly hooked up the option that you are using for your attribute.

2 Oct 2009, 10:42 AM
#779
tayste_2000 avatar

tayste_2000

New Zenner

Join Date:
Oct 2009
Posts:
4
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

Before you rush out to do that, since the attribute did appear to be there, I'd check that you have the option values correctly hooked up the option that you are using for your attribute.

I think I have maybe I'm not doing it quite right?

2 Oct 2009, 12:49 PM
#780
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Stocks by attributes

kuroi:

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 ....I can confirm.. Just had a training session with a client last night to show her how to use SBA.. Doesn't work with text attributes.. As I explained to my client, this is mean to work with products with tangible attributes such as size, color, etc..