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

Stocks by attributes

Locked

Views: 251,288

Results 701 to 720 of 1,126
This thread is locked. New replies are disabled.
19 May 2009, 8:15 PM
#701
jazzyp avatar

jazzyp

New Zenner

Join Date:
Feb 2009
Location:
UK
Posts:
29
Plugin Contributions:
0

Stocks by attributes

cropinstop:

Found the solution.

An "attribute stock exceeded" check is missing from "includes/modules/pages/checkout/header_php.php". This file is unique to the "Fast and Easy Checkout" contribution.

Change

// Stock Check
if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
$products = $_SESSION['cart']->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
to

// Stock Check
if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
$products = $_SESSION['cart']->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {

  // Added to allow individual stock of different attributes
  unset($attributes);
  if(is_array($products[$i]['attributes'])) {
    $attributes = $products[$i]['attributes'];
  } else  {
    $attributes = '';
  }
  // End change

  if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes)) {
	  zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));

Damn. Thought I'd found the solution, but this hasn't worked either :(

20 May 2009, 8:00 PM
#702
flowerchild5 avatar

flowerchild5

New Zenner

Join Date:
Mar 2009
Posts:
31
Plugin Contributions:
0

Re: Stocks by attributes

colinr:

Could this module be modified to provide individual product codes as well as stock levels?

I have tried using the Attributes Modelnumbers contrib by helix, but is (still) in beta and seems very flakey.

ColinR

I added an additional column in the database for product attribute product codes. I called it attribute_skus. I have not yet figured out how to make this editable in admin, but it is pretty easy to add the model #'s in PHPmyAdmin. I was able to get the model #'s to display in the same table in admin though so that I am able to verify I added them to the correct variant. If you would like this code I can provide it.

I have not decided if I will go any further with this as my need has already been fulfilled. I just need to be able to import and export inventory using my company's inventory program. I would imagine one could put this info on invoices and shopping cart pages as well pretty easily.

25 May 2009, 5:36 PM
#703
ferid avatar

ferid

New Zenner

Join Date:
Jun 2005
Posts:
65
Plugin Contributions:
0

Re: Stocks by attributes

I installed the stock_by_attributes_4-7MULTIADD (zc 1.38).
But as soon as I edit a product, the product description gets deleted :(
Anyone know how this is possible?

26 May 2009, 5:42 PM
#704
robrem avatar

robrem

New Zenner

Join Date:
Mar 2009
Location:
Taos, NM
Posts:
19
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

@robrem

From your error message it would appear that you are not using SBA 4.7, but rather the confusingly denoted SBA 4.7 MULTADD. The headers error is well-known and already dealt with in this thread (see post #648 for example).

Going back to you original problem, this cannot be caused by SBA as it has no interaction with the product page (it doesn't kick in until visitors get the the shopping cart), nor does it change the structure of your attributes (it holds stock information in a separate table).

It sounds as though you have an underlying problem with the structure of your attributes, which audradh's suggestion may help you to get to the bottom of.
kuroi,

I see that there is another version of SBA 4.7 by Hugo13- SBA 4.7 ajax. If I am using the MULTADD version of SBA and want to change that, will installing this newer version (that is evidently not the MULTADD) cause me to lose all my quantity data that's been input?
Thanks for all you do for ZC and it's community.

26 May 2009, 5:48 PM
#705
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

robrem:

I see that there is another version of SBA 4.7 by Hugo13- SBA 4.7 ajax. If I am using the MULTADD version of SBA and want to change that, will installing this newer version (that is evidently not the MULTADD) cause me to lose all my quantity data that's been input?If you don't run the SQL patch then your data should be safe. However, beware of the AJAX version, it's missing some key files. In theory installing it over the top of the multiadd version should add the AJAX functionality and fill in the holes left by the missing files, but I haven't personally tried using either so that advice comes with a big health warning.

26 May 2009, 6:10 PM
#706
robrem avatar

robrem

New Zenner

Join Date:
Mar 2009
Location:
Taos, NM
Posts:
19
Plugin Contributions:
0

Re: Stocks by attributes

Thanks kurio,
After reviewing some some of the post history in this thread again, I've decided to leave well enough alone for now. I don't want to take the risks that making these changes might incur and I don't have enough time to play around with testing it.

2 Jun 2009, 4:33 PM
#707
rhlee avatar

rhlee

New Zenner

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

Re: Stocks by attributes

Hi all,

I'm running Zen Cart 1.3.8a with the Product attributes with Stock, latest version. It seemed to be working.

However now, when I set a quantity for a single variant. It marks all of the variants as out of stock.

You guys experienced this before.

Thanks in advance.

Rich

3 Jun 2009, 9:41 AM
#708
colinr avatar

colinr

New Zenner

Join Date:
Jul 2006
Posts:
35
Plugin Contributions:
1

Re: Stocks by attributes

flowerchild5:

I added an additional column in the database for product attribute product codes. I called it attribute_skus. I have not yet figured out how to make this editable in admin, but it is pretty easy to add the model #'s in PHPmyAdmin. I was able to get the model #'s to display in the same table in admin though so that I am able to verify I added them to the correct variant. If you would like this code I can provide it.

Yes please! That would be a big help. :smile:

ColinR

3 Jun 2009, 11:28 AM
#709
rhlee avatar

rhlee

New Zenner

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

Re: Stocks by attributes

rhlee:

Hi all,

I'm running Zen Cart 1.3.8a with the Product attributes with Stock, latest version. It seemed to be working.

However now, when I set a quantity for a single variant. It marks all of the variants as out of stock.

You guys experienced this before.

Thanks in advance.

Rich

I found the bugger.

products_with_attributes_stock.php line 234

				for ($i = 0;$i < sizeof($arrNew);$i++) {
					$strAttributes = implode(",", $arrNew[$i]);
					$query = 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$strAttributes.'",'.$quantity.') ON DUPLICATE KEY UPDATE `stock_attributes` = "'.$strAttributes.'", `quantity` = '.$quantity;
					$db->Execute($query);
				}

should be

				for ($i = 0;$i < sizeof($arrNew);$i++) {
					sort($arrNew[$i])
					$strAttributes = implode(",", $arrNew[$i]);
					$query = 'insert into `'.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.'` (`products_id`,`stock_attributes`,`quantity`) values ('.$products_id.',"'.$strAttributes.'",'.$quantity.') ON DUPLICATE KEY UPDATE `stock_attributes` = "'.$strAttributes.'", `quantity` = '.$quantity;
					$db->Execute($query);
				}

Otherwise the attributes will display in the wrong order on the field

17 Jun 2009, 7:17 PM
#710
flowerchild5 avatar

flowerchild5

New Zenner

Join Date:
Mar 2009
Posts:
31
Plugin Contributions:
0

Re: Stocks by attributes

flowerchild5:

I added an additional column in the database for product attribute product codes. I called it attribute_skus. I have not yet figured out how to make this editable in admin, but it is pretty easy to add the model #'s in PHPmyAdmin. I was able to get the model #'s to display in the same table in admin though so that I am able to verify I added them to the correct variant. If you would like this code I can provide it.

colinr:

Yes please! That would be a big help. :smile:

ColinR

I added the following code to admin/products_with_attributes_stock.php

Changed

echo '<th class="stockAttributesHeadingStockId">'.PWA_STOCK_ID.'</th><th class="stockAttributesHeadingVariant">'.PWA_VARIANT.'</th><th class="stockAttributesHeadingQuantity">'.PWA_QUANTITY_IN_STOCK.'</th><th class="stockAttributesHeadingEdit">'.PWA_EDIT.'</th><th class="stockAttributesHeadingDelete">'.PWA_DELETE.'</th>';

To

echo '<th class="stockAttributesHeadingStockId">'.PWA_STOCK_ID.'</th><th class="stockAttributesHeadingVariant">'.PWA_VARIANT.'</th><th class="stockAttributesHeadingSku">'.PWA_ATTRIBUTES_SKU.'</th><th class="stockAttributesHeadingQuantity">'.PWA_QUANTITY_IN_STOCK.'</th><th class="stockAttributesHeadingEdit">'.PWA_EDIT.'</th><th class="stockAttributesHeadingDelete">'.PWA_DELETE.'</th>';

and added

		```php

echo '<td class="stockAttributesCellSku">'."\n";
echo $attribute_products->fields['attributes_sku'];
echo '</td>'."\n";


right after

	```php
sort($attributes_output);
			echo implode("\n",$attributes_output);

and to admin/includes/languages/english/products_with_attributes_stock.php

I added

define('PWA_ATTRIBUTES_SKU', 'Attributes SKU'); 

and to admin/includes/stock_attributes.css

I changed

.stockAttributesHeadingStockId,
.stockAttributesHeadingVariant,
.stockAttributesHeadingQuantity,
.stockAttributesHeadingEdit,
.stockAttributesHeadingDelete {
	border-bottom: 1px solid #ccc;
	width:18%;
}

to

.stockAttributesHeadingSku,
.stockAttributesHeadingStockId,
.stockAttributesHeadingVariant,
.stockAttributesHeadingQuantity,
.stockAttributesHeadingEdit,
.stockAttributesHeadingDelete {
	border-bottom: 1px solid #ccc;
	width:18%;
}

and changed

.stockAttributesCellStockId,
.stockAttributesCellVariant,
.stockAttributesCellQuantity,
.stockAttributesCellEdit,
.stockAttributesCellDelete {
	border-bottom: 1px dotted #ccc;
}

to

.stockAttributesCellSku,
.stockAttributesCellStockId,
.stockAttributesCellVariant,
.stockAttributesCellQuantity,
.stockAttributesCellEdit,
.stockAttributesCellDelete {
	border-bottom: 1px dotted #ccc;
}
17 Jun 2009, 9:46 PM
#711
jdhiler avatar

jdhiler

New Zenner

Join Date:
Jun 2009
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

total noob question:

just installed stock with attributes mod 4.7.ajax over zencart 1.3.8a using barebones template that's i've customized a little.

when choosing Catalog > Products with Attributes Stock i get a blank page, except for this:

"No input file specified."

i'm sure it's something easy and obvious, but i'm missing it. duh.

thanks for your help.

18 Jun 2009, 12:56 AM
#712
jdhiler avatar

jdhiler

New Zenner

Join Date:
Jun 2009
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

okay, think i got it.

thanks anyway.

18 Jun 2009, 2:46 AM
#713
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

jdhiler:

okay, think i got it.

thanks anyway.Wanna share what you did.. it might help others who may be reading this thread..

18 Jun 2009, 3:07 AM
#714
edeades avatar

edeades

New Zenner

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

Re: Stocks by attributes

I have just tried to install the stock by attributes mod. I ran the stock_attribute.sql through Admin-Tools-Install SQL Patches. However, I do not have the "Products with Attributes Stock" option under Admin-Catalog. I logged into my web host Cpanel and see the zen_products_with_attributes_stock table was created. Am I missing a step?

Thanks for any guidance.

18 Jun 2009, 8:09 AM
#715
kuroi avatar

kuroi

Totally Zenned

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

Re: Stocks by attributes

edeades:

I have just tried to install the stock by attributes mod. I ran the stock_attribute.sql through Admin-Tools-Install SQL Patches. However, I do not have the "Products with Attributes Stock" option under Admin-Catalog. I logged into my web host Cpanel and see the zen_products_with_attributes_stock table was created. Am I missing a step?It sounds as though you didn't copy the files to your site, or put them in the wrong place.

18 Jun 2009, 1:52 PM
#716
flowerchild5 avatar

flowerchild5

New Zenner

Join Date:
Mar 2009
Posts:
31
Plugin Contributions:
0

Re: Stocks by attributes

kuroi:

It sounds as though you didn't copy the files to your site, or put them in the wrong place.

check to make sure you did not rename your admin folder and did not adjust your upload files accordingly. I made this mistake :oops:

19 Jun 2009, 3:01 AM
#717
edeades avatar

edeades

New Zenner

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

Re: Stocks by attributes

Thanks for the suggestions. I must be missing something. I went throug instructions again and copied files again. I still do not have the Products with Attributes under Catalog in Admin. Has anyone esle run into this problem.

19 Jun 2009, 6:51 AM
#718
faze avatar

faze

New Zenner

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

Re: Stocks by attributes

I have a problem not listed in this thread that I have seen yet. I am running Zen 1.3.8 and the newest version of stock by attributes. The products with attributes section is located in admin>catalog and I am able to insert stock quantities but when you check out with products with a stock level of 0 no out of stock or error message appears. Configuration>Stock> Allow Checkout is set to 0. Any help?

http://fazeapparel.com/catalog/index.php?main_page=index&cPath=4_5

20 Jun 2009, 4:34 AM
#719
linnx avatar

linnx

Zen Follower

Join Date:
Jun 2009
Posts:
187
Plugin Contributions:
0

Re: Stocks by attributes

robrem:

I too would like to display the quantity available for each attribute. It seems that someone has worked this out but can't get it to not display attributes with zero qty. Does the attribute display show 0? If it does I'd be interested in making that addition. It's probably in this thread somewhere, anyone know how to find it or post it again?
Thanks a bunch.

I too am very interested to see if this module can hide attributes with zero qty. Also, can it display the quantity for each attribute rather than add up all of them?

Say you are selling

Soda
Sprite - AVAIL 3
Coke - AVAIL 1
Pepsi - AVAIL 1
Canada Dry - AVAIL 0 (DONT DISPLAY THIS!)

Is this possible?

22 Jun 2009, 6:34 AM
#720
jdhiler avatar

jdhiler

New Zenner

Join Date:
Jun 2009
Posts:
5
Plugin Contributions:
0

Re: Stocks by attributes

DivaVocals:

Wanna share what you did.. it might help others who may be reading this thread..

the only thing is did is reinstall the files, one by one instead of that sketchy way of dropping the entire folder on the install, which doesn't confirm exactly what gets copied where... at least not in Cyberduck.