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,723

Results 1,001 to 1,020 of 3,609
1 Jan 2011, 11:37 AM
#1001
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

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

The array in the ORIGINAL file looks like this:

//  echo  $currencies->rateAdjusted($tmp);
  $productArray[$i] = array('attributeHiddenField'=>$attributeHiddenField,
                            'flagStockCheck'=>$flagStockCheck,
                            'flagShowFixedQuantity'=>$showFixedQuantity,
                            'linkProductsImage'=>$linkProductsImage,
                            'linkProductsName'=>$linkProductsName,
                            'productsImage'=>$productsImage,
                            'productsName'=>$productsName,
                            'showFixedQuantity'=>$showFixedQuantity,
                            'showFixedQuantityAmount'=>$showFixedQuantityAmount,
                            'showMinUnits'=>$showMinUnits,
                            'quantityField'=>$quantityField,
                            'buttonUpdate'=>$buttonUpdate,
                            'productsPrice'=>$productsPriceTotal,
                            'productsPriceEach'=>$productsPriceEach,
                            'rowClass'=>$rowClass,
                            'buttonDelete'=>$buttonDelete,
                            'checkBoxDelete'=>$checkBoxDelete,
                            'id'=>$products[$i]['id'],
                            'attributes'=>$attrArray);
} // end FOR loop

Just ADD the element to the existing list: (see second listing in the code below...)

//  echo  $currencies->rateAdjusted($tmp);
  $productArray[$i] = array('attributeHiddenField'=>$attributeHiddenField,
                            'stockAvailable'=>$stockAvailable,
                            'flagStockCheck'=>$flagStockCheck,
                            'flagShowFixedQuantity'=>$showFixedQuantity,
                            'linkProductsImage'=>$linkProductsImage,
                            'linkProductsName'=>$linkProductsName,
                            'productsImage'=>$productsImage,
                            'productsName'=>$productsName,
                            'showFixedQuantity'=>$showFixedQuantity,
                            'showFixedQuantityAmount'=>$showFixedQuantityAmount,
                            'showMinUnits'=>$showMinUnits,
                            'quantityField'=>$quantityField,
                            'buttonUpdate'=>$buttonUpdate,
                            'productsPrice'=>$productsPriceTotal,
                            'productsPriceEach'=>$productsPriceEach,
                            'rowClass'=>$rowClass,
                            'buttonDelete'=>$buttonDelete,
                            'checkBoxDelete'=>$checkBoxDelete,
                            'id'=>$products[$i]['id'],
                            'attributes'=>$attrArray);
} // end FOR loop
1 Jan 2011, 8:39 PM
#1002
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

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

Thanks for the clarification (and the code.. :smile:)

schoolboy:

The array in the ORIGINAL file looks like this:

// echo $currencies->rateAdjusted($tmp);
$productArray[$i] = array('attributeHiddenField'=>$attributeHiddenField,
'flagStockCheck'=>$flagStockCheck,
'flagShowFixedQuantity'=>$showFixedQuantity,
'linkProductsImage'=>$linkProductsImage,
'linkProductsName'=>$linkProductsName,
'productsImage'=>$productsImage,
'productsName'=>$productsName,
'showFixedQuantity'=>$showFixedQuantity,
'showFixedQuantityAmount'=>$showFixedQuantityAmount,
'showMinUnits'=>$showMinUnits,
'quantityField'=>$quantityField,
'buttonUpdate'=>$buttonUpdate,
'productsPrice'=>$productsPriceTotal,
'productsPriceEach'=>$productsPriceEach,
'rowClass'=>$rowClass,
'buttonDelete'=>$buttonDelete,
'checkBoxDelete'=>$checkBoxDelete,
'id'=>$products[$i]['id'],
'attributes'=>$attrArray);
} // end FOR loop

> 
> ```php
//  echo  $currencies->rateAdjusted($tmp);
  $productArray[$i] = array('attributeHiddenField'=>$attributeHiddenField,
                            'stockAvailable'=>$stockAvailable,
                            'flagStockCheck'=>$flagStockCheck,
                            'flagShowFixedQuantity'=>$showFixedQuantity,
                            'linkProductsImage'=>$linkProductsImage,
                            'linkProductsName'=>$linkProductsName,
                            'productsImage'=>$productsImage,
                            'productsName'=>$productsName,
                            'showFixedQuantity'=>$showFixedQuantity,
                            'showFixedQuantityAmount'=>$showFixedQuantityAmount,
                            'showMinUnits'=>$showMinUnits,
                            'quantityField'=>$quantityField,
                            'buttonUpdate'=>$buttonUpdate,
                            'productsPrice'=>$productsPriceTotal,
                            'productsPriceEach'=>$productsPriceEach,
                            'rowClass'=>$rowClass,
                            'buttonDelete'=>$buttonDelete,
                            'checkBoxDelete'=>$checkBoxDelete,
                            'id'=>$products[$i]['id'],
                            'attributes'=>$attrArray);
} // end FOR loop
10 Jan 2011, 7:42 PM
#1003
luke_pickering avatar

luke_pickering

New Zenner

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

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

Hi I have downloaded the files and unzipped etc but there is no
includes/modules/YOUR_TEMPLATE

instead there is only

includes/modules/pages

I have gone ahead and renamed this to estorenow and uploaded admin and includes to the root of my install but nothing seems to have happened. I've checked under catalog and there's nothing new...

Am I doing something wrong?

12 Jan 2011, 11:55 PM
#1004
chrisd24 avatar

chrisd24

New Zenner

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

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

luke_pickering:

Hi I have downloaded the files and unzipped etc but there is no
includes/modules/YOUR_TEMPLATE

instead there is only

includes/modules/pages

I have gone ahead and renamed this to estorenow and uploaded admin and includes to the root of my install but nothing seems to have happened. I've checked under catalog and there's nothing new...

Am I doing something wrong?

You should have an includes/modules/(your template name). In my case it's a folder called template_default.

13 Jan 2011, 12:32 AM
#1005
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

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

ChrisD24:

You should have an includes/modules/(your template name). In my case it's a folder called template_default.And you NEVER want to put ANY module files into or modify ANY files in the default_template folder.. Use a proper template override.

13 Jan 2011, 3:52 AM
#1006
chrisd24 avatar

chrisd24

New Zenner

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

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

DivaVocals:

And you NEVER want to put ANY module files into or modify ANY files in the default_template folder.. Use a proper template override.

Why's that, because of updates?

13 Jan 2011, 4:56 AM
#1007
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

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

ChrisD24:

Why's that, because of updates?Yes.. that is the purpose of the overrides system.. You make your changes in the override file. You NEVER modify any of the default_templates files.. There are a number of EXCELLENT tutorials in the Zen Cart FAQs which explain the overrides process..

14 Jan 2011, 7:47 PM
#1008
balticccreations avatar

balticccreations

New Zenner

Join Date:
Jan 2011
Location:
Laguna Vista TX
Posts:
42
Plugin Contributions:
0

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

Hi,

I am very new to zen-cart (my store isn't finished yet) I have the latest version of zen cart and my host is justhost.com (not sure if that matters but since the cart is installed on there and not on my computer figured I'd mention it.) Anyhow I downloaded this mod (current version), did the sql patch and then from there I am completely lost!! I read the read me and it makes no sense. I don't have an option showing up in admin Catalog->Products with Attributes Stock so what am I doing wrong? PLEASE HELP! my site is balticcreations.net if that helps any? Thanks! Liana

Oh and I should mention what I am wanting to do is add quantities to colors...

14 Jan 2011, 8:58 PM
#1009
supersnow avatar

supersnow

Zen Follower

Join Date:
Apr 2007
Location:
California, USA
Posts:
233
Plugin Contributions:
0

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

I would like some guidance with a attribute area. We have pants in various sizes and that have a velcro section and they can choose one of two patches to go with the pants. I want to have stock for the pants sizes ONLY not the patches as the patches are not dependent on the the pants size.

This issue is basically a "gift wrap" issue like discussed on this topic in 2006 and also in the archive http://www.zen-cart.com/forum/showthread.php?t=25987&page=21

But my need is I would like to put this flag of products_attributes_checkstock as indicated in this archive topic but I would like to know what I need to exactly do so I don't mess up my store.

Thanks

17 Jan 2011, 6:29 PM
#1010
supersnow avatar

supersnow

Zen Follower

Join Date:
Apr 2007
Location:
California, USA
Posts:
233
Plugin Contributions:
0

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

supersnow:

I would like some guidance with a attribute area. We have pants in various sizes and that have a velcro section and they can choose one of two patches to go with the pants. I want to have stock for the pants sizes ONLY not the patches as the patches are not dependent on the the pants size.

This issue is basically a "gift wrap" issue like discussed on this topic in 2006 and also in the archive http://www.zen-cart.com/forum/showthread.php?t=25987&page=21

But my need is I would like to put this flag of products_attributes_checkstock as indicated in this archive topic but I would like to know what I need to exactly do so I don't mess up my store.

Thanks

Does anyone have any idea? I know I am not the only one concerned about this. I just want to know the steps and the files I need to edit etc. Please help!

19 Jan 2011, 11:50 PM
#1011
chrisd24 avatar

chrisd24

New Zenner

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

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

I have a problem with the stock errors on the shopping cart. If a product with an attribute is in the cart is either out of stock or over my stock count, the product is marked with *** correctly. However an item without any attributes doesn't generate an error. I think there is a problem with the code below:

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

			$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
	$flagStockCheck = NULL;
			if (zen_not_null($stock_check))
			{
				$flagAnyOutOfStock = true;
				$flagStockCheck = $stock_check;
			  $stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);		
			}
		}
    // end stock by attributes
  } //end foreach [attributes]
/*
  if (STOCK_CHECK == 'true') {
    $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
    if ($flagStockCheck == true) {
      $flagAnyOutOfStock = true;
    }
  }
  */

If I un-comment out the original code, the error problem flips. It will mark the product without the attribute, but in return the product with the attribute is not longer marked. Is there a problem that any can see with the code?

20 Jan 2011, 10:11 PM
#1012
p1lot avatar

p1lot

New Zenner

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

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

what version should we use for 1.3.9h, this one or the version bei creinold?

thanks a lot,
p1lot

21 Jan 2011, 6:27 PM
#1013
swolock avatar

swolock

New Zenner

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

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

We're using Zen Cart 1.3.8. I believe I've install Stock by Attributes correctly but we're having 3 problems:

  1. Some products work fine yet other show out of stock even though they are in stock. In other words, a blue large t-shirt checks out fine, when the red large t-shirt shows out of stock even though it isn't.

  2. Available quantity shows 0 in the shopping even though there are some left. In other words, if someone orders 5 blue large t-shirts and there are 4 in stock, instead available quantity showing 4 it shows 0.

  3. If the first product shows out of stock in the cart, subsequently added products also show out of stock even though they are in stock.

Does this sound like in installation problem, or maybe a configuration problem.

Thanks for your help.

21 Jan 2011, 6:29 PM
#1014
balticccreations avatar

balticccreations

New Zenner

Join Date:
Jan 2011
Location:
Laguna Vista TX
Posts:
42
Plugin Contributions:
0

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

p1lot:

what version should we use for 1.3.9h, this one or the version bei creinold?

thanks a lot,
p1lot

the beta 5.0 is what I'm using on 1.3.9h (the one by creinold)

24 Jan 2011, 4:13 PM
#1015
rpain avatar

rpain

Zen Follower

Join Date:
Mar 2005
Location:
Watford, UK
Posts:
146
Plugin Contributions:
0

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

Hi,

I'm using version 1.4.11 and zen v1.3.9d. I've got a strange situation where if someone adds more of one attribute than is in stock, it gets added to the shopping basket but no message appears to say that there isn't enough stock available. If the user then clicks on the checkout button they are returned to the shopping cart still with no error message.

If someone orders more than the total number of an item (with all attributes stock added together) the correct red message appears in the shopping bart page.

I've done lots of file comparisons but can't figure out what the problem is.

Any ideas?

Many thanks,
Richard

24 Jan 2011, 4:59 PM
#1016
balticccreations avatar

balticccreations

New Zenner

Join Date:
Jan 2011
Location:
Laguna Vista TX
Posts:
42
Plugin Contributions:
0

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

rpain:

Hi,

I'm using version 1.4.11 and zen v1.3.9d. I've got a strange situation where if someone adds more of one attribute than is in stock, it gets added to the shopping basket but no message appears to say that there isn't enough stock available. If the user then clicks on the checkout button they are returned to the shopping cart still with no error message.

If someone orders more than the total number of an item (with all attributes stock added together) the correct red message appears in the shopping bart page.

I've done lots of file comparisons but can't figure out what the problem is.

Any ideas?

Many thanks,
Richard

THAT is my EXACT problem! Nothing I have listed with attributes tells how many of each item is available! I hope to find the answer too!

24 Jan 2011, 5:41 PM
#1017
bobcnj avatar

bobcnj

New Zenner

Join Date:
Nov 2009
Posts:
10
Plugin Contributions:
0

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

balticccreations:

THAT is my EXACT problem! Nothing I have listed with attributes tells how many of each item is available! I hope to find the answer too!

OK same exact thing here. The products page shows the correct QTY in stock (sum of all attribute levels) but on cart it gives out of stick message and shows qty of 0 - please help!

24 Jan 2011, 5:59 PM
#1018
balticccreations avatar

balticccreations

New Zenner

Join Date:
Jan 2011
Location:
Laguna Vista TX
Posts:
42
Plugin Contributions:
0

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

bobcnj:

OK same exact thing here. The products page shows the correct QTY in stock (sum of all attribute levels) but on cart it gives out of stick message and shows qty of 0 - please help!

Mine doesn't even do that. It just won't let them check out. It will show how many they added to their cart but not how many are actually available. But on the product page it gives the total number of products available just not how many of each attribute.

25 Jan 2011, 10:37 PM
#1019
chrisd24 avatar

chrisd24

New Zenner

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

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

balticccreations:

Mine doesn't even do that. It just won't let them check out. It will show how many they added to their cart but not how many are actually available. But on the product page it gives the total number of products available just not how many of each attribute.

I have been messing with this for some time and the problem I am having, besides my previous post is that if I have 2 or more items in my cart and the last product is over the limit or out it marks it correctly, but where it gets tricky is:

Cart (3 items for this example):
Item A
Item B
Item C

If Item A is over the limit, B & C are marked at out of stock. If you go over on item B, it marks B & C out of stock. But if just C is out of stock, then only C is marked. Basically from the item that is actually over or out, anything under it gets marked (even though they may not be).

26 Jan 2011, 12:56 AM
#1020
chrisd24 avatar

chrisd24

New Zenner

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

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

ChrisD24:

I have been messing with this for some time and the problem I am having, besides my previous post is that if I have 2 or more items in my cart and the last product is over the limit or out it marks it correctly, but where it gets tricky is:

Cart (3 items for this example):
Item A
Item B
Item C

If Item A is over the limit, B & C are marked at out of stock. If you go over on item B, it marks B & C out of stock. But if just C is out of stock, then only C is marked. Basically from the item that is actually over or out, anything under it gets marked (even though they may not be).

Fixed: http://www.zen-cart.com/forum/showpost.php?p=977385&postcount=1001

I put the $flagStockCheck = NULL; after instead of before. :frusty: