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

Stocks by attributes

Locked

Views: 251,278

Results 801 to 820 of 1,126
This thread is locked. New replies are disabled.
9 Oct 2009, 4:49 PM
#801
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Stocks by attributes

I'm nearly fully up and running now. just a few niggles I need sorting..

  1. When I have my stock settings to disable product when out of stock, they still show??? is there a fix for this? I did notice that the drop down attributes behave correctly and switch off if the attribute is out of stock, but if all attributes are out of stock and the overall product_id is out of stock, it still shows...

  2. I want my products to go out of stock when stock level reaches 30... I found a post saying you only had to change one setting for this, but when I do only what was described below, the product shows out of stock, my attributes stay showing too...

Can anyone advise on any of this??

Cheers.

Phil

9 Oct 2009, 5:06 PM
#802
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Stocks by attributes

forgot to add the suggested change needed:

i figured it out it was really simple actually
this is the only file you have to edit:
/home/rickie/public_html/includes/functions/functions_general.php
Line #1146 : case ($button_check->fields['products_quantity'] <= 5 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1')

It originally said case ($button_check->fields['products_quantity'] <= 0 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1')

I just changed it to "<=5" and then i showed a sold out button when the product quantity is <=5

9 Oct 2009, 5:23 PM
#803
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Stocks by attributes

philip937:

I'm nearly fully up and running now. just a few niggles I need sorting..

  1. When I have my stock settings to disable product when out of stock, they still show??? is there a fix for this? I did notice that the drop down attributes behave correctly and switch off if the attribute is out of stock, but if all attributes are out of stock and the overall product_id is out of stock, it still shows...

  2. I want my products to go out of stock when stock level reaches 30... I found a post saying you only had to change one setting for this, but when I do only what was described below, the product shows out of stock, my attributes stay showing too...

Can anyone advise on any of this??

Cheers.

Phil

thinking about it, if the first probelm is solved the second one will be as if they product disappears then the attributes wouldnt be seen... Hope someone knows a fix for this.

9 Oct 2009, 6:16 PM
#804
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Stocks by attributes

No I was wrong,

I have just noticed that I have the following stock:

Small = 4

Medium = 0

Large = 40

I have done what I mentioned above and set:
Line #1146 : case ($button_check->fields['products_quantity'] <= 30 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1')

But this has still just allowed someone to check out when the Small was set to 4!!

Please someone point me in the right direction.. if the attributes disappear when they hit 0, there must be somewhere I can change this value to 30....

10 Oct 2009, 3:11 AM
#805
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

You should read through this whole thread.. It will give you a better feel for this mod.. Also you should give a read through the other support thread for this mod. (Stock by Attribute v4.0 for Zen Cart 1.3.5+)

So if you have an attribute called size and had stock as follows:
S = 5
M = 12
L = 0

If I understand your posts correctly, you are asking if this mod will "hide" attributes when the amount of stock for that variant = "0". (In this example this would be size "L") The answer is NO.. if a customer adds a variant that is out of stock to the cart, he will not be notified until he adds the out of stock variant to the cart.

Now there is another mod that has been written specifically to work with Stock by Attributes (the Kuroi version not the "others":laugh:) It is the Product Attributes Grid add-on. This add will allow you to visually see which variants are out of stock.

You can see this in action in this example:
http://clients.overthehillweb.com/hairisle/Stock-Lace-Wigs/Chinese-Remy-Brazilian-Curl-Full-Lace-Perimeter-Medium

Link to the Product Attributes Grid is here
Support thread for Product Attributes Grid is here

philip937:

No I was wrong,

I have just noticed that I have the following stock:

Small = 4

Medium = 0

Large = 40

I have done what I mentioned above and set:
Line #1146 : case ($button_check->fields['products_quantity'] <= 30 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1')

But this has still just allowed someone to check out when the Small was set to 4!!

Please someone point me in the right direction.. if the attributes disappear when they hit 0, there must be somewhere I can change this value to 30....

10 Oct 2009, 7:19 AM
#806
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Stocks by attributes

DivaVocals:

You should read through this whole thread.. It will give you a better feel for this mod.. Also you should give a read through the other support thread for this mod. (Stock by Attribute v4.0 for Zen Cart 1.3.5+)

So if you have an attribute called size and had stock as follows:
S = 5
M = 12
L = 0

Diva,

I'm confused. You say the answer is NO to hiding attributes? Mine does hide the attributes when stock is 0. What I was asking is how to change this from 0 to 30.
For the attributes to hide at stock 0 they must be being told to do this somewhere?
If I understand your posts correctly, you are asking if this mod will "hide" attributes when the amount of stock for that variant = "0". (In this example this would be size "L") The answer is NO.. if a customer adds a variant that is out of stock to the cart, he will not be notified until he adds the out of stock variant to the cart.

Now there is another mod that has been written specifically to work with Stock by Attributes (the Kuroi version not the "others":laugh:) It is the Product Attributes Grid add-on. This add will allow you to visually see which variants are out of stock.

You can see this in action in this example:
http://clients.overthehillweb.com/hairisle/Stock-Lace-Wigs/Chinese-Remy-Brazilian-Curl-Full-Lace-Perimeter-Medium

Link to the Product Attributes Grid is here
Support thread for Product Attributes Grid is here
Posted via Mobile Device

10 Oct 2009, 8:08 AM
#807
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Stocks by attributes

philip937:

Posted via Mobile Device

I have just tested again to make sure I wasn't being stupid..

My attributes most definitely DO disappear when the stock of the particular attribute hits zero.

So for example I have:

S = 4
M= 0
L = 10

When I look at the product info page and select the drop down, I currently get:
Please Select
Small
Large

It has hidden the Medium..

Now just to test there was no glitch, I then wen and changed the value of Small to = 0. the drop down now shows:
Please Select
Large

So it works perfectly how I want it to, but I merely want to change the threshold of these attributes dissapearing from zero to 30..

I hope someone can help :blink:

Phil

10 Oct 2009, 8:58 AM
#808
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Stocks by attributes

philip937:

I have just tested again to make sure I wasn't being stupid..

My attributes most definitely DO disappear when the stock of the particular attribute hits zero.

So for example I have:

S = 4
M= 0
L = 10

When I look at the product info page and select the drop down, I currently get:
Please Select
Small
Large

It has hidden the Medium..

Now just to test there was no glitch, I then wen and changed the value of Small to = 0. the drop down now shows:
Please Select
Large

So it works perfectly how I want it to, but I merely want to change the threshold of these attributes dissapearing from zero to 30..

I hope someone can help :blink:

Phil

My bad, found the solution.

I had already been over this before.. Just forgot!

To make your attributes turn off when stock for attribute hits zero, you have to do this:
http://www.zen-cart.com/forum/showthread.php?t=34977&page=65
I had already done this!! Durrr im so stupid..

so quite clearly where the replaced code says to put:
(pwas.quantity > 0 or pwas.quantity IS NULL)

Ive changed mine to say
(pwas.quantity > 30 or pwas.quantity IS NULL)

sorted.

10 Oct 2009, 3:48 PM
#809
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

philip937:

Diva,

I'm confused. You say the answer is NO to hiding attributes? Mine does hide the attributes when stock is 0. What I was asking is how to change this from 0 to 30.
For the attributes to hide at stock 0 they must be being told to do this somewhere?Out the box this behavior isn't there.. Looks like you must've modified it to do this..

ETA: okay.. looks like that's what you confirmed you did..:laugh: I knew I wasn't crazy either!:laugh:

And so this is clear for anyone reading this, you never said which version of SBA you are using.. It makes a HUGE difference if you are pointing people to solutions.. The link you posted looks like this refers to the MultiAdd version.. I haven't looked at the code in the Kuroi version, but if here are differences, a solution meant to work with one version may not apply to other versions of this mod..

Another thing I wanted to point out that this solution only appears to work for SINGLE attribute variants. It doesn't appear to be a solution for variants with multiple attributes (Small shirt versus Small, Blue shirt)

philip937:

My bad, found the solution.

I had already been over this before.. Just forgot!

To make your attributes turn off when stock for attribute hits zero, you have to do this:
http://www.zen-cart.com/forum/showthread.php?t=34977&page=65
I had already done this!! Durrr im so stupid..

so quite clearly where the replaced code says to put:
(pwas.quantity > 0 or pwas.quantity IS NULL)

Ive changed mine to say
(pwas.quantity > 30 or pwas.quantity IS NULL)

sorted.

10 Oct 2009, 6:26 PM
#810
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Stocks by attributes

DivaVocals:

Out the box this behavior isn't there.. Looks like you must've modified it to do this..

ETA: okay.. looks like that's what you confirmed you did..:laugh: I knew I wasn't crazy either!:laugh:

And so this is clear for anyone reading this, you never said which version of SBA you are using.. It makes a HUGE difference if you are pointing people to solutions.. The link you posted looks like this refers to the MultiAdd version.. I haven't looked at the code in the Kuroi version, but if here are differences, a solution meant to work with one version may not apply to other versions of this mod..

Another thing I wanted to point out that this solution only appears to work for SINGLE attribute variants. It doesn't appear to be a solution for variants with multiple attributes (Small shirt versus Small, Blue shirt)

Hey,

Sorry, yes for clarification, I have only tested this on my scenario, i.e 1 set of attributes.

I am using Kuroi's 4.7 version.

So where as it works perfectly for what I need, be warned it may not work for everyones requirements.

:smartalec:

10 Oct 2009, 6:37 PM
#811
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

philip937:

Hey,

Sorry, yes for clarification, I have only tested this on my scenario, i.e 1 set of attributes.

I am using Kuroi's 4.7 version.The original is still the best!!! :yes:

The admin stylesheet from the MultiAdd version is the only improvement I would suggest.. The MultiAdd admin stylesheet really visually helps distinguish the parent product from the variants..:yes:

10 Oct 2009, 7:09 PM
#812
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: Stocks by attributes

DivaVocals:

The original is still the best!!! :yes:

The admin stylesheet from the MultiAdd version is the only improvement I would suggest.. The MultiAdd admin stylesheet really visually helps distinguish the parent product from the variants..:yes:

oh really, cool I shall give that one a try and see what it looks like :D

14 Oct 2009, 5:39 PM
#813
exeter_acres avatar

exeter_acres

New Zenner

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

Re: Stocks by attributes

Help!!!!!!

Latest update
version 4.7 stocks by attrribute....

if I add anything to the shopping cart I get:

1146 Table 'XXdatabasenamexx.TABLE_EF_PRODUCTS_WITH_ATTRIBUTES_STOCK' doesn't exist

but the table does exist...

Now what?!?!?!?!?!?!

14 Oct 2009, 6:11 PM
#814
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

Sounds like you didn't run the SQL file which creates the SBA tables..> exeter_acres:

Help!!!!!!

Latest update
version 4.7 stocks by attrribute....

if I add anything to the shopping cart I get:

1146 Table 'XXdatabasenamexx.TABLE_EF_PRODUCTS_WITH_ATTRIBUTES_STOCK' doesn't exist

but the table does exist...

Now what?!?!?!?!?!?!

14 Oct 2009, 6:40 PM
#815
exeter_acres avatar

exeter_acres

New Zenner

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

Re: Stocks by attributes

Yep...sure did...

first thing

16 Oct 2009, 3:51 PM
#816
exeter_acres avatar

exeter_acres

New Zenner

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

Re: Stocks by attributes

Restored a backup,
re-did the whole upgrade....

store working,
but a bit hesitant to run this mod again...

16 Oct 2009, 4:52 PM
#817
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

exeter_acres:

Restored a backup,
re-did the whole upgrade....

store working,
but a bit hesitant to run this mod again...No reason to be.. Dunno what happened the first time around, but this mod should be a very simple one to install.. IF you install the Kuroi version.. I'd do a backup of site and DB, and install again.. No reason to be hesitant if you can roll back..

19 Oct 2009, 12:23 AM
#818
shahram avatar

shahram

Zen Follower

Join Date:
Jul 2009
Location:
New York
Posts:
122
Plugin Contributions:
1

Re: Stocks by attributes

How i can make my products option values remove by its self after someone order on website i'm using ( Stock by Attributes ) i want to know how could i make it so on my website the quantity of item could get remove aromatic like if i have 1 of a size 9 sneaker and someone buys it there should by zero remaing could someone tell me how could i do this plz

19 Oct 2009, 12:37 AM
#819
shahram avatar

shahram

Zen Follower

Join Date:
Jul 2009
Location:
New York
Posts:
122
Plugin Contributions:
1

Re: Stocks by attributes

limelites:

Ahaaaaaaa, figured this one out guys!!

For anyone else having a problem with this issue, just look at re-installing the files that shipped with the stock_by_attributes mod.

I've just cured my problems by overwriting /includes/classes/order.php with the order.php from "stock_by_attributes_4-7MULTIADD mod"

Somehow some other mod had corrupted the data that updates the "Quantity in Stock" in ADMIN>CATALOG>PRODUCTS WITH ATTRIBUTES".

It is now updating the Quantity in Stock Column with each sale. All working perfectly now.

Additionally, if you want the attribute in the drop down menu to automatically disable when the attribute quantity = zero, then you have to open /includes/modules/attributes.php and replace this:

$sql = "select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;

> with this:
> ```php
$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;

thanx for tryin to help but i try doin this and all the quantity get delete could you explain how to do this or if maybe i did something wrong thanx

25 Oct 2009, 1:26 PM
#820
springboard_seo avatar

springboard_seo

New Zenner

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

Re: Stocks by attributes

I tried the following on a client's site, and it fixed the problem right away. Out-of-stock attribute values are no longer displayed in my attributes dropdowns. Thank you very much krazykev.

krazykev:

Hi Kellan,

I did something very similar but didn't check for null/0 so didn't have to make your second change above.

select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
on pa.options_values_id = pov.products_options_values_id
join 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 pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "'
and PWAS.quantity > 0 " .
$order_by;

This is in attributes.php

I had first tried Kellan's fix (directly below) without success:

limelites:

Ahaaaaaaa, figured this one out guys!!

For anyone else having a problem with this issue, just look at re-installing the files that shipped with the stock_by_attributes mod.

I've just cured my problems by overwriting /includes/classes/order.php with the order.php from "stock_by_attributes_4-7MULTIADD mod"

Somehow some other mod had corrupted the data that updates the "Quantity in Stock" in ADMIN>CATALOG>PRODUCTS WITH ATTRIBUTES".

It is now updating the Quantity in Stock Column with each sale. All working perfectly now.

Additionally, if you want the attribute in the drop down menu to automatically disable when the attribute quantity = zero, then you have to open /includes/modules/attributes.php and replace this:

$sql = "select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;

> with this:
> ```php
$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;

I strikes me as odd that the Stocks by attributes mod would be missing this functionality.