I really would like some help with this too, as we have similar issue that we want to exclude certain attributes from the stock combination.
Printable View
Hello liana,i check your site you did fix this problem and site work on SBA. I am install same with you, and i check you posted header.php code same to mine. Can you please let me know how to fix this issue? Thank you advance! if have some one can help this out, Please! please!! Please!!!
I am also very frustrated by this! Please post the fix if somebody has it. The older non-ajax version worked perfectly for me.
It seems the only way to fix this is to "sync quantities" when you update stock, or is there something else I'm missing?!
First of all: thanks for the add-on!
After trying and searching for many hours, I still haven't found out the following:
Only one attribute is used, which is the size. However, we should add all different variants by hand. Is there a way to do this automatically? (default stock is 0)
We would need this because of the fact that if there's no variant specified, stock won't be decreased correctly.
Is there something I haven't realised/seen?
Many thanks in advance.
Keep up the good work!:clap:
I would like to know too. I tried to follow it through the thread but I am a little lost what the final solution was and which files etc. If someone could put the final solution with the actual files to edit that would make it super easier for everyone.
As not showing the actual stock level for the attribute at the shopping cart for the product and attribute that is low in stock is very frustrating and I would like to know the solution so I can stop getting emails from our customers - thanks!
Ideally it would be great to show the stock levels in the product page but I understand this is an issue due to combination issues - an ajax would make this available I would think!
hello all
I've got a problem whereby the stock is not subtracted from the attribute - but is subtracted from the main products stock level. I'm using 1.3.9h and PWAS 4.7 Ajax.
The shop has a colour attributeand a size attribute. I've tested products that have two attributes and products that have one and and neither deducts stock from the attribute - only the main products record.
Can someone steer me in the right direction? Or is the solution is to move to the v5.0 Beta of this.
Thanks, Andy
well - would you believe it - the PWAS 4.7 Ajax package doesn't include the classes directory or the orders.php class file... so I'll find that from an older version and just hope it works....
Yep - that was the problem... this mod should take minutes to install but has cost me hours!
Ok, So I have installed the Stock by attribute on my site 2 times now and had to remove it 2 times. What the Heck!!!
So here is whats going on.
I have zen 139h, a simple template I bought from Template Warehouse a canned one that is sold all over, nothing special, I changed up the background and a few other things but nothing special.
So here is my problem
Lets say I have 2 products, 1 with attribute small, medium and large, and another product that has no attribute. the product without the attribute has 3 instock and the one with attribute has 2 of each size instock. I think I have it all setup correctly but here is what happens. I add the product WITHOUT the attribute to the cart and update it to 4, it never flashes red *** and lets me check out and the 4th item is backorded. Now if I add a small item from the one with the attribute then add 4 of the product without the atribute it shows the out of stock warning. I delete the one with the attribute and the warning goes away on the one without.
So do I have to assign attributes to every item even if there is only one type or is there a fix to this. I have spend about 10 hours trying to get a clear answer to fix my problem.
Thanks
I've just upgraded my site from 1.3.7 to 1.3.9h and this add-in from 1.4.6 to 1.4.12 and received the following error when I click on the link for stock by attributes under catalog. [select * from products_with_attributes_stock where products_id="66" order by sort ASC;] 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. I followed the upgreade instructions which stated that I need only replace the files, not make any database upgreades. What do I need to do? Thanks
Please ignore my last message. It appears the upgrade instructions didn't include the information about the database upgrade. I have applied the sql patch and things appear to be working correctly.
In the Readme, it asks me to find a folder in Includes/Modules called YOUR_TEMPLATE. This folder is not in the .zip file in any of the versions I have tried on this page:
http://www.zen-cart.com/index.php?ma...roducts_id=310
I have installed it all, barring that step, according to the directions and the "Products with Attributes Stock" never appears in the "Catalog" menu, nor on the page of links if I click it.
I believe the folder in Modules is supposed to be there and adds the functionality to the admin panel.
Any reason why I can't seem to locate this folder that is supposed to belong?
I think the "YOUR_TEMPLATE" file was a way to add the quantity on the products page, so a customer could see how many items were available at the attribute level. Somewhere in the 112 pages of this thread, there was the code to do this. It only works with a few options, like radio button attributes, and will not work for some others, like drop down attribute style - (i think) - I'm not sure that the specified file in "YOUR_TEMPLATE" ever really existed in an actual contribution. I think I recall it just being hacked code added to this (or some other) thread.
I see. It is in the README as part of the instructions.
I have ran the SQL script and confirmed that the table was created, as well as the other fields modified. I have uploaded the Includes folder to the main directory of my ZC installation where the original Includes folder resides.
I uploaded both the Admin and AJAX folders to the main directory of my site as well. Do these need to go somewhere else?
I am not getting the menu option 'Products with Attributes Stock' in the 'Catalog' menu after the installation.
I'm running 1.3.9h, btw.
Nevermind, got it! Thanks for the help :)
I have just installed the stock by attribute addon and am now having issues when I go to the checkout from the shopping cart screen.
It is throwing the following error:-
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred. Detailed Error Information
Module IsapiModule
Notification ExecuteRequestHandler
Handler Plesk_Handler_0-571690839
Error Code 0x00000000
Requested URL http://meyersmanx.com.au:80/ManxShop...ckout_shipping
Physical Path d:\inetpub\vhosts\meyersmanx.com.au\httpdocs\ManxShop\index.php
Logon Method Anonymous
Logon User Anonymous
I have identifed that this happens when I copy the header_php.php file into /includes/modules/pages/checkout_shipping directory. If I reinstate the original file, the check out works fine.
I am running Zencart 1.3.9h
Am I missing something?
If someone selects an item that is out of stock and clicks the add to cart button, is it possible to keep the buyer on the product page with an alert showing their selection is out of stock instead of having to go to the shopping cart page and then back to the product page to revise their selection?
we are using zen cart v1.3.9ep1
in admin/Catalog
on the Products with Attributes Stock page, when we click save we get this error
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: http://www.foxvalleybirkenstock.com/ajax/jquery.js:11
we get this using IE adn firefox
[FONT=Calibri]Oddly enough this mod seems to work without error in the safari web browser
But it is extremely slow[/FONT]
[FONT=Calibri]I think part of the problem is the number of items it is showing the page[/FONT]
[FONT=Calibri]One site has 6859 items and the other has 2276 items[/FONT]
[FONT=Calibri]The one with 2276 is noticeably faster, but still a little slow[/FONT]
[FONT=Calibri]Would there be a way to limit the items displayed, “say by clearance items” [/FONT]
Same issue solved when I ran the sql statment in the package that modifies the products_attribute_stock table in db. This was in the mod package with no explaination. Just went for it and it worked..but the mod still screws up my checkout proceedure. In my stock_by_attributes mod it is called update_1_410.sql
OK Chris....that did work but took it from the MULTIADD mod from 2007 that we had running...
Just replaced the /includes/modules/pages/shopping_cart/header_php.php in the AJAX version, with the one from stock by attributes MULTIADD.
The issue with creating the table modifications put everything that did not have attributes to zero.
Some warnings should be included in the mod instructions. This was a nightmare.
Hi guys,
I'm having an issue with my Zen Cart and Stock by Attributes module. First, here are the versions I have:
Zen Cart v1.3.9h
Stock by Attributes Version: 1.4.12
The stock by attributes seems to work correctly until I present it with a certain situation. For example, I have product "A" with a couple of attributes:
Sizes: x-small, medium, large etc..
Design: name1, name2, etc..
I only have in stock:
30 "A"s in x-small design 1
6 "A"s in medium design 1
Now anytime I have both of these products in my shopping cart and the FIRST one in the list is over the stock limit, it causes all of the rest of the products to show out of stock, even if the second item is not out of stock.
Shopping cart example #1 (works like it should):
30 "A"s in x-small design 1
6 "A"s in medium design 1
Shopping cart example #2 (fails):
31 "A"s in x-small design 1 [OUT OF STOCK]
3 "A"s in medium design 1 [OUT OF STOCK]
Shopping cart example #3 (fails):
7 "A"s in medium design 1 [OUT OF STOCK]
30 "A"s in x-small design 1 [OUT OF STOCK]
Shopping cart example #4 (Correct):
6 "A"s in medium design 1
33 "A"s in x-small design 1 [OUT OF STOCK]
Anyone have an idea how to fix this problem? Or if this is an inherent flaw, where should I look to change the "Out of Stock" shopping cart code?
Thanks in advance. Please let me know if you need additional information.
-Ryan
I changed all the "Out of Stock" text in my cart by running a case sensitive search being careful to choose the display text incidents of the phrase to "More on Order".
BTW - In case anyone is looking for this file, I fixed many problems, as Chris suggested above, by replacing my 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.
No other modification needed. I'm running 1.3.9h upgrading from 1.3.8a
Code:<?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');
?>
If you are running 1.3.9h and have upgraded to Stock By Attributes 4.1.12:
Please update includes/modules/pages/shopping_cart/header_php.php with the copy from Stock By Attributes 1.4.13
Thanks to Stephen Hewitson for reporting this issue.
I replaced my file with your new version but still have an issue with the product with attributes affecting the stock tally in the product without in the shopping cart.
Worked a lot on this last night trying to see what consequences were of the page as many here have solved the problem in different ways. My shopping cart works best without these issues if I keep the header_php.php file from the MULTIADD mod as in my post above.
Any suggestions, as I'd like to use the newest files in my 1.3.9h cart. thanks.
I am having the same exact problem. When the FIRST one in the list is over the stock limit, it causes all of the rest of the products to show out of stock, even if the second item is not out of stock.
I been working on fixing and reinstalling for 2 weeks to no avail. Anyone know how to fix this?
the fix in my post above works for me.
let me know if it doesn't work for you. I have fudged with this issue for several weeks as well and keep going back to the old header_php.php file in order to keep my store running. We've had no problems with it...but i would just like a modern solution for my new 1.3.9h install.
Stock by Attributes v1_4_10 Zen 138a stock not subtracting --------------------------------------------------------------------------------
Installed the above version of Stock by Attributes but the stock is not subtracting (appropriate admin switch set true)
Searching the threads for hours - please can anyone point me in the right direction
thanks
Derek
I'm in the same boat as you so am asking...
Did you install the new mod for 1.3.9h or did you install the header_php.php file from my post which comes with an earlier mod?
I downloaded v1_4_10 and uploaded (after installing the SQl file) the files without any modification
Derek
There is a very current version for 1.3.9h
an ongoing issue is that the file in includes/modules/pages/shopping_cart/header_php.php is faulty....still
everyone here has tried a variety of fixes. the one that worked for me and has my store up and running with no issues is a clean install of the newest Stock by Attributes which is version 1.4.13 only subsititute this problem file in includes/modules/pages/shopping cart/ with a header from an earlier version, namely the one I put in code quotations above.
Thanks Athena
Do I have to uninstall the mod or can I just overwrite the files?
Do I have to run the SQL script again?
Where do I find:
/includes/modules/pages/shopping_cart/header_php.php in the AJAX version, with the one from stock by attributes MULTIADD
all the best
Derek
I notice :
Product 189/226
Stock by Attributes
Download Now!
File size: 123897 bytes
Downloaded: 25202 times Zen Cart™ Version: v1.3.9
Version: 1.1.13
Last Updated: Apr 06 2011
Author: That Software Guy
PHP 5.3 Compatible?: Yes
--------------------------------------------------------------------------------
This add-on allows a store owner to set a stock value for each variant of a product. For example, if you have three sizes, large, medium and small, this module will allow you to keep track of all the different quantities. It will work for a virtually unlimited number of amount of attribute combinations. For example, if you offered cotton or polyester shirts in green, red or blue and small medium or large sizes, this add-on would allow you to enter and maintain a separate stock level for each of the 18 possible combinations.
This version is unlikely to work in versions of Zen Cart prior to 1.3.5. If you are running Zen Cart 1.2.5-1.2.7d, please use the "products_with_attributes_stock" add-on by dafonz. If you are using versions 1.3.0 - 1.3.0.2 please use "Stock Attributes by danielcor".
--------------------------------------------------------------------------------
Fix for includes/modules/pages/shopping_cart/header_php.php
Author: That Software Guy
Version: 1.1.13
Zen Cart™ Version: v1.3.9
Update added on Apr 06 2011
is this the one to use?
I'm not a moderator here but this is what worked for me:
Yes, You can over write the files.
for the version you installed i don't think you need to run any additional sql statments
here is the one from the "stock_by_attributes_4-7MULTIADD"
just replace the code in shopping_cart/header_php.php with this:
Code:<?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');
many thanks Athena - that seems to have done the trick!!
Derek
Hi Athena,
I couldn't tell if you were responding to my post in:
http://www.zen-cart.com/forum/showpo...postcount=1132
Can you tell if in your version that it fixes this issue?
Thanks!
Yes, I think my fix will work for you.
It is just this one file that software guy said was fixed in the newest mod for stock by attributes, but it still didn't work for me and i have a fresh install of 1.3.9h with the .13 stock by attributes mod.
I am not code savvy enough to understand why the shopping_cart/header_php.php page above from the older vesion works...i'd rather the .13 mod be fixed...but it does work to replace that one file with the code in my post above.
Can anyone tell me why my sort order for stock_id in products_with_attributes_stock.php is reversed? The higher stock ID's are displayed in descending order... even though it should be in ascending order I would think.
Some customers are getting the message 'Whoops! Sorry, but you are not allowed to perform the action requested'
and are therefore not able to complete the checkout procedure - please can anyone help
Derek
do a search of this thread for that statement and research those posts...i don't know the answer but it should be there.... search "Whoops! Sorry" in quotes
Hi Athena - tried that with no success - found another thread that may help:
http://www.zen-cart.com/forum/showthread.php?t=177094
Derek
I am running 1.39h and the latest release of SBA.
I now cannot get ZC to accept an attribute on a new product. I choose the Option Value and Name and hit Insert and it just throws me back to the admin index page but doesn't record anything.
I tried adding a new attribute to an existing product that has a range of attributes under Size and it does the same.
Any thoughts? I have a new product launching on Saturday and want to be able to enter stock.
Thanks in advance.
I just went in and did the same and I noticed that the page was just needing time to refresh.
You asked for any thoughts...it worked, but could be just be the server is not keeping up.
I went back and repeated the process and found the new attribute only showed when I added a quantity for it.
the old attribute with 0 shows as it always has, but is not updating the quantity from products_with_attributes_stock.php even though a little box comes alive when clicked in to do so.
Updating the quantity of the newly set up attribute by clicking "add quantity for product variet" revealed the new attribute in the drop down..
Athena,
I can't even list an attribute in the new product that I have added so it doesn't show up in the SBA screen.
I upgraded from a release of SBA that I downloaded last May (not sure which release) and ran the update 1_4_10 sql when I did that. I transferred each file individually to the respective folder to be sure I got it correct.
So my issue lies in ZC perhaps rather than your addon? I tried changing values of stock in hand in SBA and that worked.
If I can't find a fix today I will have to revisit it next week as I have a trade show this weekend. I may just uninstall and reinstall SBA first then if the problem is not resolved then reinstall ZC 1.39h.
If I misunderstood something in your post do let me know.
Gotta go pick up the new t-shirts so back later :clap:
There is a new download for SBA and if you just installed 1.3.9h like I did grab that one.
I would leave the sql alone since you ran that already and just upload those SBA files comparing the few edits that are required for core files.
I'm not really sure why replacing the file as I've posted here in my earlier posts work, namely: /includes/modules/pages/shopping_cart/header_php.php with the one in my post above; but it was essential to getting the product quantities to play nice in the shopping cart for myself and some others.
good luck with your show!
RESOLVED:
Forgot to reset the configure.php files in ZC to 777 after upgrade :oops:
Hopefully my idiocy will benefit someone else :yes:
Thanks for the assistance, Athena.
update - I've uninstalled the stock by attributes module and the "Whoops etc." message has disappeared
Athena,
Thanks for the fix. I have 1.3.9h and did a first-time install of the latest SBA module and kept getting a blank page when putting something in the shopping cart. Changing the header_php.php file as you suggested solved this.
:clap:
I was also getting the "Whoops" message and so were the customers.
I checked the file:
- /includes/classes/shopping_cart.php
against the file included in 1.3.9h and found that I was using an older version. Replaced it with the new file and problem appears to be gone.
Haven't received any new orders or complaints yet, but will report back if I have any more issues.
Does anyone know why I occassionally have to press the "Sync product quantity" button next to the product? If I don't do this, my entered stock values are not being reflected on the front end... Is this something that's necessary with the ajax version? The previous versions did not require this to the best of my knowledge.
Is there a bug regarding the sort column in SBA 1-4-13? This is the only version of SBA I have tried but when I try to add stock on the "Products with Attributes Stock" page I get this error:
1364 Field 'sort' doesn't have a default value
in:
[insert into `jfaz_products_with_attributes_stock` (`products_id`,`stock_attributes`,`quantity`) values (68,"1",6) ON DUPLICATE KEY UPDATE `stock_attributes` = "1", `quantity` = 6]
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.
Looking at the code I see the sort column is in fact defined as "NOT NULL" by the stock_attribute.sql file in the download. However, the insert statements in the file admin/products_with_attributes_stock.php do not populate the "sort" column. As a test, I altered the *products_with_attributes_stock.sort column to have a default of 0. This fixed the error but of course every record has "0" in this column which probably defeats whatever purpose this column has.
Does anyone know what the "sort" column is used for and why the table definition doesn't match the insert statements?
thanks
After installing Stock by Attributes 1.4.13, the shipping addresses (all 3 in the customer orders in admin) disappeared. In the place of them, there is only a comma! Since orders.php has been edited for this module, there may be some bug in it. Has anyone else noted this?
Elli
OK so apparently i am not installing this mod correctly. I followed the instructions, but it does not stat where to put the ajax folder files at. I figured it was just into the main area, but apparently not.
I am using 1.3.9h and followed everything to the letter. I did have to add a /* - */ between line 3007 - 3020, i had to do this so the admin area would show back up.
I am selling a bunch of shirts, and it is a pain in the rear to keep track of and this would help a ton.
Does this mod generate any type of report that can be printed or emailed?
Hi...I'm not an expert...but you are right, the ajax folder is placed in the the same folder as your admin.
When the mod shows a file structure with "admin" it means the file you renamed for your own admin.
So:
admin (aka "your admin folder")
ajax
includes
means they should look just like that in your directory.
I did this install with three issues that we corrected by starting over again...and again...but it works pretty flawlessly:
First issue: Lots of mods installed so BTW only had to make the one edit to orders.php required by the mod
Second issue: needed to run the extra sql statement as we were upgrading: update_1_4_10.sql
Third issue: the file /includes/modules/pages/shopping_cart/header_php.php in the newest version still wrecks havoc with the stock totals...has been updated but still has issues with things being added to the cart that do not have attributes after items that do have attributes, showing out of stock. see my post above for the file to replace for that.
Hi,
where is this file located? I can't seem to find it ...
products_with_attributes_stock.php
thanks
:oops:nvm found it im new at this haha
Did you experience also this:
"After installing Stock by Attributes 1.4.13, the shipping addresses (all 3 in the customer orders in admin) disappeared. In the place of them, there is only a comma! Since orders.php has been edited for this module, there may be some bug in it. Has anyone else noted this?"
Maybe it would be worth to try to take an original 1.39h file and make the modification manually for it. Something must be wrong with the package file.
Elli
This doesn't sound like anything that Stock By Attributes would do. It makes no attempt to edit the order at all.
It's interaction with it is simply to check if there's enough attribute stock to fulfil it, or whether it needs to warn that there isn't.
So if your order is getting corrupted, I think you need to look elsewhere.
I struggled with many of the mods being built with an earlier version of zencart...meaning orders.php from 1.3.9c not 1.3.9h...so yes, all edits should be done manually....some are just impossible with other mods, but SBA is a pretty simple edit.Quote:
Did you experience also this:
"After installing Stock by Attributes 1.4.13, the shipping addresses (all 3 in the customer orders in admin) disappeared. In the place of them, there is only a comma! Since orders.php has been edited for this module, there may be some bug in it. Has anyone else noted this?"
Maybe it would be worth to try to take an original 1.39h file and make the modification manually for it. Something must be wrong with the package file.
Elli
Hi everybody, am I the only one with this problem? It seems like a bug in SBA 1.4.13 where the INSERT statement leaves out the "SORT" column, yet the "SORT" column is defined as "NOT NULL" in the "PRODUCTS_WITH_ATTRIBUTES" table.
Please let me know if I'm all wet on this!
thanks
you are not the only one...it is a bug....there is a temporary fix in my posts, until they fix the mod, if you do a search in this thread for it.
Hi all-
I'm a relatively new ZenCart user and also Stock By Attributes. Everything was going smashingly with my 1.3.9h ZenCart and then I tried to install Stock By Attributes 1.4.13 (both current as of today). After messing with things for far longer then I care to admit, I was still getting various errors. After pouring through this thread and others, I attempted many fixes to no avail and was on the verge of giving up.
Long story short, I figured out my problem and I wanted to relay it here in case it helps anyone else.
Being the good programmer that I am, I renamed any file that the Stock By Attributes distribution was going to overwrite.
Those files:
admin/orders.php
admin/includes/functions/general.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 renamed them to ordersOLD.php, generalOLD.php, etc. Then, I did the install of the Stock By Attributes module.
Maybe that's a basic PHP error on my part, but that was the cause of all of my problems. And I think I experienced just about every problem with this mod! As soon as I deleted all of the old copies, everything worked fantastically. VERY FRUSTRATING! :censored:
But, at least I found the error. Perhaps it's basic PHP stuff with filename conventions, but I did not know that those names would cause confusion on the part of the webserver. It appeared to me that the server was reading the old file even though I renamed it. Perhaps it was a caching error of some sort, I'm not exactly sure. What I do know is that things IMMEDIATELY worked flawlessly once I blew away my backup copies. From here on out, I will keep my backups in an entirely different place!
:oops:
Too bad it took so long and so much pain to figure out. But maybe this will help someone else.
Cheers,
--ccq
That's exactly what would have been happening. It's been covered repeatedly earlier in the thread, but not for a while so worth repeating ... it's very bad practise to mix backups with live files. Your web server should have only the files you actually want to be executed.
Zen Cart loads some files by location not by name. For this mod that affects the classes, so they will be loaded, whether you intend it to be (live file) or not (backup).
Yes, keeping backups is a good idea, but keep them on your development machine or in your code repository, not on your live site.
(... and run a mile from FTP clients that automatically create a backup file for you)
Are you saying then that this mod works right out of the box, so to speak?
I've tried in vain to get attention of who modified the most recent version, .13 to no avail as there is still an issue for most of us here with stock for items in the cart showing zero when it is listed underneath an item with attributes.
The solution, albeit imperfect, is to keep the old /includes/modules/pages/shopping_cart/header_php.php
Can someone in the know set me straight on this because my impression is that this most recent version of .13 is flawed.
I continue to advise folks to do what I did while waiting for this version to undergo correction.
Alas, not one that I can answer. We (Kuroi) supported this mod to a professional standard for several years, but stopped about 3 years back when other people started hacking their pet features into it without proper testing. We've not used the publicly released versions since.
Well...thank you so much for the original...it has served us well.
I would be willing to help anyone with the know how to test and perfect this mod. Just let me know.
Athena-
From what I can tell, the answer is yes, the mod works right out of the box. I had put in your fix below at one point but then taken it back out. I just double checked my version of the header and it is the version from the SBA 1.4.13.
Now, as I mentioned, I put in a bunch of fixes and backed them out, and I'm fairly sure I am running "out of the box" but not totally certain.
I may try and do a ground up install of ZenCart and SBA and see what happens - if I have the time. If I do, I will report back with my results.
--ccq
One tell is to put several items in your cart that have attributes and one that does not and see how they behave when you change the quantities...do they add up?
As I said, my experience was the item without an attribute, when in the cart under an item with attributes that registered "0" automatically calculated "0" for the non attribute item even though they were in stock.
Ok, I decided to do a bare bones reinstall of ZenCart 1.3.9h and SBA 1.4.13. It went quickly and smoothly, and from what I can tell, everything works out of the box.
I tested a bunch of different carts, quantities, and scenarios, and they seemed to work totally as advertised. :smile:
Now for the bad news: Athena, I also specifically tested your scenario:
--Added quantity 1 of item A, size small (attrib)
--Added quantity 2 of item A, size med (attrib)
--Added quantity 4 of item B, no attrib
--Adjusted quantity of item A up high to some number which was not in stock
At that point, anything below the sold out item (item A in this case), whether or not it had an attribute, showed as sold out. So, it's a bug where the sold out cascades down the cart. I do believe it is independent of attributes. So, I concur with you that there's a bug in the current distro of SBA and I will go and try your fix.
HTH,
---Chris
And I just installed Athena's fix (using the older /includes/modules/pages/shopping_cart/header_php.php) and that seem to fix the scenario I tested above without any bad effects.
Cheers,
--Chris
Yeah! I'm not c-r-a-z-y!
But still would like it to work....now that you have that fix in....does everything work? I've noticed a problem with searching for a product to edit in the SBA window.
I am getting a similar problem to athena I think.
If I add a product to the cart with attributes it is out of stock regardless of the stock qty. (this is using zen 1.3.9h and version 1.4.13 of SBA)
I have tried an older version as athena described of the the includes/modules/pages/shopping_cart/header_php.php file. in this case the following occurs
If I have one product in the cart which is either in or out of stock all is fine the product is flag correctly in the cart . if I add a product in stock and the original product in the cart is in stock then all is well. But add an out of stock product to the cart and all products go out of stock in the cart.
Has this issue been solved for the latest version (apologies if I missed it but I could not see a fix in the thread)
Athena, what version did you go back to to get yours to work?
Thanks
Mikeyg
athena,
I found your code and have tried it. But this still does not work for me.
As soon as there is a product that goes in the cart which is out of stock all items are flag as out of stock even if they had been in the cart and flag as in stock correctly.
Some one must have this working correctly this seems such a fundimental requirement.
I have an issue where out of stock attributes do not show as out of stock until the checkout stage rather than appearing as OUT OF STOCK in the dropdown list on the product page.
I`ve spent most of last week going through the code to see where the issue was and whether it was actually coded to perform that way - the functionality (to add OUT OF STOCK to the attribute's drop down) appears to be there but just not working for me.
The product in question is 'Frill Scarf' and the attribute is 'Test Colour' (http://www.jessamy-designs.co.uk/sho...&products_id=3). Whilst the Product Quantity is set to '99' the Quantity In Stock (as set by the Catalog -> Products With Attribute Stock page) for the attribute is 0 so I would expect that OUT OF STOCK would be appended in the dropdown for that attribute?
Any help would be much appreciated...
I`m running ZC v1.3.9h with SBA v1.4.13 and my site is http://www.jessamy-designs.co.uk. My Configuration -> Stock settings are as follows: Check Stock Levels: True | Subtract Stock: False | Allow Checkout: False | Mark Product Out Of Stock: ***
It may be that you need to actually delete the original file off the server and then reload the new code. On our server I notice that there is a lag time. They explained that there are two connections to our site (in our case, but may also be with yours) and it takes time to propagate, much like DNS info does.
Substituting the version in my previous post with the file from .13 has worked for many here. Wish I knew why.
Thanks for posting. I'm hoping someone will take this on. I PM the person who uploaded the latest version and was scolded in a weird way. Won't go that route again.
I don't think it was designed to eliminate the choices of out of stock items. Someone here played with a fix that worked for them but I haven't tried it.
You need to at least replace the file mentioned above for stock levels to calculate properly.
The original newest edition of the mod is faulty without it.
The only problem I have now is in the admin. It is temperamental when doing a search to update a product quantity.
athena,
thank you for your reply. I am testing locally at the moment so I don't the issue was time lag, but I went back through to your previous post - either in this thread or another and copied the code again. It seems to be working for me now. I must admit I was going to post the link for others again but in coming back to it seem to have lost the exact thread/post. I will post it for others if I find it again.
I must admit I compared the files and can't work out why it does or does not work.
Just to pick up on your post quoting tombooth01 - I have been looking for the code to get it to show out of stock in the drop down(does not have to delete the option just flag it as out of stock) but I could not see that functionality.
Is it really there or do you no what has been suggested to make it work?
I have come up with a solution using the grid attribute mod but rather than have boxes I have replaced them with ticks and crosses. You still need the drop downs to select product to get it in the cart. I have seen a site that has this with boxes and you can select the tick and it puts it in the cart. - If anyone has that it would be good. or if anyone can show the stock in the drop down that would be good too.
Thanks again for you help.
Yes, the functionality appears to be there.
In trying to get this to work I spent some time going through the code and the functionality to specifically append the phrase 'OUT OF STOCK' to option names seems to exist in the _build_attributes_combinations() function within /shop/includes/classes/pad_base.php:
Code:if (!$is_out_of_stock | ($showoos == true)) {
switch ($markoos) {
case 'Left': $newtext=($is_out_of_stock ? TEXT_OUT_OF_STOCK.' - ' : '').substr($newtext,2);
break;
case 'Right': $newtext=substr($newtext,2).($is_out_of_stock ? ' - '.TEXT_OUT_OF_STOCK : '');
break;
default: $newtext=substr($newtext,2);
break;
}
After a week I gave up and decided to see if anyone on here had managed to get it to work.
It did appear to nearly work (i.e it appended OOS to the correct options in the $combinations array but it appears the actual dropdown is populated by the $attributes array) but I became stuck as I`m new to Zencart.
Here is a link to a post in a thread called only: "Stock By Attributes" rather than this thread called: "Stock by Attribute v4.0 for Zen Cart 1.3.5+"
I think some of us have gotten lost in there but this post is significant - I just haven't had time to try it yet:
location: Post by limelites
I had come across that previously in my investigations but when I tried to implement it made no difference. I`ve just tried it again and nothing changes.
Has no-one else had this issue (out of stock options appearing in the dropdown) with this addon (stock by attributes)?
I installed the stock by attribute mod, but for some reason it's not showing the attribute for people to pick there size Example:
I have a dress with the sizes: Small, Medium & Large, but on the product page I'm not able to pick the sizes.
How can I correct this issue?
Same problem here.
I installed stock_by_attributes_1.4.13
I want to know please how to put an table on each product page for my customers to choose the width, color, height ?
To know what i`m talking about, here I put an picture with the table that I want to add : http://s3.postimage.org/62uwm416x/image.jpg
Many thanks fot thoose who helping me!
Installed 1.4.13 and resynced quantities and it took the stock quantities of the main product to zero throughout the entire cart. If you have used this version and not had any problems with the quantity sync please let me know! If this is typical of this version, it has a major problem!
I checked the entire install to make sure the files are the correct ones and the database is okay.
One other oddity is that there is a save button on the page - that has no function and wasn't there in the last version I used.
The only improvement I see is that the shopping cart now shows the quantity numbers next to the product. That was my only problem with this mod before and I think the last version I used was 1.4.10.
Right now I'm just trying to get a working version of this installed for a client on their sites. Which version?
Just updated from 4.7 to 4.13.
But now I get the following error when I try to access SBA:
1054 Unknown column 'sort' in 'order clause'
in:
[select * from products_with_attributes_stock where products_id="530" order by sort ASC;]
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.
In the webshop the attributes still show.
Running ZC 1.3.8a
When I click sort, I get the error:
1054 Unknown column 'sort' in 'field list'
in:
[UPDATE products_with_attributes_stock set sort = '0' WHERE stock_id = '152' 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.
I havn't made any changes to the database. Only copied the files.
There are 2 separate sql updates if you are coming from that old a version. One is included in the package and the other is to add the sort feature to the attributes table. That update is in version 4.1.11 which I haven't downloaded.