Zen Cart Logo
Forums / All Other Contributions/Addons / Stock by Attribute v4.0 addon for v1.3.5-1.3.9

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

Views: 658,731

Results 461 to 480 of 3,609
5 Jul 2008, 10:23 AM
#461
kuroi avatar

kuroi

Totally Zenned

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

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

Dzy:

Hi,

I am using Stock by Attribute mod, which is great because its for a store selling clothing so it obviously needs different sizes. I don't want to show the total amount of stock but the amount of stock of each size and to not show the sizes that are out of stock. How do I do that? I can do PHP editting and some MySQL so if you could tell me how to fetch it/which tables (no phpMyAdmin here) that would be great!

ThanksProvided size is the only attribute that you are using this can be done using the method that has been discussed several times already in this thread. I'm afraid I can't be more specific as I've never actually done it myself.

If you have multiple attributes then it gets a lot more complicated and you would need to use javascript to dynamically display (or not) the attribute combinations that visitors are choosing.

Which tables you need to access would depend upon the complexity of your store setup and which approach you wanted to take to display this reduced information. There is a schema for the product tables that would include all those that you are likely to need.

5 Jul 2008, 10:26 AM
#462
kuroi avatar

kuroi

Totally Zenned

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

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

thehighlandsgroup:

I've installed Stock by Attribute Module Version 4.6 and am running ZenCart Version 1.3.7 . After running SQL file. The admin portion of store is running correctly but customers are not able to check out they get the following error upon checkout:

Fatal error: Cannot redeclare class order in /var/www/vhosts/kasmarpro.com/httpdocs/smokejumpers/includes/classes/order.php on line 20This error is one of the less opaque that PHP gives and means exactly what it says, that your site is trying to declare the same class twice.

Most likely this is because when you uploaded the stock by attribute mod you, or your FTP program, made a backup of the order.php class in the location quoted and left it there. Zen Cart can't tell the difference between files that are intended as backups and ones that it is supposed to load, so tries to load the same class twice.

5 Jul 2008, 10:40 AM
#463
kuroi avatar

kuroi

Totally Zenned

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

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

whitecliffs:

  1. Is it possible to use the Stock by Attribute in conjunction with Easy Populate Advanced in some way so that it is possible to mass upload products to Zencart and have the sizing attribute information, including the stock level on hand for each size, uploaded along with the rest of a products information when using Easy Populate Advanced.I can't answer definitively for Easy Populate Advanced as I don't have it, but I doubt it. Easy Populate and Stock By Attributes are both add-ons to Zen Cart and know squat about each other (though their authors have exchanged pleasantries).

whitecliffs:

I hope I am not missing something obvious, as it seems a little odd to mass upload say 100 or more products just to have to log into the admin back end, and one by one, set up the stock levels for each size for each shirt.

I am also hoping that if it is possible to do this, or if anyone out there is doing this, that someone/they can post a description of what would be required. If MySQL or PHP are required then I should have the necessary skills to make and test modifications. I am just not familiar with the Zen Cart database structure.There is a technical impediment in that Easy Populate uses product_model as it's index for linking to external information (assuming rightly, that the Zen Cart products_id will often not be available). However, there is no equivalent for product variants, i.e. product + specific combination of product option. This will be introduced in the next major release of Zen Cart.

  1. Assuming that 1. above is possible. Is it then possible to display the stock level on hand in the shop when on a products page and on the category home page? Or if this is not possible is it possible to stop someone checking out if there is zero stock on hand for a particular sized shirt?[/QUOTE]Displaying stock levels for products with attributes has been done to death in this and other forum threads. It is possible but requires increasing degrees of technical knowledge to achieve as the number and complexity of attributes increases.

It is also possible to stop somebody checking out if there is insufficient stock to support the order. This is built into core Zen Cart, extended by Stock by Attributes and controllable via the Admin > Configuration > Stock menu.

5 Jul 2008, 11:25 PM
#464
whitecliffs avatar

whitecliffs

New Zenner

Join Date:
Dec 2005
Posts:
2
Plugin Contributions:
0

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

Hi kuroi,

Thank you very much for your information.

Kind regards,
whitecliffs

6 Jul 2008, 1:26 AM
#465
webskipper avatar

webskipper

Totally Zenned

Join Date:
Nov 2007
Location:
USA
Posts:
876
Plugin Contributions:
2

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

I am using Araxis Merge (araxis com) to verify the changes I have done yesterday.

Except for destroying the Google Cart payment module, I saw no changes as to the hand inserted lines I added yesterday.

So, I just confirmed following the directions.

Admin panel still is not working. Snapshot is the same.

I even added the stock_attributes style to the stylesheet.css. No change.

How do I uninstall the sql patch to retry?

Maybe there is something else wrong with the install?

10 Jul 2008, 7:47 AM
#466
razmear avatar

razmear

New Zenner

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

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

Thanks for the great add on, easy install and only took about 20 minutes for a newbie like me to get it working.

Two questions, neither of which are very important.
1: If I'm running a single database, does the sync quantities button do anything? Doesn't seem to matter if I click it or not after changing product counts.
2: Is it possible to display remaining quantity of a size to a customer, either when size is selected or at checkout?

I have it functioning for this item:
http://magneticbreeze.com/ZenCart/index.php?main_page=product_info&cPath=7&products_id=37

and in the unlikely event that someone should order 13 of the size 8 rings, it gives the backorder message without the customer knowing that only 12 are in stock.

These are very minor concerns, so no big deal if this 2 year old 'emergency fix' doesn't have the feature.
Thanks Kuroi for making life a bit easier.

eb

11 Jul 2008, 9:44 PM
#467
milobloom avatar

milobloom

Totally Zenned

Join Date:
Feb 2004
Posts:
1,267
Plugin Contributions:
1

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

I just tried upgrading...

What I am getting now is I can get into things on the back end.
But on the front end.

My main and product pages are not commng up. Just my left bar and the header...

What do I do to fix this??? I dont know where to begin.

https://www.nothingbutcostumes.com

11 Jul 2008, 10:55 PM
#468
milobloom avatar

milobloom

Totally Zenned

Join Date:
Feb 2004
Posts:
1,267
Plugin Contributions:
1

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

I made sure I renamed the folders. (both of em)

Hope I can get this solved. I really could use this mod.

20 Jul 2008, 12:31 AM
#469
thehighlandsgroup avatar

thehighlandsgroup

New Zenner

Join Date:
Jul 2007
Location:
Denver, Colorado
Posts:
14
Plugin Contributions:
0

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

kuroi:

This error is one of the less opaque that PHP gives and means exactly what it says, that your site is trying to declare the same class twice.

Most likely this is because when you uploaded the stock by attribute mod you, or your FTP program, made a backup of the order.php class in the location quoted and left it there. Zen Cart can't tell the difference between files that are intended as backups and ones that it is supposed to load, so tries to load the same class twice.

Kuroi - You were exactly right. I had renamed some old files such as order.php to order-old.php and such. ZenCart for some reason doesn't like that. I uploaded all new files and overwrote older files as you suggested. Stock by attribute module is now working like a charm. Thanks much for pointing me in the right direction.

23 Jul 2008, 2:13 AM
#470
oakwood avatar

oakwood

New Zenner

Join Date:
May 2008
Posts:
85
Plugin Contributions:
0

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

Im not sure what's going on (I think Im just missing something), but the mod is working so far. On my test site in the admin, I setup the attributes and the stock for attributes on product "fred". Then I setup attributes for my next product, "p2" and went to setup the stock for attributes for "p2" but I cannot change products. I can only alter the stock for "fred".

What am I missing here?

thx

23 Jul 2008, 3:22 AM
#471
oakwood avatar

oakwood

New Zenner

Join Date:
May 2008
Posts:
85
Plugin Contributions:
0

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

I just wanted to jump in and say, I solve my own problem as I did not have any stock setup for "p2" thus it was not showing up in sba.

::smacks forehead, pours another cup of coffee::

23 Jul 2008, 7:23 AM
#472
kuroi avatar

kuroi

Totally Zenned

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

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

webskipper:

I am using Araxis Merge (araxis com) to verify the changes I have done yesterday.

Except for destroying the Google Cart payment module, I saw no changes as to the hand inserted lines I added yesterday.

So, I just confirmed following the directions.

Admin panel still is not working. Snapshot is the same.

I even added the stock_attributes style to the stylesheet.css. No change.

How do I uninstall the sql patch to retry?

Maybe there is something else wrong with the install?You can uninstall it by running the following through your Admin > Tools > Install SQL Patches> DROP TABLE products_with_attributes_stock;
DELETE FROM configuration where configuration_key = "STOCK_SHOW_LOW_IN_CART";but might this be something simpler like not having any stock set up on your products ready to be divided between the product variants?

23 Jul 2008, 7:30 AM
#473
kuroi avatar

kuroi

Totally Zenned

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

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

Razmear:

1: If I'm running a single database, does the sync quantities button do anything? Doesn't seem to matter if I click it or not after changing product counts.I suspect that it doesn't anymore. This mod has been maintained by a number of people over the years, and I have a vague memory that the manual syncing may have been automated somewhere along the way - but I'm not absolutely sure. Certainly there's no harm to it though!

Razmear:

2: Is it possible to display remaining quantity of a size to a customer, either when size is selected or at checkout?Yes. Set the Admin > Stock > "Show available stock level in cart when less than order" flag to "true"

24 Jul 2008, 7:28 PM
#474
raineray avatar

raineray

New Zenner

Join Date:
May 2008
Posts:
9
Plugin Contributions:
0

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

I have installed the mod and all is working great! I would like to know if there is a setting so that when a specific size is out of stock the option for that size will not even be displayed in the dropdown. Is this possible? The way the mod works now the customer can choose the out of stock size and is told in the cart that the item in that size is out of stock and will be put on back order. Thanks in advance for any help.

24 Jul 2008, 8:31 PM
#475
kuroi avatar

kuroi

Totally Zenned

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

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

No there is no such setting, but the code changes needed to do this under limited circumstances (i.e. no more than one attribute per product) have been discussed previously.

25 Jul 2008, 2:54 PM
#476
raineray avatar

raineray

New Zenner

Join Date:
May 2008
Posts:
9
Plugin Contributions:
0

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

Thanks for the reply. As I understand what you said it can only be done with code changes when there is one attribute for the item not multiple sizes available for the product and one of the sizes is out of stock. Have I stated the situation correctly?
Thanks for your patience.

25 Jul 2008, 3:13 PM
#477
kuroi avatar

kuroi

Totally Zenned

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

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

No size (however many values it can take) is just one attribute. You can do it with this.

However, if you had a size attribute and a color attribute, it would be more complicated, since you would no longer be able to say whether or not you were out of stock of small, as you might have them in red, but not in blue. So you need to either publish a table of stock positions (ouch) or use AJAX to get the answer for specific cases once a visitor has made their first choice.

26 Jul 2008, 1:35 PM
#478
bunkerage avatar

bunkerage

New Zenner

Join Date:
Jul 2008
Posts:
6
Plugin Contributions:
0

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

I am having some trouble getting Stock by attribute to work properly.

I am using the latest version of Zencart and the latest Stock by Attribute release but for some reason Zencart seems to be ignoring the stock for each attribute.

For Example:

I have a test item called SHIRT and it has the following Attributes

Small: 5 in stock
Medium: 5 in stock
Large: 5 in stock
Total in stock: 15

Whenever I try to order 6 small shirts it allows me to when it should say out of stock..in fact..I can order any number of any attribute up to 15 (the total in stock) for the item.

I think the problem might be that I'm not Overwriting/installing all the files correctly because in the readme it says to rename "includes/modules/YOUR_TEMPLATE" but in my modules folder all I see is a folder named "page" do I rename this or what? Any help on how to install it more properly is appreciated. Thanks to all.

27 Jul 2008, 9:26 PM
#479
jill8026 avatar

jill8026

Totally Zenned

Join Date:
May 2007
Posts:
461
Plugin Contributions:
0

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

THANK YOU! This is the best thread that could have happened to me, and thanks for the link tot he thread that helps me define stock in the attributes for the customers to see what we actually have!

MY only question is formatting, how can I get the text for the attribute to sit as follows:

Name
Price
In-stock

I have not been able to figure this out at all....here is a link to a page that shows how it looks now...

http://www.ilovephotogifts.com/index.php?main_page=product_info&cPath=65_46&products_id=133

Thanks so much!!!!!!!!!!!!!!!

28 Jul 2008, 11:14 AM
#480
dan_lacey avatar

dan_lacey

New Zenner

Join Date:
Apr 2008
Posts:
15
Plugin Contributions:
0

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

Problem with MySQL -

Hi there, thanks for the great contribution, however Im having a problem in that on my customers site I have colours and sizes with stock for each of these attributes - if I leave the attrbutes set to 'all' and add a quantity, I get the following MySQL error message:

att: 81|80|79|136,84|83|82
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 'ON DUPLICATE KEY UPDATE stock_attributes = "81,84", quantity in: [insert into products_with_attributes_stock (products_id,stock_attributes,quantity) values (15,"81,84",5) ON DUPLICATE KEY UPDATE stock_attributes= "81,84",quantity` = 5]
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.

this only happens if i leave the attributes set to 'all' - if i chooses a specific colour and size and add the quantity and submit, it updates the stock levels with no problems....

Thanks in advance....
Dan.