Forums / All Other Contributions/Addons / Stocks by attributes

Stocks by attributes

Locked

Views: 251,699

Results 1,021 to 1,040 of 1,126
This thread is locked. New replies are disabled.
31 Oct 2010, 10:55 PM
#1021
dirntknow avatar

dirntknow

New Zenner

Join Date:
Oct 2010
Posts:
8
Plugin Contributions:
0

Stocks by attributes

Sorry for the noob question but i've just installed stock by attributes, created a product and using stock by attributes defined a quantity for each variant. The quantities are not updating when I make a test purchase....where am i going wrong?

2 Nov 2010, 8:59 PM
#1022
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Location:
North Highlands, California 95660
Posts:
287
Plugin Contributions:
0

Re: Stocks by attributes

dirntknow:

Sorry for the noob question but i've just installed stock by attributes, created a product and using stock by attributes defined a quantity for each variant. The quantities are not updating when I make a test purchase....where am i going wrong?

Did you Sync Quantities after adding the stock?

http://www.sidewalkstyles.com Comfort Footwear, Accessories and More.
creinold SBA with Dynamic Drop Downs latest Alpha release: http://www.sidewalkstyles.com/creinold_SBA5.0_alpha_version1.5_for_zencart_V1.5.0.zip

2 Nov 2010, 9:01 PM
#1023
creinold avatar

creinold

Zen Follower

Join Date:
Sep 2008
Location:
North Highlands, California 95660
Posts:
287
Plugin Contributions:
0

Re: Stocks by attributes

weber:

after SBA installed, the original zen cart sales report can not show the actual sales...

I have no problems with my report. It doesn't show attribute sales, just product item sales.

http://www.sidewalkstyles.com Comfort Footwear, Accessories and More.
creinold SBA with Dynamic Drop Downs latest Alpha release: http://www.sidewalkstyles.com/creinold_SBA5.0_alpha_version1.5_for_zencart_V1.5.0.zip

6 Nov 2010, 2:33 PM
#1024
p1lot avatar

p1lot

New Zenner

Join Date:
May 2009
Posts:
69
Plugin Contributions:
0

Re: Stocks by attributes

for some reason the "save" button at the top and the bottom were removed in your newest release, otherwise it is working perfectly fine.

here is the patched version of the file "admin/includes/classes/products_with_attributes_stock.php" to mass-edit quantities:
http://pastie.org/1277159

19 Nov 2010, 5:50 PM
#1025
janislyn avatar

janislyn

New Zenner

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

Re: Stocks by attributes

Posted in another thread, but this may be correct one...

I'm working with Zen Cart version 1.3.8a, have the stock by attributes add-on installed for that version and have a couple of stock-related issues.

  1. I need for the stock level for a particular attribute to show in the shopping cart when a customer selects a quantity more than what's in stock. Despite having the correct configurations under Configuration > Stock, I don't get the quantity showing in the shopping cart. Rather there is this message:

Products marked with * are out of stock or there are not enough in stock to fill your order. Please reduce the quantity of products marked with * below. Thank you.

  1. Relatedly, when a customer purchases a product with attribute, the stock for that attribute is not updated automatically. Rather the product stock itself is updated but I have to go under Catalog > Product with Attributes Stock to manually update the attribute quantity.

How do I get the attribute quantity to show in cart when customer selects more than what's in stock? Also, how do I get attribute stock level to update automatically? I've seen both of these questions posted over and over in this forum with no clear answers. If anyone can help, it would be greatly appreciated.

Thanks.

20 Nov 2010, 1:28 AM
#1026
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Stocks by attributes

Well, after months, I did, or I think I did. I have the latest version (http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=310) it says is by The Software Guy but the instructions are by Kuroi (so confused now!) and I'm still having the same problem. With multiple attributes I get a load of options on the product page (this particular one http://www.byvalenti.com/index.php?main_page=product_wedding_info&cPath=24_7&products_id=63&number_of_uploads=0), so much that it crashed when I tried to set products with attributes stock. All the options multiply exponentially by the number of attributes each option has. For example, "Cello Bag / 1 Raffia Ribbon" appears numerous times instead of once, and the same happens with each and everyone one of the options as per combinations there are. Has anyone any idea what is happening here? :(

Thanks!

DivaVocals:

Hi folks.. Haven't tested the latest SBA version.. Sounds like it too has issues..

So let me say what I have consistently said in this and the other SBA support thread.. I ONLY use the version created by Kuroi.. EVERY SINGLE VERSION released after Kuroi's version is close but no cigar IMHO. If you look through this support thread, you will see that CONSISTENTLY the problems with SBA all relate to versions other than the one created by Kuroi..

My advice?? Rollback to the Kuroi version.. Unless someone (like the author of the latest version) steps in to help..

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com

22 Nov 2010, 10:28 PM
#1027
finless avatar

finless

New Zenner

Join Date:
Nov 2010
Posts:
7
Plugin Contributions:
0

Re: Stocks by attributes

OK new guy to Zen-cart here and have been setting up and having fun for a little over a week. I have found all I need in the FAQ's and fine posts here in this forum. Awesome all!

Now I want to add this add-on and based on reading this thread and it seems for me to at least for now start with Kuroi's 4.7 package. I am running ZC 1.3.9h.

HOWEVER... I am confused about installation?

Does this package not support overrides?
I understand there are NO ADMIN overrides but the INCLUDES install baffles me. To now, I have used overrides for everything I have done so far PER the recommendations here. I again understand for the admin you will be replacing core files.

The instructions that come with the install of this ABS package seem old and or incorrect?

The README.HTML says this:

Prepare the package for upload to your server by renaming the following folders to match your template name: includes/modules/YOUR_TEMPLATE and includes/templates/YOUR_TEMPLATE.

HUH? Modules? Shouldn't this be includes/templates/YOUR_TEMPLATE_NAME/templates/YOUR_TEMPLATE_NAME ???

OK then the other directories in includes with this package. Are you really replacing core files or should they be put in overrides?
For instance the instructions say this:

There are six core Zen Cart files modified by this add-on. If you have installed other add-ons or customized your cart since your Zen Cart installation or upgrade, you will need to check whether they have changed any of the following files:
•admin/includes/stylesheet.css
•admin/orders.php
•includes/classes/order.php
•includes/functions/functions_lookups.php
•includes/modules/pages/checkout_shipping/header_php.php
•includes/modules/pages/shopping_cart/header_php.php

I understand I WILL be replacing the admin files but shouldn't the others be like:
includes/modules/YOUR_TEMPLATE_NAME/ ????
includes/functions/YOUR_TEMPLATE_NAME/
and so on?

So for instance the PAGES directory. Am I support to REPLACE the 2 CORE directories "checkout_shipping" and "shopping cart" or should I be doing this:
includes/modules/YOUR_TEMPLATE_NAME/pages/checkout_shipping etc??

I am good at backing up before making changes, etc. I installed one of the other packages (the filter 1.6 or something like that) and the admin pages worked but checkout did not. Again I read Kuroi's package is most stable so I backed out everything and am planning to try this one BUT, this time I want to make sure to put the files in the proper place. Overrides or not? That is the question ;)

Thanks much!
Bob

23 Nov 2010, 12:09 AM
#1028
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

finless:

HOWEVER... I am confused about installation?

Does this package not support overrides?
I understand there are NO ADMIN overrides but the INCLUDES install baffles me. To now, I have used overrides for everything I have done so far PER the recommendations here. I again understand for the admin you will be replacing core files.

The instructions that come with the install of this ABS package seem old and or incorrect?These instructions are not old or incorrect at all. Kuroi is one of the most experienced guys around here, and his install instructions for 4.7 version of SBA - Stocks by Attributes (Not ABS) are absolutely spot on and indeed using the Zen Cart overrides system correctly.

finless:

The README.HTML says this:

Prepare the package for upload to your server by renaming the following folders to match your template name: includes/modules/YOUR_TEMPLATE and includes/templates/YOUR_TEMPLATE.HUH? Modules? Shouldn't this be includes/templates/YOUR_TEMPLATE_NAME/templates/YOUR_TEMPLATE_NAME ???Short answer is no. Follow the instructions and rename all the YOUR_TEMPLATE folders in the SBA install package to match your template's folder name. If you are using ver 4.7, these files are from an older version of Zen Cart. So you will need to make sure they include not only the required SBA code, but all the latest updates for these files (if there are any) from the latest Zen Cart version.

finless:

OK then the other directories in includes with this package. Are you really replacing core files or should they be put in overrides?
For instance the instructions say this:

There are six core Zen Cart files modified by this add-on. If you have installed other add-ons or customized your cart since your Zen Cart installation or upgrade, you will need to check whether they have changed any of the following files:
•admin/includes/stylesheet.css
•admin/orders.php
•includes/classes/order.php
•includes/functions/functions_lookups.php
•includes/modules/pages/checkout_shipping/header_php.php
•includes/modules/pages/shopping_cart/header_php.phpI understand I WILL be replacing the admin files but shouldn't the others be like:
includes/modules/YOUR_TEMPLATE_NAME/ ????
includes/functions/YOUR_TEMPLATE_NAME/
and so on?

So for instance the PAGES directory. Am I support to REPLACE the 2 CORE directories "checkout_shipping" and "shopping cart" or should I be doing this:
includes/modules/YOUR_TEMPLATE_NAME/pages/checkout_shipping etc??Again, the short answer is no.. The instructions are correct.. The files listed here are not part of the Zen Cart override system and as such they must be overwritten by the files in the install package (as indicated in the instructions). Again, if you are using ver 4.7, these files are from an older version of Zen Cart. So you will need to make sure they include not only the required SBA code, but all the latest updates for these files (if there are any) from the latest Zen Cart version.

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

23 Nov 2010, 6:39 PM
#1029
finless avatar

finless

New Zenner

Join Date:
Nov 2010
Posts:
7
Plugin Contributions:
0

Re: Stocks by attributes

Thanks for the reply. So I have to hand edit the ZC 1.3.9h files and by hand add the code from the SBA 4.7 replacement files? (I meant SBA last time not ABS it was a typo). There is no update to 4.7 you recommend I go with instead?

I follow you on the second part that some files are not part of the ZC overrides. I just assumed that anything in the includes folder could use overrides.

This override structure picture in the FAQ led me to believe that some of these directories like includes/modules/ could use overrides for anything in it?

http://www.zen-cart.com/index.php?main_page=download_contrib&contrib_id=298&update_id=2

Thanks,
Bob

7 Feb 2011, 10:51 PM
#1030
arpanet avatar

arpanet

New Zenner

Join Date:
Jan 2011
Posts:
4
Plugin Contributions:
0

Re: Stocks by attributes

limelites:

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've got a similar requirement on my site - if an attribute is out of stock it should be removed from the radio button list (radio buttons as opposed to dropdowns per the client's request).

This is somewhat complicated by the fact that each product has 2 attributes, so the attribute would only be removed if it's out of stock in ALL combinations.

A good example is this product:

http://www.vkoonyc.com/accessories-c-7/cashmere-loop-scarf-p-20

There's only one size, which makes it easy to test. It's out of stock in Mocha and Lt Grey, and I would like both of those attributes to be removed from the radio button list.

I tried limelite's code in attributes.php but it had no effect.

Using Zen Cart 1.3.9h w/ SBA 4.12.

Thanks in advance!

13 Feb 2011, 2:38 PM
#1031
magnaromagna avatar

magnaromagna

New Zenner

Join Date:
May 2010
Posts:
14
Plugin Contributions:
0

Re: Stocks by attributes

Hello,
I have a strange problem with this mod. Installed the last version (1.4.12). My zen cart version is 1.3.9h
On the public side, it shows the grid with the options (sizes and colours), but if I select - for example - no.2 size S and green color, no.3 size M red color, etc.), and click on "add to cart", in the cart it shows only 1 item.
Basically, it only add only 1 item (even if I add 2 or more) , and not show the attributes.

Do you think it's a problem on installation or need to edit some admin options?
Thanks

9 Mar 2011, 12:58 AM
#1032
buildingblocks avatar

buildingblocks

Totally Zenned

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

Re: Stocks by attributes

I sometimes get confused as to where a prefix would go.

This sql patch from the latest SBA update. Is this sql code ok to use for a cart that uses no prefix? The configure file shows no prefix is in use.

CREATE TABLE products_with_attributes_stock (
        stock_id INT NOT NULL AUTO_INCREMENT ,
        products_id INT NOT NULL ,
        stock_attributes VARCHAR( 255 ) NOT NULL ,
        quantity FLOAT NOT NULL ,
        sort INT NOT NULL ,
        PRIMARY KEY ( `stock_id` )
        );

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, 
       configuration_description, configuration_group_id, sort_order, 
       last_modified, date_added, use_function, set_function) 
       VALUES ('Show available stock level in cart when less than order', 'STOCK_SHOW_LOW_IN_CART', 'false', 
               'When customer places more items in cart than are available, show the available amount on the shopping cart page:',
               '9',
               '6',
               NULL,
               now(),
               NULL,
               "zen_cfg_select_option(array('true', 'false'),"
       ),
       ('Display Images in Admin', 'STOCK_SHOW_IMAGE', 'false', 
               'Display image thumbnails on Products With Attributes Stock page? (warning, setting this to true can severly slow the loading of this page):',
               '9',
               '6',
               NULL,
               now(),
               NULL,
               "zen_cfg_select_option(array('true', 'false'),"
       );
9 Mar 2011, 5:23 PM
#1033
buildingblocks avatar

buildingblocks

Totally Zenned

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

Re: Stocks by attributes

I am installing SBA 1.4.12 on a test cart 139h with a prefix of zen_

I installed the sql patch as provided in admin > tools > install sql patches and the table insertion appears to go well.

Query Results:
CREATE TABLE zen_products_with_attributes_stock ( stock_id INT NOT NULL AUTO_INCREMENT , products_id INT NOT NULL , stock_attributes VARCHAR( 255 ) NOT NULL , quantity FLOAT NOT NULL , sort INT NOT NULL , PRIMARY KEY ( stock_id ) );
INSERT INTO zen_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show available stock level in cart when less than order', 'STOCK_SHOW_LOW_IN_CART', 'false', 'When customer places more items in cart than are available, show the available amount on the shopping cart page:', '9', '6', NULL, now(), NULL, "zen_cfg_select_option(array('true', 'false')," ), ('Display Images in Admin', 'STOCK_SHOW_IMAGE', 'false', 'Display image thumbnails on Products With Attributes Stock page? (warning, setting this to true can severly slow the loading of this page):', '9', '6', NULL, now(), NULL, "zen_cfg_select_option(array('true', 'false')," );

phpmyadmin shows the table: zen_products_with_attributes_stock is there

The problem I run into is this:

When stock by attributes is applied to a product it works fine but if I try to update product stock amounts in bulk on the stock by attributes main page and click the save button I get this error message

1146 Table 'myusername_databasename.products_with_attributes_stock' doesn't exist
in:
[UPDATE products_with_attributes_stock SET quantity = '125' WHERE products_with_attributes_stock.stock_id =1 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.

any ideas why this is happening? Could it be the code in one or more of the files needs to have the prefix added?

9 Mar 2011, 10:38 PM
#1034
buildingblocks avatar

buildingblocks

Totally Zenned

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

Re: Stocks by attributes

ok I went through the files and added the prefix zen_ to line 227

 $sql = "UPDATE zen_products_with_attributes_stock SET quantity = '$value' WHERE zen_products_with_attributes_stock.stock_id =$id LIMIT 1";

This seems to have fixed the bulk update problem. Unless I run into an unforseen consequence.

While this (seems) to work I can't imagine this is the correct fix because if I applied this to the package to install elsewhere...well, not everyone has the same prefix.

Am I on the right track.

Can anyone comment on this?

Does this error happen to anyone else?

9 Mar 2011, 10:48 PM
#1035
buildingblocks avatar

buildingblocks

Totally Zenned

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

Re: Stocks by attributes

well it would be a good idea to state which file I edited wouldn't it

zc_admin/includes/classes/products_with_attributes_stock.php

10 Mar 2011, 9:18 AM
#1036
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

Better would be```php
$sql = "UPDATE " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " SET quantity = '$value' WHERE stock_id =$id LIMIT 1";

Kuroi Web Design and Development | Twitter

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

10 Mar 2011, 4:49 PM
#1037
buildingblocks avatar

buildingblocks

Totally Zenned

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

Re: Stocks by attributes

kuroi:

Better would be```php
$sql = "UPDATE " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " SET quantity = '$value' WHERE stock_id =$id LIMIT 1";


Thank you very much!!

That did the trick.
10 Mar 2011, 8:04 PM
#1038
buildingblocks avatar

buildingblocks

Totally Zenned

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

Re: Stocks by attributes

one last thing:

The link for, Sync All Quantities. When this link is clicked, the stock for all items is changed to 0. Is this supposed to happen?

That could be a problem for anyone who does know the results.

11 Mar 2011, 11:21 AM
#1039
madbull avatar

madbull

New Zenner

Join Date:
Mar 2011
Location:
Marinha Grande, Portugal
Posts:
2
Plugin Contributions:
0

Re: Stocks by attributes

Hello Guys,
My name is João Raposo, I'm new to Zen Cart, I am using the Zen Cart to install a new page for my company but I have one problem.
I had read so much threads and I only see user Siezer talking about what I want but I can't speak it so...
I would like too now if someone can change this add-on Stock by attributes to have a check box on each general attributes (Ex. Color, Size,etc...) to allow or not allow to insert stock on stock attributes to that general attribute.
This is because I had some attributes that I don't want to include with stock option. (Ex. Number of printings, Number of printing colors,etc...).
This is possible? Can some one help me?

Best Regards for all...
João Raposo
Marinha Grande, Portugal