Forums / All Other Contributions/Addons / Stocks by attributes

Stocks by attributes

Locked

Views: 251,699

Results 181 to 200 of 1,126
This thread is locked. New replies are disabled.
11 Oct 2006, 8:32 AM
#181
royalgemsnz avatar

royalgemsnz

New Zenner

Join Date:
Apr 2006
Posts:
74
Plugin Contributions:
0

Stocks by attributes

In answer to my previous question, here the remedy. Many thanks to my flatmate is is somewhate more php literate than I am.

Instead of changing

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

with

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

as per http://www.zen-cart.com/forum/showthread.php?t=25987&page=19 post 188, change it to this instead.

                  if ($products_options->fields['quantity'] >0){
                    $dropdown_instock = TEXT_ATTRIBUTES_IN_STOCK;
                  } else {
                    $dropdown_instock = TEXT_ATTRIBUTES_NOT_IN_STOCK;
                  }
                  
                  $products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
                                        'text' => $products_options->fields['products_options_values_name'] .' [' . $dropdown_instock . ' '. TEXT_ATTRIBUTES_PIECES . ']');
13 Oct 2006, 8:28 AM
#182
tajul_ashyqin avatar

tajul_ashyqin

Zen Follower

Join Date:
Apr 2006
Location:
Labuan Island
Posts:
362
Plugin Contributions:
1

Re: Stocks by attributes

hi,

i am having a major problem for these mod. i just do the admin activity reseting this morning and now i cannot set my stocks attributes like before!:cry: see my admin_attributes attachments! this is how it looks from the admin after i try to define the stocks for respective attributes! :cry: when i go to my cpanel to check the entries for the attributes, i am surprised as the entries for the just-new-added attributes (after the reseting session) in stock_attributes fields, only 'A' appears!!! :cry: see the second attachment!

i hope somebody have a fix to it...

4u info, i am using danielcor stocks by attributes mod!

"Whether you think you can, or you think you can't... YOU ARE RIGHT."
GOOD LUCK !!!

13 Oct 2006, 8:57 AM
#183
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

tajul_ashyqin:

i am having a major problem for these mod. i just do the admin activity reseting this morning and now i cannot set my stocks attributes like before!:cry: see my admin_attributes attachments! this is how it looks from the admin after i try to define the stocks for respective attributes! :cry: when i go to my cpanel to check the entries for the attributes, i am surprised as the entries for the just-new-added attributes (after the reseting session) in stock_attributes fields, only 'A' appears!!! :cry: see the second attachment!Well that's not the way it's supposed to work :no: Firstly to make sure I have understood correctly ... you reset the admin activity log and then entered new attribute stock values? The values entered before the reset are OK, those entered after have this stock_attribute value of "A"? Is this the first time that you have done an activity log reset with stock by attribute installed and in use?

The blank value on your screen is no surprise as the data that would normally be in the field where the As are appearing is obtained via an integer index into another table - obviously As can't do that. So the real issue is how did the As get there.

As an aside this is a direct result of the $*#~@! database structure that this mod has. If integer indexes weren't held as strings in the first place, this simply couldn't happen. Not Danielcor's fault either - like me, he has inherited a structure that goes right back (I suspect) to the original osCommerce mod which spawned this one. Happily Zen Cart does it better and this will be fixed in 1.4.

Hopefully somebody will come up with a solution to this today. But if not, I have time set aside tomorrow to investigate the problem in my later version of this mod reported by SupuS above and mikajlo on another thread, and I will also look at your problem to see if I might have carried it into my version or if it is already dealt with by one of my fixes and can be retrofitted.

Kuroi Web Design and Development | Twitter

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

13 Oct 2006, 10:41 PM
#184
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

SupuS:

I found a bug I think ..Supus, I have tried twice (several days apart) but not succeeded in replicating the bug that you describe in the way that you describe it. However, I can replicate it in a different way for which the fix is ...

In includes/classes/order.php find line 696> $attribute_search array();and immediately afterwards insert> $attribute_stock_left = STOCK_REORDER_LEVEL + 1; // kuroi: prevent false low stock triggersI believe that there is a high chance that this will fix your problem also. Please try it and let me know.

If it doesn't work for you, please provide more specific information about the products that you are buting, the attributes that they have (if any) and their attribute stock level. Thanks.

Kuroi Web Design and Development | Twitter

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

13 Oct 2006, 11:23 PM
#185
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

tajul_ashyqin:

hi,

i am having a major problem for these mod. i just do the admin activity reseting this morning and now i cannot set my stocks attributes like before!:cry: see my admin_attributes attachments! this is how it looks from the admin after i try to define the stocks for respective attributes! :cry: when i go to my cpanel to check the entries for the attributes, i am surprised as the entries for the just-new-added attributes (after the reseting session) in stock_attributes fields, only 'A' appears!!! :cry: see the second attachment!

i hope somebody have a fix to it...

4u info, i am using danielcor stocks by attributes mod!Tajul, Could you backup the following tables (ideally with phpMyAdmin) and email a copy to me at the email address using for Stocky by Attributes 1.3.5 beta testing?> products,
product attributes,
products_options,
products_options_types,
products_options_values,
product_options_values_to_products_options,
products_with_stock_attributes Thanks

Kuroi Web Design and Development | Twitter

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

14 Oct 2006, 12:04 AM
#186
tajul_ashyqin avatar

tajul_ashyqin

Zen Follower

Join Date:
Apr 2006
Location:
Labuan Island
Posts:
362
Plugin Contributions:
1

Re: Stocks by attributes

yup, that was had happened! it just happened after I reset the admin activity log and entered a new values! before this, I did reset the log but without stock by attributes installed and this was my first time having it after few months of my live site... thanx kuroi for helping me out! I;ll email what ever you need...

"Whether you think you can, or you think you can't... YOU ARE RIGHT."
GOOD LUCK !!!

15 Oct 2006, 7:47 PM
#187
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

tajul_ashyqin:

yup, that was had happened! it just happened after I reset the admin activity log and entered a new values! before this, I did reset the log but without stock by attributes installed and this was my first time having it after few months of my live site... thanx kuroi for helping me out! I;ll email what ever you need...OK. I've tracked down the bug and have a fix. It applies to both Danielcor's 3.0.1 version and my 4.1 version. A 4.2 version for Zen Cart 1.3.5 users has been submitted to the downloads area containing this, the resolution of Supus's issue a few posts back and some improvements to the alignment of data on the stock page.

If you're running an older version of Zen Cart and are therefore still using Danielcor's version, you will need to apply the first change by hand, but it's fairly straightforward.

All the changes take place in admin/products_with_attributes_stock.php. Make sure you have the right file (there are several with this name).

Find the following line (probably 149) and delete it> $s_mack_noconfirm .="attributes[]=" . $attribute_id . "&"; //s_mack:noconfirm
Find the following block (probably 155-163)> if(sizeof($attributes) > 1)

  	{
  		sort($attributes);
  		$stock_attributes = implode(',',$attributes);
  	}
  	else
  	{
  		$stock_attributes = $attributes[0];
  	}and immediately afterwards add> $s_mack_noconfirm .='attributes=' . $stock_attributes . '&'; //kuroi: to pass string not arrayFind the second instance of the block above (around about 202-210) and delete it.

Find the following line (now about 205) and delete the bit marked in red> $query = 'insert into '.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.' (products_id,stock_attributes,quantity) values ('.$products_id.',"'.$stock_attributes.'",'.$quantity.')';

Kuroi Web Design and Development | Twitter

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

15 Oct 2006, 9:17 PM
#188
rkharris avatar

rkharris

New Zenner

Join Date:
Mar 2006
Posts:
7
Plugin Contributions:
0

Re: Stocks by attributes

Help:::

I have installed the contribution on a 1.3.5. version and it works really good EXCEPT that the variant stock levels are not updated after an order i.e. remain the same when I purchase stock, the main product "Quantity" reduces correctly, and sync brings it back to the original level, Anyone know how to fix this or can anyone point me to the code that should do this so I can try. Thanks for any help.

15 Oct 2006, 9:31 PM
#189
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

rkharris:

Help:::

I have installed the contribution on a 1.3.5. version and it works really good EXCEPT that the variant stock levels are not updated after an order i.e. remain the same when I purchase stock, the main product "Quantity" reduces correctly, and sync brings it back to the original level, Anyone know how to fix this or can anyone point me to the code that should do this so I can try. Thanks for any help.Which version of the mod are you running?

Kuroi Web Design and Development | Twitter

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

16 Oct 2006, 4:19 AM
#190
tajul_ashyqin avatar

tajul_ashyqin

Zen Follower

Join Date:
Apr 2006
Location:
Labuan Island
Posts:
362
Plugin Contributions:
1

Re: Stocks by attributes

kuroi:

OK. I've tracked down the bug and have a fix. It applies to both Danielcor's 3.0.1 version and my 4.1 version. A 4.2 version for Zen Cart 1.3.5 users has been submitted to the downloads area containing this, the resolution of Supus's issue a few posts back and some improvements to the alignment of data on the stock page.

If you're running an older version of Zen Cart and are therefore still using Danielcor's version, you will need to apply the first change by hand, but it's fairly straightforward.

All the changes take place in admin/products_with_attributes_stock.php. Make sure you have the right file (there are several with this name).

Find the following line (probably 149) and delete it
Find the following block (probably 155-163)and immediately afterwards addFind the second instance of the block above (around about 202-210) and delete it.

Find the following line (now about 205) and delete the bit marked in red

wow, who are you anyway?! :D superb, Peter! you are really very helpful person... the fixes solved the problems! million thanx to you... :yes: and thank you also for maintaining these mod! :smile:

"Whether you think you can, or you think you can't... YOU ARE RIGHT."
GOOD LUCK !!!

16 Oct 2006, 9:04 AM
#191
rkharris avatar

rkharris

New Zenner

Join Date:
Mar 2006
Posts:
7
Plugin Contributions:
0

Re: Stocks by attributes

Hi Again

Your reply got me thinking and so I just got the latest version and it now works fine, my eyes must be getting bad as I didn't see the updated download link. Many thanks for the help.

20 Oct 2006, 5:12 PM
#192
supus avatar

supus

New Zenner

Join Date:
Apr 2006
Posts:
12
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

Supus, I have tried twice (several days apart) but not succeeded in replicating the bug that you describe in the way that you describe it. However, I can replicate it in a different way for which the fix is ...

In includes/classes/order.php find line 696and immediately afterwards insertI believe that there is a high chance that this will fix your problem also. Please try it and let me know.

If it doesn't work for you, please provide more specific information about the products that you are buting, the attributes that they have (if any) and their attribute stock level. Thanks.

Hi kuroi

Thanks a lot .. your fix works for me too :)

17 Nov 2006, 5:43 AM
#193
ps avatar

ps

New Zenner

Join Date:
Nov 2006
Posts:
26
Plugin Contributions:
0

Re: Stocks by attributes

So, I've installed version 4.2, made the changes described in this thread: http://www.zen-cart.com/forum/showthread.php?t=25987 by grayson on post 110 and 132. And I'm still not able to have quantities show up on the product info page.

help?

thank you.

19 Nov 2006, 11:54 AM
#194
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

ps*:

So, I've installed version 4.2, made the changes described in this thread: http://www.zen-cart.com/forum/showthread.php?t=25987 by grayson on post 110 and 132. And I'm still not able to have quantities show up on the product info page.Grayson's changes were applied to an earlier version of Zen Cart and the mod. There are further adjustments that need to be made for later versions which are described earlier in this thread.

Kuroi Web Design and Development | Twitter

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

19 Nov 2006, 11:59 AM
#195
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

Version 4.3 of this mod for Zen Cart 1.3.6 is now available in the downloads section. Due to my other commitments it's less extensively tested than previous releases. The changes shouldn't have introduced any new problems, but if you find any please post them in the following thread: http://www.zen-cart.com/forum/showthread.php?t=47180

Kuroi Web Design and Development | Twitter

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

31 Jan 2007, 9:16 PM
#197
spectreman avatar

spectreman

New Zenner

Join Date:
May 2006
Posts:
32
Plugin Contributions:
0

Re: Stocks by attributes

Hello All,

OK - let's see if i can explain this:

i installed the mod (i'm running zen version 1.3.0.2) works great.

However, i have some products in which i would rather not be controlled by the stock by attributes mod.

i figured that if i just didn't add a varient, the "Main" inventory stock would be used...not the case. it seems that if a product has attributes, the stock MUST be controlled by the mod, otherwise i get an "out of stock" error.

is there anyway i can have some products with attributes controlled by the mod, and at the same time have products with attributes rely on the "Main" inventory level?

Please let me know, i couldn't find anyone else in the forums with this question, so something may be screwy with my cart....

Thanks!
s.

3 Feb 2007, 10:34 AM
#198
rebecca_thomas avatar

rebecca_thomas

New Zenner

Join Date:
Jan 2007
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

I have downloaded the module by kuroi but I'm not sure how to tell Zen Cart what stock I have in each size. My products have size attributes on them but I still only see one Product Quanity box on the product not one for each size. Sorry can you help. Are there any instructions anywhere. Sorry first time zen cart user so its a steap learning curve.

7 Feb 2007, 9:36 PM
#199
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Re: Stocks by attributes

Rebecca Thomas:

I have downloaded the module by kuroi but I'm not sure how to tell Zen Cart what stock I have in each size. My products have size attributes on them but I still only see one Product Quanity box on the product not one for each size. Sorry can you help. Are there any instructions anywhere. Sorry first time zen cart user so its a steap learning curve.

Hey Rebecca,
You won't find it in the individual product pages. Instead, in the admin panel, go to Catalog. You'll find a new option there titled Products With Attributes Stock.

Have Fun!
Audra

7 Feb 2007, 9:40 PM
#200
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Re: Stocks by attributes

spectreman:

is there anyway i can have some products with attributes controlled by the mod, and at the same time have products with attributes rely on the "Main" inventory level?

s.

Hi s.
As far as I know, this cannot be done with the current mod. If your issue is simply that you do not want stock controlled for these products then you can set the level (in the products with attributes stock area) to an obscenely high number, so that you only have to go through and input the stock for those products once.

Sorry I don't have a better answer for you.
Audra