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

Results 1,281 to 1,300 of 3,609
30 Aug 2011, 10:14
#1281
cheekycockney avatar

cheekycockney

Zen Follower

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

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

Right, I've gone back a a few steps and reverted a few files back to their original versions. I've also included a couple of the edits from this thread to fix the two problems:
'out of stock items in the cart causing everything to be flagged out of stock' and also
'if not logged in the checkout button prompts to log in instead of looping back when items are out of stock'.

This leaves me pretty much where I started with just the one problem: my 'out of stock' attributed items are able to be checked out using the PayPal Quickpay button. The normal CHECKOUT button correctly loops back to the cart with an Out Of Stock message.

One thing I have learned through my recent problems that is still the case: if I increase amount of the out of stock item in the cart to more than the total stock of all attributes added together, it loops back correctly. So i believe it's testing the total stock level for the product, not the attribute stock level.

This edit suggested on page 70 of this thread still doesn't fix this problem for me.


Similar patch for making Pay Pal Express not allow checkout with not enough stock according to SBA.

Edit ipn_main_handler.php and find:

Code:
require('includes/application_top.php');

Just below that, add the following code:

Code:

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

unset($attributes);
if(is_array($products[$i]['attributes'])){
$attributes = $products[$i]['attributes'];
} else {
$attributes = '';
}

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

This will not make the yellow button un-active, but will send the customer back to the shopping cart so they can change the cart contents so no out of stock items.

31 Aug 2011, 06:59
#1282
icebeer avatar

icebeer

New Zenner

Join Date:
Feb 2011
Posts:
7
Plugin Contributions:
0

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

My zencart is 1.3.8 I stalled the Add ON Stock by Attributes ,it works fine , but right now the SAVE Button doesn't work. I have to change Quantity for all variants one by one , not like before I can changed it in bulk.

I changed nothing, just few days ago it doesn't work.

Anyone can help me?
Thanks lot!

31 Aug 2011, 19:45
#1283
webstar59 avatar

webstar59

New Zenner

Join Date:
Jun 2011
Location:
California
Posts:
63
Plugin Contributions:
0

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

webstar59:

I see alot of users are having problems with this addon. I want to know if its setup right will it work without bugs? Sometimes things don't work because the user did not setup the application right. I would like to use this addon but I want to make sure it won't crash my store. I wish zen-cart allready had this option

Well this mod is finely working After allot of tweaking and mods.

Even if the user installs it correct it will not work right.

So be prepared to do some scripting if you want to use Stock by attributes. The author says they are not adding any new features to this mod but to bad they couldn't at least fix it before publishing as it wouldn't be to hard to do by the person that designed it. Maybe some of the zen gurus of the community should form a zen team and build a new zen-cart that has everything to sell products in today’s time.

I was surprised to see there is only 4 people on the zen team.

31 Aug 2011, 22:19
#1284
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

webstar59:

The author says they are not adding any new features to this mod but to bad they couldn't at least fix it before publishing as it wouldn't be to hard to do by the person that designed it.If you're referring to us, then you need to check your facts.

The last version that we released (4.7) worked perfectly. It was extensively tested before release and we did over two dozen hands-on investigations of bug reports post-release (i.e. going onto people's servers and checking the problem) and in every single case, the cause was one or other of two specific installation issues (about which we've posted several times - i.e. not overwriting files properly or leaving backs of the class files).

We stopped supporting it when other people started releasing variants that incorporated their pet ideas without proper testing, leading to bugs and missing files, and it seems to have continued downhill since.

We were very happy to support our own professionally written and tested code, but cleaning up other people's messes? No.

We have a completely re-written version that we use on clients' sites, but it's exactly this sort of ill-informed comment quoted that dissuades us from incurring the time and expense of packaging it up for release to the general community.

31 Aug 2011, 23:28
#1285
webstar59 avatar

webstar59

New Zenner

Join Date:
Jun 2011
Location:
California
Posts:
63
Plugin Contributions:
0

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

kuroi:

If you're referring to us, then you need to check your facts.

The last version that we released (4.7) worked perfectly. It was extensively tested before release and we did over two dozen hands-on investigations of bug reports post-release (i.e. going onto people's servers and checking the problem) and in every single case, the cause was one or other of two specific installation issues (about which we've posted several times - i.e. not overwriting files properly or leaving backs of the class files).

We stopped supporting it when other people started releasing variants that incorporated their pet ideas without proper testing, leading to bugs and missing files, and it seems to have continued downhill since.

We were very happy to support our own professionally written and tested code, but cleaning up other people's messes? No.

We have a completely re-written version that we use on clients' sites, but it's exactly this sort of ill-informed comment quoted that dissuades us from incurring the time and expense of packaging it up for release to the general community.

The release I installed was from here http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=310

I think this was your last release. Some changes had to be made to zen-cart to make it work. None of the Stock By Attribute scripts had to be changed. As stock by attributes is a good addition it didn't run out of the box for me

02 Sep 2011, 21:51
#1286
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

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

Maybe I've got something funky with my site only (keeping in mind I haven't added the fixes mentioned in the last couple pages) but today I stumbled across the following error.

If I have an attribute listed with a stock level of 100, the site will only recognize it as 1 available, yet it won't throw an out of stock message on the shopping cart page. If I change the in stock quantity to 101 it works.

-lindasdd

02 Sep 2011, 21:59
#1287
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

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

lindasdd:

Maybe I've got something funky with my site only (keeping in mind I haven't added the fixes mentioned in the last couple pages) but today I stumbled across the following error.

If I have an attribute listed with a stock level of 100, the site will only recognize it as 1 available, yet it won't throw an out of stock message on the shopping cart page. If I change the in stock quantity to 101 it works.

-lindasdd

Turns out it was some sort of data integrity issue. Once I went back to 100 it worked. Probably related to me playing with Easy Populate.

-lindasdd

03 Sep 2011, 14:21
#1288
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

Thanks Kuroi for monitoring this thread even though bad changes were made after the mod was offered.

The insult I've had has been from the last one to upload the most resent version. They posted a thank you for someone giving them a heads up for the problem with it...then bashed me for trying to give them a heads up that it still didn't work and I'd help them test it until they did.

I'm mystified...

but I don't know what we would do without this at least, cobbled together version we are using. Thanks for the original efforts that have made it possible.

04 Sep 2011, 21:36
#1289
wiccanwitch420 avatar

wiccanwitch420

Zen Follower

Join Date:
Nov 2008
Posts:
196
Plugin Contributions:
0

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

ut of stock Problem after upgrading the 1.3.9H
I had v 1.3.8 a and recently paid to get upgraded to v 1.3.9H and I had the module products with attributes stock which should also have been upgraded.

So for instance there is an item that has 2 sizes. There are 2 total in stock. The sizes they can choose from are:
1X (There are 2 left)
2X (There are none left but its still an option)

The 2X happens to be out of stock. When you just put a 1x in your cart everything is fine, cause there is a 1x.

But if before you do anything, you try and put a 2X in your cart it will let you put it in your cart but say

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

Which would be fine, BUT after that happens, if they try and go back to the item keeping that out of stock one in their cart and try to add the 1x, it errors and says that the 1x is out of stock too, NOT just the 2x .

Also you can go on the site and add other products that dont even have attributes are are totally in stowck, and it says that they are out of stock! AH

Help! What happened. Here is the item in question if you want to see what Im talking about, but this happens with all items too.

http://www.mysticcrypt.com/dark-star...za-p-1412.html

Also please. I would like to know if there is a way to show these boxes differently. Like to show on the drop box

1X
2X- Out of Stock

To show which ones are in and out of stock when they try to make the purchase,.

So for items that have as such it might be like this
1X
2X Out of stock
3X
4X
5X Out of stock

In stead of it showing
1X
2X
3X
4X
5X

So the customer doesnt know which ones are really out of stock when using the products with attributes stock

The Zen gal is trying to fix it but now also once you put the item in your cart and look at your shopping cart and then you click on the item, instead of it going to the product page it goes to http://www.mysticcrypt.com/product_info which there is no such file. It redirects to this instead of the product page it should be redirecting to. This only happens with items with attributes stock. =( Please help this is a very big problem

if we turn off the seo urls then it will redirect to the right page

so basically the initial problem is there and the ultimate seo urls we turned off for now, someone please help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

04 Sep 2011, 22:19
#1290
wiccanwitch420 avatar

wiccanwitch420

Zen Follower

Join Date:
Nov 2008
Posts:
196
Plugin Contributions:
0

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

Also, I just noticed that on the regular stock items that dont have attributes that it will let you add more than available to your cart and will not let you check out but it will not give you the normal message of
I found another problem. With regular products when you put them in the cart, you can put more in the cart than it tells you are available, It will not let you check out, but it will not give you the message of

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

These are for the products that dont have the attributes. =( '

So the customer could potentially put 2 items in their cart, when there are only 1 left and instead of the cart telling them that they Products marked with *** are out of stock or there are not enough in stock to fill your order.
Please change the quantity of products marked with (***). Thank you

It will not say anything.

05 Sep 2011, 16:40
#1291
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

I had this same issue, WiccanWitch, as have most here, with this mod when I upgraded from 1.3.8a to 1.3.9h because this mod is flawed.

The fix was not perfect but simple and is explained in earlier posts. I don't know about the "seo urls" problem.

Here is the fix for Stock By Attributes - replace includes/modules/pages/shopping_cart/header_php.php with the one below from an earlier version of stock by attributes, namely stock_by_attributes_4-7MULTIADD. :

<?php
/**
 * shopping_cart header_php.php
 *
 * @package page
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header_php.php 0000 2007-12-02 00:00:00Z kuroi $
 */

// This should be first line of the script:
$zco_notifier->notify('NOTIFY_HEADER_START_SHOPPING_CART');

require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);

// Validate Cart for checkout
$_SESSION['valid_to_checkout'] = true;
$_SESSION['cart_errors'] = '';
$_SESSION['cart']->get_products(true);

if (!$_SESSION['valid_to_checkout']) {
  $messageStack->add('shopping_cart', ERROR_CART_UPDATE . $_SESSION['cart_errors'] , 'caution');
}

// build shipping with Tare included
$shipping_weight = $_SESSION['cart']->show_weight();
/*
  $shipping_weight = 0;
  require(DIR_WS_CLASSES . 'order.php');
  $order = new order;
  require_once('includes/classes/http_client.php'); // shipping in basket
  $total_weight = $_SESSION['cart']->show_weight();
  $total_count = $_SESSION['cart']->count_contents();
  require(DIR_WS_CLASSES . 'shipping.php');
  $shipping_modules = new shipping;
  $quotes = $shipping_modules->quote();
*/
$totalsDisplay = '';
switch (true) {
  case (SHOW_TOTALS_IN_CART == '1'):
  $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
  break;
  case (SHOW_TOTALS_IN_CART == '2'):
  $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($shipping_weight > 0 ? TEXT_TOTAL_WEIGHT . $shipping_weight . TEXT_PRODUCT_WEIGHT_UNIT : '') . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
  break;
  case (SHOW_TOTALS_IN_CART == '3'):
  $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
  break;
}

// testing/debugging
//  require(DIR_WS_MODULES . 'debug_blocks/shopping_cart_contents.php');

$flagHasCartContents = ($_SESSION['cart']->count_contents() > 0);
$cartShowTotal = $currencies->format($_SESSION['cart']->show_total());

$flagAnyOutOfStock = false;
$products = $_SESSION['cart']->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  if (($i/2) == floor($i/2)) {
    $rowClass="rowEven";
  } else {
    $rowClass="rowOdd";
  }
  switch (true) {
    case (SHOW_SHOPPING_CART_DELETE == 1):
    $buttonDelete = true;
    $checkBoxDelete = false;
    break;
    case (SHOW_SHOPPING_CART_DELETE == 2):
    $buttonDelete = false;
    $checkBoxDelete = true;
    break;
    default:
    $buttonDelete = true;
    $checkBoxDelete = true;
    break;
    $cur_row++;
  } // end switch
  $attributeHiddenField = "";
  $attrArray = false;
  $productsName = $products[$i]['name'];

  if (STOCK_CHECK == 'true') {
    $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
    if ($flagStockCheck == true) {
      $flagAnyOutOfStock = true;
    }
	  $stockAvailable = zen_get_products_stock($products[$i]['id']);
  }

  // Push all attributes information in an array
  if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
    if (PRODUCTS_OPTIONS_SORT_ORDER=='0') {
      $options_order_by= ' ORDER BY LPAD(popt.products_options_sort_order,11,"0")';
    } else {
      $options_order_by= ' ORDER BY popt.products_options_name';
    }
    foreach ($products[$i]['attributes'] as $option => $value) {
      $attributes = "SELECT popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix
                     FROM " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
                     WHERE pa.products_id = :productsID
                     AND pa.options_id = :optionsID
                     AND pa.options_id = popt.products_options_id
                     AND pa.options_values_id = :optionsValuesID
                     AND pa.options_values_id = poval.products_options_values_id
                     AND popt.language_id = :languageID
                     AND poval.language_id = :languageID " . $options_order_by;

      $attributes = $db->bindVars($attributes, ':productsID', $products[$i]['id'], 'integer');
      $attributes = $db->bindVars($attributes, ':optionsID', $option, 'integer');
      $attributes = $db->bindVars($attributes, ':optionsValuesID', $value, 'integer');
      $attributes = $db->bindVars($attributes, ':languageID', $_SESSION['languages_id'], 'integer');
      $attributes_values = $db->Execute($attributes);
      //clr 030714 determine if attribute is a text attribute and assign to $attr_value temporarily
      if ($value == PRODUCTS_OPTIONS_VALUES_TEXT_ID) {
        $attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']',  $products[$i]['attributes_values'][$option]);
        $attr_value = $products[$i]['attributes_values'][$option];
      } else {
        $attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
        $attr_value = $attributes_values->fields['products_options_values_name'];
      }

      $attrArray[$option]['products_options_name'] = $attributes_values->fields['products_options_name'];
      $attrArray[$option]['options_values_id'] = $value;
      $attrArray[$option]['products_options_values_name'] = zen_output_string_protected($attr_value) ;
      $attrArray[$option]['options_values_price'] = $attributes_values->fields['options_values_price'];
      $attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix'];
    }

		if ( STOCK_CHECK == 'true' ) {

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

			// End change

			$stock_check = zen_check_stock($products[$i]['id'], $products[$i]['quantity'],$attributes);
	
			if (zen_not_null($stock_check))
			{
				$flagAnyOutOfStock = true;
				$flagStockCheck = $stock_check;
			  $stockAvailable = zen_get_products_stock($products[$i]['id'], $attributes);		
			}
		}
  } //end foreach [attributes]
  $linkProductsImage = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']);
  $linkProductsName = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']);
  $productsImage = (IMAGE_SHOPPING_CART_STATUS == 1 ? zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) : '');
  $show_products_quantity_max = zen_get_products_quantity_order_max($products[$i]['id']);
  $showFixedQuantity = (($show_products_quantity_max == 1 or zen_get_products_qty_box_status($products[$i]['id']) == 0) ? true : false);
//  $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('products_id[]', $products[$i]['id']) . zen_draw_hidden_field('cart_quantity[]', 1);
//  $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', 1);
  $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']);
  $showMinUnits = zen_get_products_quantity_min_units_display($products[$i]['id']);
  $quantityField = zen_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"');
  $buttonUpdate = ((SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) ? zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT) : '') . zen_draw_hidden_field('products_id[]', $products[$i]['id']);
  $productsPrice = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
  $productsPriceEach = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
  $productArray[$i] = array('attributeHiddenField'=>$attributeHiddenField,
                            'flagStockCheck'=>$flagStockCheck,
                            'flagShowFixedQuantity'=>$showFixedQuantity,
                            'linkProductsImage'=>$linkProductsImage,
                            'linkProductsName'=>$linkProductsName,
                            'stockAvailable'=>$stockAvailable,
                            'productsImage'=>$productsImage,
                            'productsName'=>$productsName,
                            'showFixedQuantity'=>$showFixedQuantity,
                            'showFixedQuantityAmount'=>$showFixedQuantityAmount,
                            'showMinUnits'=>$showMinUnits,
                            'quantityField'=>$quantityField,
                            'buttonUpdate'=>$buttonUpdate,
                            'productsPrice'=>$productsPrice,
                            'productsPriceEach'=>$productsPriceEach,
                            'rowClass'=>$rowClass,
                            'buttonDelete'=>$buttonDelete,
                            'checkBoxDelete'=>$checkBoxDelete,
                            'id'=>$products[$i]['id'],
                            'attributes'=>$attrArray);
} // end FOR loop


// This should be last line of the script:
$zco_notifier->notify('NOTIFY_HEADER_END_SHOPPING_CART');
?>

WiccanWitch420:

Also, I just noticed that on the regular stock items that dont have attributes that it will let you add more than available to your cart and will not let you check out but it will not give you the normal message of
I found another problem. With regular products when you put them in the cart, you can put more in the cart than it tells you are available, It will not let you check out, but it will not give you the message of

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

These are for the products that dont have the attributes. =( '

So the customer could potentially put 2 items in their cart, when there are only 1 left and instead of the cart telling them that they Products marked with *** are out of stock or there are not enough in stock to fill your order.
Please change the quantity of products marked with (***). Thank you

It will not say anything.

05 Sep 2011, 18:22
#1292
wiccanwitch420 avatar

wiccanwitch420

Zen Follower

Join Date:
Nov 2008
Posts:
196
Plugin Contributions:
0

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

Athena I could kiss you! That worked! Thank you Thank you Thank you!

We just have the one remaining problem with the ultimate seo urls where if we have them turned on and we put a product with attributes stock in the cart, When we click on the item when it is in the cart, instead of being directed to the actual product page when you click on the link it gets directed to this page http://www.mysticcrypt.com/product_info

And it says this on the page.

Not Found
The requested document was not found on this server.

Web Server at mysticcrypt.com

This is only happening when you put an item in your shopping cart that has a products with attributes stock, if you put an item in your shopping cart that does not have attributes, then it will let you click on the item in your cart and you will be directed to the correct page of the product.

12 Sep 2011, 22:53
#1293
cazzab avatar

cazzab

New Zenner

Join Date:
Sep 2011
Posts:
2
Plugin Contributions:
0

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

I'm using ZC v1.3.9 and the latest 1.4.13 version of Stock by Attribute. I have gone thru almost every post in this and other threads and can't find a solution so hoping someone can please help.

The only, but significant, problem is that products with variant attributes always appear as out of stock in the shopping cart (available: 0 and the error message to reduce quantity) regardless of the stock quantity I have added to the variant in the Products with Attributes Stock page that comes with the add-on. I created a test product with only one variable attribute and set-up the stock quantities and all was fine until I added some other non-selectable text attributes (country of origin, materials used etc) which I use for all the other products, and then the error occured as before. I deleted the text attributes and that didn't fix the problem but when I deleted and reinstalled the first stock based attribute and reset the stock it worked again. I can't do this for all the products but just thought it was weird that other text attributes for the product had that impact.

I have installed, backed out and reinstalled, and rechecked that files are in the correct locations, deleted backups and replaced the header_php.php file as suggested by Athena in older posts. Thanks for the tip! But still have the same problem.

Products without attributes behave correctly now - I previously had a similar problem to many others, in that I was able to put more in the cart than I had in stock. But that is now resolved since replacing the header_php.php file in includes/modules/pages/shopping_cart.

I have no other add-ons and this is a clean install with no upgrades.

Any help would be really appreciated.

13 Sep 2011, 14:03
#1294
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

My ignorance will show here as I"ve been trying to duplicate your problem in my test store.

I wonder if you can give me a bullet list of a procedure for what you did to insert a ```
"non-selectable text attributes (country of origin, materials used etc) which I use for all the other products"


If I understand, you added an OPTION NAME: text

What is the option value?
13 Sep 2011, 22:20
#1295
cazzab avatar

cazzab

New Zenner

Join Date:
Sep 2011
Posts:
2
Plugin Contributions:
0

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

Hi Athena

Thanks for offering to help with this.

For each product I usually have 4 attributes - one is colour using radio buttons which is what we are basing the stock quantity on. The others are just set-up in the same way via the Option Name Manager/Option Value Manager with an Option Type of Read-only, for example:

Name - Size Details / Value - 30 cm

Name - Materials Used / Value - Cotton & Thread

Name - Country of Origin / Value - Morocco (with an image)

I usually set-up the values in advance and just select the ones I need from the Option Name/Values list as I create each product. They are just to provide info for the customer so they just need to be displayed as text.

For the test product I just used the Colour attribute and just added the required info to the description instead and that seems to be ok.

Test product is here - http://www.craftsoftheworldonline.com/index.php?main_page=product_info&cPath=3_5_28&products_id=105

Stock amounts are:
Fuchsia x 3
Orange x 2
Azure 1

Example of product that uses attributes as described above but isn't working - http://www.craftsoftheworldonline.com/index.php?main_page=product_info&products_id=45:c55383ef9abf72f1e2910f80771f16a0

Stock is 2 per colour but when added to cart shows as Stock Available: 0.

Any ideas? Thanks in advance!

14 Sep 2011, 14:39
#1296
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

Hi CassaB
Happy to help.
I've duplicated your process - it works in my test cart - and have played around with the cart on your site and it seems to be just fine. I agree, keeping the option type read-only is more attractive and appropriate for those attributes.

The second link you provided that you said keeps defaulting to "0" with the radio buttons preselected is showing stock quantities adjusting as I change them in the shopping cart. Did you solve the issue or am I missing something. Let me know.

15 Sep 2011, 14:21
#1297
xsell avatar

xsell

New Zenner

Join Date:
Aug 2011
Posts:
1
Plugin Contributions:
0

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

Can somebody please help me with stock by attributes add on? I am usin zc 1.3.9 and I have downloaded and installed the stock by attributes add on as per the instructions to the root directory of my website.
I renamed the files to match my template where necessary
(includes/templates/YOUR_TEMPLATE.) There were no such files to rename in the modules folder despite what the instructions stated, am I missing something here?

I also installed the SQL patches and they seem to have installed correctly but when I go to my ZC admin there is no stock by attributes option in the CATALOGUE> dropdown menu.

I cant figure out what i am doing wrong and the more I try to figure it out the more confused I get.
Can anybody help?

Thanks in advance

15 Sep 2011, 14:36
#1298
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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


Did you upload the admin folder?


ALSO there should be the following files in includes/modules - if not check over the original downloaded mod files for them:

pages/checkout_shipping/header_php.php

pages/checkout_shopping_cart/header_php.php


This mod is flawed and we here have been struggling with it.

An imperfect but working fix is to substitute as instructed in post #1293

22 Sep 2011, 05:56
#1299
carolinebogart avatar

carolinebogart

New Zenner

Join Date:
Apr 2007
Location:
Manchester, NH
Posts:
52
Plugin Contributions:
0

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

I hope this helps the people on this thread.

The store I'm debugging has both items priced by stock attributes and items not priced by stock attributes.

For items not priced by attributes, if the customer asked for a quantity greater than that in stock, but the "out of stock" message did not display.

In priced by attributes version 1.4.13, in
includes/modules/pages/shopping_cart/header_php.php,
the code to check for "out of stock" on items not priced by attributes is commented out.

Uncomment these lines at about line 146:
if (STOCK_CHECK == 'true') {
$flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
if ($flagStockCheck == true) {
$flagAnyOutOfStock = true;
}
}

22 Sep 2011, 13:43
#1300
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

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

Can it really be that simple?....I'll run some test on that...thank you so much.