-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Hi, I'm currently using Zen 1.5.4 and installed the latest version of this software. My problem is that when I select the install script feature nothing happens. I did have to mod the general.php file slightly to get the admin section to work. Is there anything I've missed?
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
corseter
Hi, I'm currently using Zen 1.5.4 and installed the latest version of this software. My problem is that when I select the install script feature nothing happens. I did have to mod the general.php file slightly to get the admin section to work. Is there anything I've missed?
Latest as obtained from where? Any error logs in your logs directory? Hope I didn't introduce somethng yesterday wheni added some code manually.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Latest as obtained from where? Any error logs in your logs directory? Hope I didn't introduce somethng yesterday wheni added some code manually.
I have not done anything with the code yet. I will let you know ASAP
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
adb34
I have not done anything with the code yet. I will let you know ASAP
All done. It now works. Locations of my inserts are
After line 114 - global $db, $resultMmessage; inserted the one line
After line 182 - the rest of the code
Do you want me to send you this file?
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Forgot to say I did not need
PHP Code:
DELETE IGNORE FROM `configuration` WHERE `configuration_key` = 'PRODINFO_ATTRIBUTE_DYNAMIC_STATUS';
DELETE IGNORE FROM `configuration` WHERE `configuration_key` = 'SBA_ZC_DEFAULT';
DELETE IGNORE FROM `configuration` WHERE `configuration_key` = 'PRODINFO_ATTRIBUTE_POPUP_OUT_OF_STOCK';
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
adb34
All done. It now works. Locations of my inserts are
After line 114 - global $db, $resultMmessage; inserted the one line
After line 182 - the rest of the code
Do you want me to send you this file?
There was only one chunk of code to be inserted. The first code "group" was to show what to find and then the second code "group" was the code to incorporate and the third was for those that just need to remove and reinstall without ftping to edit the files.
As to receivng the file, can send, but (and not to be taken wrong) it won't expedite things on my side due to limited access to methods of uploading. The change(s) made to the github repo had to be entirely manually typed as copy and paste was not available/allowed by method of accessing it. While able to type quickly, I don't want to introduce errors unnecessarily by way of such manual entrry. This is why I asked about which source corseter used to obtain the files. If I introduced an error into the file then it needs to be fixed.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Although no additional information has been provided by any source and I haven't been able to use a computer to observe operation of the plugin, in visual review of the changes made to the install program for ZC 1.5.4, it does appear that I missed the lower case m in $resultMmessage for the three new sections of code. Plugin is updated with that m added for each of the three cases.
@Corseter, could you confirm operation? (Again *assuming* that the files were downloaded from github for SBA Version 1.5.4)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Hello,
Zen Cart 1.5.4. We sell many 1 only products and when sold there is no backorder. When two people add the same item to their cart the first one to checkout gets the item - BUT the second person can also checkout and pay but there is no more stock to give them. In the normal use of Zen Cart this doesn't happen - it removes the item from the second person's cart before they can checkout (and takes it off the site). However when using Stock by Attribute it leaves the item in the second person's cart and they can still checkout. We want two or more people to add to their carts since not everyone checks out - but once someone buys the item we don't want others to checkout. Is there a fix to this - a change to the code we can do? Or a setting that we've missed? Thanks - cool addon overall.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
eyeb
Hello,
Zen Cart 1.5.4. We sell many 1 only products and when sold there is no backorder. When two people add the same item to their cart the first one to checkout gets the item - BUT the second person can also checkout and pay but there is no more stock to give them. In the normal use of Zen Cart this doesn't happen - it removes the item from the second person's cart before they can checkout (and takes it off the site). However when using Stock by Attribute it leaves the item in the second person's cart and they can still checkout. We want two or more people to add to their carts since not everyone checks out - but once someone buys the item we don't want others to checkout. Is there a fix to this - a change to the code we can do? Or a setting that we've missed? Thanks - cool addon overall.
What is the source of the version you have installed and when was it last installed/updated?
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
eyeb
Hello,
Zen Cart 1.5.4. We sell many 1 only products and when sold there is no backorder. When two people add the same item to their cart the first one to checkout gets the item - BUT the second person can also checkout and pay but there is no more stock to give them. In the normal use of Zen Cart this doesn't happen - it removes the item from the second person's cart before they can checkout (and takes it off the site). However when using Stock by Attribute it leaves the item in the second person's cart and they can still checkout. We want two or more people to add to their carts since not everyone checks out - but once someone buys the item we don't want others to checkout. Is there a fix to this - a change to the code we can do? Or a setting that we've missed? Thanks - cool addon overall.
Quote:
Originally Posted by
mc12345678
What is the source of the version you have installed and when was it last installed/updated?
Took a look at the code during the checkout process, specifically includes/modules/pages/checkout_confirmation/header_php.php and how it relates to SBA 1.5.4, on line 108 (ZC 1.5.2, 1.5.3, and 1.5.4) there is a check that looks like it needs to be modified slightly. This file will get incorporated into the SBA code, but can be easily changed here.
Change:
Code:
if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
to: by adding , $order->products[$i]['attributes'] into the zen_check_stock statement:
Code:
if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'], $order->products[$i]['attributes'])) {
Without this additional attribute information, then the stock check is made against the base product instead of the SBA tracked quantity. Thus if the product had two attributes each being tracked, if say they both had a quantity of 1, then during the above situation of two people each adding the same attributed product to the cart and "racing" to purchase, well the quantity check would have indicated that there was still one product left, but wouldn't account for having 0 products matching that attribute... With the above, that issue should be resolved.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Thanks so much for the quick reply - I'll look in to this. It was a very recent install - last week or two - Stock By Attribute (SBA) Stock Page Version 1.5.4
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
eyeb
Thanks so much for the quick reply - I'll look in to this. It was a very recent install - last week or two - Stock By Attribute (SBA) Stock Page Version 1.5.4
Okay, initially I thought that had already been addressed by some other changes and didn't want to spend a long time looking for something that might have already been fixed by other changes. Also I had been following the other thread comparing to base code until mentioned that SBA was a factor. Had an opportunity to logon to a computer and look through the SBA version of the file(s).
Anyways, hopefully you have/find an easy way to test the condition because it's a bit of a special case. :)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
I am using 1.5.4 zencart bversion.
I want to know if this mod can be used to keep stock by attributes for some selected categories only?
I have some categories that need to be stocked by attributes, but most of the categories do not need this mod.
Is this possible that i have the mod usable for selected categories only?
- muteyaar
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
muteyaar
I am using 1.5.4 zencart bversion.
I want to know if this mod can be used to keep stock by attributes for some selected categories only?
I have some categories that need to be stocked by attributes, but most of the categories do not need this mod.
Is this possible that i have the mod usable for selected categories only?
- muteyaar
The way the mod has been rewritten, you can track as much or as little product as desired. If it was entirely installed for one product, then that could be the one product tracked. There is no special only track category x option though... All product setup is centered around the product not the category(ies) in whch it is.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Hello I just installed the stock by attribute module on my site went over everything multiple times to make sure every file was where it is supposed to be went to my admin page and to my surprise BLANK PAGE I need help please running 1.5.4 with latest php my site is www.g-linehobbies.com I can not figure out what went wrong
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
Dragon718
Hello I just installed the stock by attribute module on my site went over everything multiple times to make sure every file was where it is supposed to be went to my admin page and to my surprise BLANK PAGE I need help please running 1.5.4 with latest php my site is
www.g-linehobbies.com I can not figure out what went wrong
To confirm, please identify which version of SBA was installed and it's source also when you say there was an issue with the admin, do you mean the entire admin area or just the configuration section of SBA on the admin side?
If there is a blank page, there should also be a mydebug log, though it is probably an admin log so if posted please obscure your admin directory.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
The Ver. is 1.5.3 was downloaded from the zen-cart plugins page and my admin login page is blank though my site is still up. I do not know how to get to the log files
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
Dragon718
The Ver. is 1.5.3 was downloaded from the zen-cart plugins page and my admin login page is blank though my site is still up. I do not know how to get to the log files
That version is applcable to ZC 1.5.1. For a version functional wth ZC 1.5.4, please see SBA 1.5.4 for ZC 1.5.3/1.5.4. Can be found at: http://github.com/potteryhouse/stock_by_attribute_1.5.4
The older one can be incorporated to work wth the latest ZC, but care would need to be taken to ensure properly merged...
As for log files, ftp to store, then logs folder.
http://www.zen-cart.com/content.php?124-blank-page
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Thank you for response will try advice now
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Thank you very much for your support after removing everything I uploaded. I uploaded the newest version everything working fine.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
Dragon718
Thank you very much for your support after removing everything I uploaded. I uploaded the newest version everything working fine.
Welcome, glad it woked out. I had even set up a new site with ths plugn, just to verify functionalty. While it worked I did find a few more places to add some checks for full installation in the event it takes a while to install the sql portion of the plugin ao as not to interfere with visitor's shoppng while installing. I'll be updating the code soon. I've also iidentified all of the files that are shared with ZC and those that are newly added. Have to figure out how best to present that whether a new version, all as one version or keep them separate as they are now...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Im having problem to install the Stock by Attribute v 1.5.3 When I run the run the install get this error:
PHP Catchable fatal error: Object of class queryFactoryResult could not be converted to string in admin/stock_by_attr_install.php on line 125
I cannot find the fix anywhere. Could you please help? I have ZenCart 1.5.3 and PHP 5.5
Thank in advance
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
maxpayne381
Im having problem to install the Stock by Attribute v 1.5.3 When I run the run the install get this error:
PHP Catchable fatal error: Object of class queryFactoryResult could not be converted to string in admin/stock_by_attr_install.php on line 125
I cannot find the fix anywhere. Could you please help? I have ZenCart 1.5.3 and PHP 5.5
Thank in advance
Should be trying to install Stock By Attribute v1.5.4 on a ZC 1.5.3 version...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Just fixed my problem updating Stock Attribute 1.5.3 to 1.5.4
https://github.com/potteryhouse/stoc...ttribute_1.5.4
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
maxpayne381
Good to hear!
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Experience an issue in SBA 1.5.4 version as well. It works fine with one attribute but Im using 2 (color - read only, size - dropdown).
As soon as the color is set for product the size is not showing / working. Same for the color this attribute is not shown on product info page at all.
Im wondering if its the settings issue or something in the code. Please help, thank you.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
maxpayne381
Experience an issue in SBA 1.5.4 version as well. It works fine with one attribute but Im using 2 (color - read only, size - dropdown).
As soon as the color is set for product the size is not showing / working. Same for the color this attribute is not shown on product info page at all.
Im wondering if its the settings issue or something in the code. Please help, thank you.
My guess is that there are html validation issues with the template. Javascript is used and in this area if there are validation issues then the javascript (subsequent set of values) do not work... Or stock may not be entered correctly ie out of stock but other notifications are turned off... Although I can't help deeply at the moment with review of the source code, but there are online tools that can identify discrepancies.
What's the website?
Ohhh, and read-only isn't yet captured... What's the reason for having a read-only attribute of color instead of a selectable color?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Thanks for your reply. The read only attributes work fine until I add SBA then it disappear. I want to have read only as our products have only one color each. The attribute should be there so it can be working with dynamic filters on listing page.
The aim is to have attribute which doesnt have to be selected but can be picked by dynamic filter. Any ideas how to do this?
We can have color in selection box but would be better if its selected... now it says First Select Color.
One more issue I have is to show Out of stock... If I select show quantities the Out of Stock works fine = is not able to select but I can see the quantities per other attributes which is not good. If I turn this off then I cannot see the stock but Out of Stock is there and able to select and put into shopping bag. Is there any fix or setting for this or do I need to find and change in the code?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
maxpayne381
Thanks for your reply. The read only attributes work fine until I add SBA then it disappear. I want to have read only as our products have only one color each. The attribute should be there so it can be working with dynamic filters on listing page.
The aim is to have attribute which doesnt have to be selected but can be picked by dynamic filter. Any ideas how to do this?
We can have color in selection box but would be better if its selected... now it says First Select Color.
One more issue I have is to show Out of stock... If I select show quantities the Out of Stock works fine = is not able to select but I can see the quantities per other attributes which is not good. If I turn this off then I cannot see the stock but Out of Stock is there and able to select and put into shopping bag. Is there any fix or setting for this or do I need to find and change in the code?
So let me try to explain how all this fits together... Stock quantities for a multiple attribute combination can not be shown without using something like javascript at least if a change in one selection has an effect on the other(s)... It is possible to show each/all attributes without using the dynamic dropdown option(s); however, then the attribute quantity will not be shown if the item is considered to have multiple attributes... The dynamic dropdown code has not yet been written to properly incorporate read only attributes.. At this time it expects one to "select" the read only attribute which isn't selectable. The other thing not discussed here is how are the variants entered... There are a number of variables to the setup including the discussion of the above in regards to out-of-stock, quantities displayed, etc... It is some of this complexity that I see is one reason it has not yet been incorporated into ZC as a base feature...
So, then there is the issue of the read-only attribute... Have you tried swapping the sort order of them for one? Also there is a setting at least in ZC 1.5.4 associated with how read-only attributes are treated when adding to the cart, haven't tried it yet, but supposedly it would treat the read-only attribute as a hard item against the stock check... Another thought is that if there is only one color to be "chosen" then make it a dropdown attribute by itself (meaning could make it default, and have no other option value in the list. It will/would force selection when using dynamic dropdowns and sure be an "extra" step, but it would be work under the current arrangement of the plugin.
There is a goal and work being done to incorporate read-only attributes to be used in any/all ways that seem to be applicable; however, this is being supported on an as able basis at this time with other projects having a priority based on commitment...
You might be able to make changes to the includes/templates/YOUR_TEMPLATE/templates/tpl_modules_attributes.php file, or includes/modules/YOUR_TEMPLATE/attributes.php or one of the dynamic dropdown class files in includes/classes with the filename format of pad_*_dropdown*.php or radioset...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Since installed SBA other option types not working e.g. checkbox, drop down etc.
When click on "add to cart" item add to cart but shopping cart page shows error "WARNING: An Error occurred, please refresh the page and try again."
Error log shows
Code:
[05-Nov-2015 22:51:59 America/New_York] PHP Warning: mysqli_query(): Empty query in /home/---/public_html/includes/classes/db/mysql/query_factory.php on line 43
[05-Nov-2015 22:51:59 America/New_York] PHP Fatal error: 0: :: ==> (as called by) /home/---/public_html/includes/functions/extra_functions/products_with_attributes.php on line 155 <== in /home/---/public_html/includes/classes/db/mysql/query_factory.php on line 155
any idea how to use checkbox as some product have only 1 attribute (optional addition) for customers and want to display with checkbox so they can select it per their choice.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
jsarwar
Since installed SBA other option types not working e.g. checkbox, drop down etc.
When click on "add to cart" item add to cart but shopping cart page shows error "WARNING: An Error occurred, please refresh the page and try again."
What version of Zen Cart and which SBA?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
1.5.3 ZC
Stock By Attribute (SBA) Version 1.5.4
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Hi
Using zen cart 1.5.4 with SBA 1.5.4 master, I'm trying to figure out where a problem I am having is occurring. A list of other installed modules is listed below. It seems like the problem is with SBA but I'm not certain if it's that or with Fast and easy checkout, What is happening is when a product with attributes (SBA) is added to shopping cart (main_page=shopping_cart) I click the checkout button and can get to the checkout page (main_page=checkout&fecaction=null) to confirm payment.
However, if a product without attributes (not using SBA) is added to shopping cart, when I click on the checkout button the page stays on the shopping cart page, can't continue on to main_page=checkout&fecaction=null.
If I turn off fast and easy checkout then when adding a product without attributes (not using SBA) I can move from main_page=shopping_cart through to standard checkout process beginning with main_page=checkout_shipping
There are no error logs being generated.
Is it known if SBA 1.5.4 master is fully compatible with fast and easy checkout?
Any thoughts on a possible cause?
tableau template
fast and easy checkout
database mysql backup
stock by attributes
ceon uri mapper
Google Merchant Center Feeder
rss feed
Sitemap XML
Sales report
ckeditor
ezpage metas
google analytics
thanks
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
buildingblocks
Hi
Using zen cart 1.5.4 with SBA 1.5.4 master, I'm trying to figure out where a problem I am having is occurring. A list of other installed modules is listed below. It seems like the problem is with SBA but I'm not certain if it's that or with Fast and easy checkout, What is happening is when a product with attributes (SBA) is added to shopping cart (main_page=shopping_cart) I click the checkout button and can get to the checkout page (main_page=checkout&fecaction=null) to confirm payment.
However, if a product without attributes (not using SBA) is added to shopping cart, when I click on the checkout button the page stays on the shopping cart page, can't continue on to main_page=checkout&fecaction=null.
If I turn off fast and easy checkout then when adding a product without attributes (not using SBA) I can move from main_page=shopping_cart through to standard checkout process beginning with main_page=checkout_shipping
There are no error logs being generated.
Is it known if SBA 1.5.4 master is fully compatible with fast and easy checkout?
Any thoughts on a possible cause?
tableau template
fast and easy checkout
database mysql backup
stock by attributes
ceon uri mapper
Google Merchant Center Feeder
rss feed
Sitemap XML
Sales report
ckeditor
ezpage metas
google analytics
thanks
It's a recently discovered "compatibility" issue between FEC and SBA. FEC passes an empty text string as the attributes value instead of not passing anything. SBA was written with the thought that a non-passed piece of information/undeclared variable would be null...
If you take a look at the slightly more updated version found. At: https://github.com/mc12345678/Stock_...butes_Combined, the code has been updated to address that issue as well as correction needed to better handle product with attributes not tracked by stock...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
awesome! thanks for replying so quickly! Does the whole install need to be updated or just the functions_lookups.php?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
buildingblocks
awesome! thanks for replying so quickly! Does the whole install need to be updated or just the functions_lookups.php?
Safest answer is to replace files. Haven't made database changes in a while. If the download was relatively recent and has the majority of functions affecting core like data in an override class, then the functions_lookup.php should be sufficient to address the stopped at shopping_cart problem. There were a number of other improvements recently. In particular is some "error" checking that is beneficial if product has multiple attributes and dynamic dropdowns is not enabled, then a product tracked by SBA where a combination has been selected doesn't exist notifies the customer...
Just sayin' :)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
alrighty....let me go check on the date my files were uploaded. Thanks :)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
buildingblocks
alrighty....let me go check on the date my files were uploaded. Thanks :)
Assuming that the files were uploaded on the same day that they were downloaded from the applicable github site, this should be a fine comparison; however, that time comparison may not be the right date/time to use... The download date/time would be the more appropriate to use...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
jsarwar
1.5.3 ZC
Stock By Attribute (SBA) Version 1.5.4
Sorry for the seriously delayed response to this. Perhaps you have already resolved it, but that error occurring on that line was from the version that was posted September 9, 2014 and remained as written (potentially problematic) until May 24, 2015. Updating the installed version will resolve that issue and provide additional capabilities as well as other improvements that have been made.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Just on the off chance that someone has run into this. In reading this support thread it seems that the version that should be installed with Zencar 1.5.4 is SBA 1.5.4 from github. I downloaded and installed this on a site upgraded from 1.3.9 which had SBA installed on it. I merged and copied all the files, upgraded the DB, and did some testing. A couple issues were discovered.
All products without attributes trigger a low stock email when ordered. Products that have attributes are fine and only trigger an email when the quantity actually drops below the reorder level. When the email is sent the following error is received.
Code:
PHP Warning: Invalid argument supplied for foreach() in includes/classes/observers/class.products_with_attributes_stock.php on line 331
The email that is sent looks like this
Code:
Low Stock Report:
ID# 922, model# 201964, customid , name Bracelet, Stock:
In an effort to see if it was a conflict with something else installed, I installed a fresh copy of 1.5.4 to a new database, importethe products, and re-installed the SA code. In a fresh install it did the same thing. I then saw that there was a combined merged version so I installed that. I received the same errors.
The other issue is that if I order more than the stock available for a particular attribute I see the not enough stock message. The available stock does not appear in the cart though.
Anything?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Badarac,
Thank. You for this valuable feedback.
The logged error is because the routne is run where no attrbutes are present to fullfill the internal code. In an effort to remove SBA from modfying so many core files (unfortunately the includes/classes/orders.php file still needs a small modifcation to take advantage of data for future use) it would appear that the low-stock check (and possibly other such sections) needs to verify that the involved product is in fact tracked by SBA. There is a similar check elsewhere in the observer class. Will take a look to see if can suggest applicable code.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
@badarac, et al.
In includes/classes/observers/class.product_with_attributes_stock.php
Find the function:
Replace with the following:
Code:
/*
* Function that is activated when NOTIFY_ORDER_PROCESSING_STOCK_DECREMENT_END is encountered as a notifier.
*/
// Line 776
function updateNotifyOrderProcessingStockDecrementEnd(&$callingClass, $notifier, $paramsArray) {
if (zen_product_is_sba($this->_productI['id'])) { // Only take SBA action on SBA tracked product mc12345678 12-18-2015
//Need to modify the email that is going out regarding low-stock.
//paramsArray is $i at time of development.
if ($callingClass->email_low_stock == '' && $callingClass->doStockDecrement && $this->_stock_values->RecordCount() > 0 && $this->_attribute_stock_left <= STOCK_REORDER_LEVEL) {
// kuroi: trigger and details for attribute low stock email
$callingClass->email_low_stock .= 'ID# ' . zen_get_prid($this->_productI['id']) . ', model# ' . $this->_productI['model'] . ', customid ' . $this->_productI['customid'] . ', name ' . $this->_productI['name'] . ', ';
foreach($this->_productI['attributes'] as $attributes){
$callingClass->email_low_stock .= $attributes['option'] . ': ' . $attributes['value'] . ', ';
}
$callingClass->email_low_stock .= 'Stock: ' . $this->_attribute_stock_left . "\n\n";
// kuroi: End Stock by Attribute additions
}
}
}
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Thanks MC. I'll apply that right now to the test site and verify that it works. Get back to you shortly.
RichB
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
MC,
That fixed the problem of the low stock messages but I've discovered other problems. I tested a product that has two attributes. One is a color selection which is identified in SBA. The other is a text attribute to add personalization. There's no information along with the mod on the dynamic dropdown options so I've experimented with them If I select enable dynamic dropdowns the text field becomes a dropdown. Different combinations of the options don't provide an actual text input field. If I turn the dynamic dropdowns off it displays as a text input field but I get an error where rb is the text I entered into the field.
Code:
PHP Fatal error: 1054:Unknown column 'rb' in 'where clause' :: select products_attributes_id
from zen_products_attributes
where options_values_id in (rb,188)
and products_id= 1165
order by products_attributes_id ==> (as called by) includes/functions/extra_functions/products_with_attributes.php on line 236 <== in includes/classes/db/mysql/query_factory.php on line 155
If you need me to go through all the different combinations on the dynamic dropdown menu in admin I'll do that for you.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
badarac
MC,
That fixed the problem of the low stock messages but I've discovered other problems. I tested a product that has two attributes. One is a color selection which is identified in SBA. The other is a text attribute to add personalization. There's no information along with the mod on the dynamic dropdown options so I've experimented with them If I select enable dynamic dropdowns the text field becomes a dropdown. Different combinations of the options don't provide an actual text input field. If I turn the dynamic dropdowns off it displays as a text input field but I get an error where rb is the text I entered into the field.
Code:
PHP Fatal error: 1054:Unknown column 'rb' in 'where clause' :: select products_attributes_id
from zen_products_attributes
where options_values_id in (rb,188)
and products_id= 1165
order by products_attributes_id ==> (as called by) includes/functions/extra_functions/products_with_attributes.php on line 236 <== in includes/classes/db/mysql/query_factory.php on line 155
If you need me to go through all the different combinations on the dynamic dropdown menu in admin I'll do that for you.
Is the text option something that is stock dependent? Ie. if someone enters text, does that affect the stock of tracked product? I ask more to try to quickly work around a somewhat known issue that dynamic dropdowns at this point does not support much more than dropdown related attributes, but is being worked on.
The lines to be affected are 216 and 222 in includes/functions/extra_functions/products_with_attributes.php
Mainly I perceive that the two if statements would need to be modified to account for text boxes. To identify exactly what is expected, need to also look back at the products_with_attributes_stock table population for text fields (appears that it could be possible for an attribute to be passed to this function that is not tracked by SBA which according to the above question of if the text box affects stock it wouldn't matter as the function attempts to compare all attributes as a unit rather than one at a time (this type of comparison is done elsewhere in the code and needs to carry over to here as well) and there is no code yet provided that allows combining 2 or more attributes as a unit and at the same time 1 or more other attributes as unit requiring 3 or more attributes to identify the product by that combination. At the moment it is either multiple single attributes, or all attributes as a group. Unfortunately text boxes have not been factored in yet, but is a basic (relatively essential) attribute type to be incorporated.
The additional testing would be beneficial to the continued development, especially since there is an interest to seeing the multiple attributes options fully supported.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Is the text option something that is stock dependent? Ie. if someone enters text, does that affect the stock of tracked product? I ask more to try to quickly work around a somewhat known issue that dynamic dropdowns at this point does not support much more than dropdown related attributes, but is being worked on.
The lines to be affected are 216 and 222 in includes/functions/extra_functions/products_with_attributes.php
Mainly I perceive that the two if statements would need to be modified to account for text boxes. To identify exactly what is expected, need to also look back at the products_with_attributes_stock table population for text fields (appears that it could be possible for an attribute to be passed to this function that is not tracked by SBA which according to the above question of if the text box affects stock it wouldn't matter as the function attempts to compare all attributes as a unit rather than one at a time (this type of comparison is done elsewhere in the code and needs to carry over to here as well) and there is no code yet provided that allows combining 2 or more attributes as a unit and at the same time 1 or more other attributes as unit requiring 3 or more attributes to identify the product by that combination. At the moment it is either multiple single attributes, or all attributes as a group. Unfortunately text boxes have not been factored in yet, but is a basic (relatively essential) attribute type to be incorporated.
The additional testing would be beneficial to the continued development, especially since there is an interest to seeing the multiple attributes options fully supported.
The text attribute does not affect the stock. I can't image how a text attribute ever would though. I would guess that the answer is to modify it to exclude text attributes. If you want me to test anything I'll happily do that.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
I got rid of the error by adding this
Code:
foreach ($attribute_list as $optid => $optvalid) {
if (true) {
// mc12345678 Here is one place where verification can be performed as to whether a particular attribute should be added. This is probably the best place to do the review because all aspects of the attribute are available.
if (is_numeric ($optvalid)) {
$attributes[] = $optvalid;
}
}
}
If the text attribute is added to the SBA table with a quantity the order now completes with the text attribute added to the cart. When the order is submitted I receive a low stock email with a stock value of -1. All attributes defined in the sba table have a positive stock value.
If the text attribute is removed from the SBA table it won't allow checkout because an attribute is out of stock.
I guess there must be a better way.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
@badarac,
How about now? Didn't really work on dynamic dropdowns, but software needs to add the benefit of tracking stock by attribute even when say dynamic dropdowns are disabled.
Worked towards: recognzing text entry fields and upload fields for when submitting product to the cart, also recognition that the selections made do not exist. Ruling for existence at this point is: either all attributes submitted are grouped as a single variant (a shoe that is red, size 10, and has bright yellow laces) and if not grouped that way then are each individually tracked but represent only an attribute not another store product (a gift bag that allows possibly picking two items perhaps a perfume and a specific toy).
I'm thinking though that at the moment that if there are two or more each of either a textbox or upload file option names that the product will fail at adding to the cart though I have a way in mind to address that. Plan is to identify the occurrence of each of those and if one or more is identified then to OR the option_id and option_value_id for each such pair into the query that retrieves the attribute_id(s) for the combination of attributes.
The result of that being something like get the attribute_id(s) where the option_value_id is in the imploded option_value_ids for other attributes that are not specially controlled or foreach specially controlled option_name have the option_id and option_value_id values of that option_name. Also, for expandability to throw in a few well placed notifiers. Just some thoughts...
Sorry to those that have recently downloaded the latest to discover this issue.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Updated all three locations with code that should now recognize textbox entries (at least when ordering) as well as upload files. Also refined the application of some of the observer actions to only apply when the applicable item should be processed by that observer action generally speaking. In the process identified some typoes and omissions that weren't noticed by others previously.
Looking to verify/update to support ZC 1.5.5 soon.
@badarac, et al. Please confirm issues recently identified are resolved and no new issues generated... There are some known items addressed in github in particular related to read only and other non-dropdown attributes when using dynamic dropdowns as well as some "deeper" things to address such as copying SBA attributes when copying a product, etc...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
@badarac, et al. Please confirm issues recently identified are resolved and no new issues generated... There are some known items addressed in github in particular related to read only and other non-dropdown attributes when using dynamic dropdowns as well as some "deeper" things to address such as copying SBA attributes when copying a product, etc...
MC,
I'll download it and install on the test site today. I'll let you know shortly.
RichB
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
MC,
I'm assuming that I'm downloading from the master branch and replacing the files that were updated 12 hours ago correct?
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
MC,
I installed the five updated files and did a test. For products with only physical attributes the entire process worked fine. For products which had a combination of a text attribute and a physical, the product added to the cart but in the cart it showed as out of stock. The product I'm working with has one physical attribute (color) with two choices and one text. The physical attributes are defined in the SBA table with quantities of 15 and 16. The main product has a quantity of 31. It doesn't make any difference whether the text attribute is defined in the SBA table. I added it to test with a quantity of 9999999 and it still displayed as out of stock in the cart. There is no indication what the quantities are for the attributes on the product page and in the cart. When I turn on the dynamic drop down it displays a pop up message on the product page saying all selections of attributes below this one are out of stock. There is no indication which attribute they are referring to. When I click ok and look at the attribute pull downs it shows the display only and text attributes as out of stock. There's no configuration instructions for the mod and it's new features so I may have something set incorrectly. If you need me to provide you with anything or do any further changes or tests let me know.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Not sure I fully understand the testing conditions of above, but I did go back to see if I affected the option to build a product with attributes where each attribute is added individually. It looks like overall, I changed something to prevent managing product that way. Also wasn't a condition I tested because I didn't think I impacted it.
I had been testing with a product of similar design one selectable attribute and one fill in the field attribute. The setup was though for each combination to be a variant:
Variant1: color X/text 15
Variant2: color Y/text 25
When I tried the individual variant perspective:
Variant1: Color X 15
Variant2: Color Y 25
Variant3: Text 99999
Didn't matter whether Variant3 was text or any other attribute type, I did something that prevented adding a combination like above to the cart... Will be addressing that "corner" of the code now that it has been identified.
Then I should be able to get back to the Dynamic Dropdown part so that it is more robust than originally designed. As for the "instructions" well, the idea is to actually match the functionality more with the existing description... All versions of SBA that I've used in the last 4 years have claimed to handle multiple attributes using the shoe or t-shirt example.... Potteryhouse/jeking were the first that I saw to actually come close to handling both multi- and single attributes in one, though they also mostly went with the version 2 above on variants... I don't use that version, but doesn't mean it shouldn't work.
What I'm getting at is that it really is still in a testing phase to know/understand what limitations and issues exist with it... The goal is pretty much open bore, but there are bound to be a few issues here or there...
The only attribute combination limitation that I know has not been overcome (yet) is such that a product has 3 or more attributes and the variants are built as combinations of 2 or more attributes paired with 1 or more attributes
V1: op_val1-1/op_val2-1
V2: op_val1-1/op_val2-2
V3: op_val1-2/op_val2-1
V4: op_val1-2/op_val2-2
V5: op_val3-1
V6: op_val3-2
Where each of the above variants (V1-V6) has a stock quantity associated...
As to quantities being displayed, well DD when coded to handle other types of attributes will offer some of that, as well as supporting other plugins such as dynamic updating, etc...
The above "abnormal" variants are something to consider in the future, but need to get through the other issues first. :)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Anything I can do to help just let me know. I'll PM you a link to the product I was referring to so you can see how it's working on a live site. Since it's a client's site I don't want to post it here. PM coming.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Huh, go figure:
At line 489 of includes/functions/extra_functions/products_with_attributes.php
Change:
Code:
if (!$stockResult->EOF) {
$notAccounted = true;
}
To:
Code:
if ($stockResult->EOF) {
$notAccounted = true;
}
(Removing the "not" (!) from the if statement.)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Huh, go figure:
At line 489 of includes/functions/extra_functions/products_with_attributes.php
Change:
Code:
if (!$stockResult->EOF) {
$notAccounted = true;
}
To:
Code:
if ($stockResult->EOF) {
$notAccounted = true;
}
(Removing the "not" (!) from the if statement.)
I made the change and it still shows out of stock in the cart. I turned off the dynamic drop downs. With the dynamic drop down active it shows the read only and text attributes out of stock
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
So couple of comments (fyi, was provided links to some "trouble" products), it is expected that attributes be setup as described in the FAQ where if an option name has a "please select" type option that it be marked as display only in the attribute controller. (If that has been done then I need to update the code to not populate the variants with such options or to not consider in DD.)
Secondly, in light of the current functionality and action necessary to fully incoporate the remaining capablity I'm thinking of adding a trigger in the tpl_modules_attributes.php file to disable DD for product that include attribute types not yet supported by DD, to be updated as the functionality is added. Therefore, overall SBA would work on a store, but some functionality would not be available for all product (namely at the moment customer facing added infomation (such as quantity available of a combination or other added "features"), but would still be able to interact with the shopping cart where applicable information could still be presented.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
badarac
I made the change and it still shows out of stock in the cart. I turned off the dynamic drop downs. With the dynamic drop down active it shows the read only and text attributes out of stock
Yeah, wanted to be sure could get the product added to the cart first (fix provided above) then would need to apply the same fix to the includes/functions/functions_lookup.php file (ZC 1.5.3/1.5.4 line 252, ZC 1.5.1 line 255).
Afterall, if going to "make a mistake" then be consistent and make it everywhere right? :)
I'll update the three repositories and then will add the "disabling" feature soon.. Want to do it so that it will be easy to upgrade in the future. Need to identify the appropriate combination of DB, constant and code information so that it can be applied "easily" and consistently.. Not an ideal situation, but would support more of the production use of the code in its beta state.
Ie. was asked a while back to submit the code as a formal plugin to ZC; however, I felt that all/most of these multiple attribute issues needed to be addressed before formally submitting it. This may provide a stop-gap to that issue and make it possible for more formal use...
badarac, thank you for identifying this issue and for the additional testing in absence of clear direction. Before submitting will have to catch everything up to the current condition/status...
Also, looks like ZC 1.5.5 is nearing release, so need to grab any changes/issues and incorporate for its use... All the more reason to transition to using http://www.github.com/mc12345678/Sto...butes_Combined where installation and version maintenance has become a bit simpler... :)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Github updated to allow adding product to 1) check that the attributes of product being added to the cart are in fact defined by variants present (all listed as a combination in one variant or each attribute listed individually), 2) to manage at least the special cases of fill in the text and upload a file (welcome input if other attribute types are an issue), and 3) for product presenting a text field or upload file when Dynamic Dropdowns is disabled.
Next up, to support the code disabling dynamic dropdowns for the product that do not display accurately for the attributes applied to the product to allow maximum use of the features while development continues to make the dynamic dropdown part more robust.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Alright, added a function that when fed the appropriate attribute data can determine if dynamic dropdowns should be able to be shown for a product even if DD is turned on for all product. The function can be modified/customised to turn off DD under other certain conditions; however, that seemed to be the basic reason.
As dynamic dropdowns are made more "flexible", the limitations in that function will be reduced, but until then...
Have fun... :)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Haven't tested the operation yet; however, the files have been updated to support incorporation into a vanilla ZC 1.5.5 install.
The new version has both a default template as well as a responsive classic version. Files affected in both templates are included for comparison against each of the respective folders.
Okay, probably not a great explanation, I'm in processing mode and would have to change hats to maybe be more coherent... :)
https://github.com/mc12345678/Stock_...butes_Combined
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Yeah, wanted to be sure could get the product added to the cart first (fix provided above) then would need to apply the same fix to the includes/functions/functions_lookup.php file (ZC 1.5.3/1.5.4 line 252, ZC 1.5.1 line 255).
I applied the change to line 252. It allows me to add the product to the cart and as long as I add an entry in the SBA table for the text attribute with a quantity it will allow checkout. Without the text attribute added and a quantity assigned it marks it as out of stock. Not sure if that's what you intended.
I wasn't sure if the remaining comments were about changes to support 1.5.5 or if you meant for me to pick up additional changes for disabling the dynamic dropdowns. If you want me to do more let me know.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
badarac
I applied the change to line 252. It allows me to add the product to the cart and as long as I add an entry in the SBA table for the text attribute with a quantity it will allow checkout. Without the text attribute added and a quantity assigned it marks it as out of stock. Not sure if that's what you intended.
I wasn't sure if the remaining comments were about changes to support 1.5.5 or if you meant for me to pick up additional changes for disabling the dynamic dropdowns. If you want me to do more let me know.
So, to support having SBA installed and to track stock only when/where needed instead of earlier versions in some way or another requiring all product with attributes to be tracked by SBA, I've updated the template files to disable dynamic dropdowns when the attribute list of a product contains an attribute that is not yet managed by DD. That is/was the stuff about some of the other posting.
As to the text attribute and it's need in the SBA variants. While not a great solution perhaps, but the checks performed when adding to the cart verfy that the attributes present are supported by the definition(s) for the product... ZC doesn't provide such a check per se where one could use web tools such as firebug for firefox to modify the attributes that will be posted and submit the product to the cart and basically it will go through if properly modified. But, the store owner would see this as an error and either dump the order or ask the customer about it.
With SBA or the concept behind it, one "complexity" is that when mixing attributes, one sub-attrbute may not exist for the product by "design" or vendor availability. So it is important to validate that the customer chosen options exist as defined by the store owner. The DD part mostly takes care of that (though such a non-existent option actually shows as out-of-stock instead of being hidden from display), but need/want to be sure to provide functionality when javascript is also *not* available or when the store owner chooses not to use DD for anything.
So... To meet that end, a text attribute should be associated with the product (whether required to filled in or not). If it is a non-stock beaing attribute, it should be combined with other variants... If say it is stock bearing, like only have so many badges that can be printed with information, then the text attribute should be individual, but as it stands, if the text attribute is split out so should all the other attributes for that product...
As development continues and such idiosynchrocies identified more controls are likely to be added to the admin side, but still trying to basically provide the largest application to the basic possibilities without limiting expansion.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Fyi and fwiw I just learned that 1.5.5 will add some additional CSS features to attributes. That change will affect tpl_module_attributes.php which s modified by this plugin. I am therefore considering applying that change across all 1.5.x versions instead of making the change apply only to 1.5.5. I don't see a negative to this in functionality, only in "philosophy"... Especially as the change would have to be incorporated into the DD part... Somewhat simplifies "maintenance" and adds the capability to users of older systems.
Thoughts?
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
I don't see a downside to that. I don't see how doing it would cause any problems either. It's just more targeted styling.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Having a bit of fun, in that SBA is allowing me to add out of stock attributes to the shopping cart. The top of the page displays the success message, but the cart itself shows the item is out of stock.
We don't want to hide out of stock attributes, because we may get that variant back in stock. We really don't want to manage backorders, since a significant number of variations are short lived, and we won't get them back into stock, but don't know until we reorder.
I updated SBA from GitHub today, with the same result. ZC 1.5.4
Dynamic Drop Downs:
Enable Dynamic Dropdowns 2 Tried every option here
Product Info Single Attribute Display Plugin sequenced_dropdowns Tried every combination here
Show Out of Stock Attributes False Tried both
Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns Tried every combination here
Mark Out of Stock Attributes Right
Display Out of Stock Message Line True
Prevent Adding Out of Stock to Cart True Seems like this would be the place...
SBA Number of Records to Displayed 25
Stock
Title Value
Check stock level true
Subtract stock true
Allow Checkout true
Mark product out of stock ***
Stock Re-order level 5
Products status in Catalog when out of stock should be set to 0
Show Sold Out Image in place of Add to Cart 1
Product Quantity Decimals 0
Show Shopping Cart - Delete Checkboxes or Delete Button 3
Show Shopping Cart - Update Cart Button Location 3
Show New Products on empty Shopping Cart Page 1
Show Featured Products on empty Shopping Cart Page 2
Show Special Products on empty Shopping Cart Page 3
Show Upcoming Products on empty Shopping Cart Page 4
Show Notice of Combining Shopping Cart on Login 1
SBA Show Available Stock Level in Cart (when less than order) true
SBA Display Attributes Images false
SBA Display Custom ID true
SBA Display Search List Box true
SBA Display Images in Admin true
SBA Show Stock Level on Product Info Page true
SBA Original Price Struck Through true
SBA Display Search Box Only false
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
Having a bit of fun, in that SBA is allowing me to add out of stock attributes to the shopping cart. The top of the page displays the success message, but the cart itself shows the item is out of stock.
We don't want to hide out of stock attributes, because we may get that variant back in stock. We really don't want to manage backorders, since a significant number of variations are short lived, and we won't get them back into stock, but don't know until we reorder.
I updated SBA from GitHub today, with the same result. ZC 1.5.4
Dynamic Drop Downs:
Enable Dynamic Dropdowns 2 Tried every option here
Product Info Single Attribute Display Plugin sequenced_dropdowns Tried every combination here
Show Out of Stock Attributes False Tried both
Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns Tried every combination here
Mark Out of Stock Attributes Right
Display Out of Stock Message Line True
Prevent Adding Out of Stock to Cart True Seems like this would be the place...
SBA Number of Records to Displayed 25
Stock
Title Value
Check stock level true
Subtract stock true
Allow Checkout true
Mark product out of stock ***
Stock Re-order level 5
Products status in Catalog when out of stock should be set to 0
Show Sold Out Image in place of Add to Cart 1
Product Quantity Decimals 0
Show Shopping Cart - Delete Checkboxes or Delete Button 3
Show Shopping Cart - Update Cart Button Location 3
Show New Products on empty Shopping Cart Page 1
Show Featured Products on empty Shopping Cart Page 2
Show Special Products on empty Shopping Cart Page 3
Show Upcoming Products on empty Shopping Cart Page 4
Show Notice of Combining Shopping Cart on Login 1
SBA Show Available Stock Level in Cart (when less than order) true
SBA Display Attributes Images false
SBA Display Custom ID true
SBA Display Search List Box true
SBA Display Images in Admin true
SBA Show Stock Level on Product Info Page true
SBA Original Price Struck Through true
SBA Display Search Box Only false
Quote:
Allow Checkout true
This allows adding product to the cart even if it is out-of-stock and is one of the factors in identifying whether a product can be added that has a zero quantity... So initial question and not trying to be facetious or rude, is which do you want to be able to add product to the cart when it is out-of-stock and to be backordered regardless if it is tracked by SBA, not allow any product to be added to the cart that is out-of-stock or to only limit this possibility for product that is stocked by attributes?
The first two of those three options is directly supported by ZC and SBA, the third would be some form of a code change.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Turns out I updated with the version at https://github.com/potteryhouse/stoc...ttribute_1.5.4
There is also the combined version at https://github.com/mc12345678/Stock_...butes_Combined
This may sound like a stupid question, but which version do I use?
/admin and /include at the root of the repostiory OR
/1_5_3 and 1_5_4
Might be nice to add a clarification in the readme...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
Both. :)
The files in the ZC version sub-directory are those files that are different for each version. The remaining files (root files) are the same throughout and a reason why the two sets of previous files were combined... A whole lot of effort to update two sets of files (the central part of the SBA functionality and then the ZC modified files which really only serve as an interface. Instead of really needing to only update one set..)
Yeah, instructions need to be updated and seems like the code is near the ability to submit as an update to the version previously provided for ZC 1.5.1 requiring the documentation to be updated first.
My suggestion would be to load all of the files in the main includes and admin directories (no interaction with the store files really at that point) and then load the ZC version specific files. I'm about to install the software into a ZC 1.5.5 site to see how it works best so that the store can remain active while the software is installing and customers not see any significant glitch other than perhaps if they are loading the exact file that is being updated at the same time it is being overwritten...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
This allows adding product to the cart even if it is out-of-stock and is one of the factors in identifying whether a product can be added that has a zero quantity... So initial question and not trying to be facetious or rude, is which do you want to be able to add product to the cart when it is out-of-stock and to be backordered regardless if it is tracked by SBA, not allow any product to be added to the cart that is out-of-stock or to only limit this possibility for product that is stocked by attributes?
The first two of those three options is directly supported by ZC and SBA, the third would be some form of a code change.
I just set Allow Checkout to False. (still using potteryhouse code) Yay! now it won't add it to the cart, but opens the shopping cart showing that the quantity added has been adjusted per current inventory (in the case of no inventory, zero were added). We were really trying to avoid any adding to the shopping cart diverting the user from continuing on the path they were already on (buying stuff!) Thankfully, adding a quantity <= stock on hand still doesn't open the shopping cart.
I'm not trying to allow adding an out of stock item to the cart at all (SBA managed or not). This prevents even considering the option of a backorder, which is untenable with the changing availability of our products. Any product not tracked by SBA shows the "sold out" button rather than "add to cart" button, so there was no way to add an out-of-stock non-SBA item to the cart. We'd like to show that we offer a gizmo in green, even if it's out of stock. We just don't want it to be added to the cart. Preferably, with some indication of no stock when they are looking at and choosing the attributes.
Many of our items are consumables. If we're out of a 30ml bottle, most of our customers are perfectly happy to buy a couple 10ml bottles and try for the 30ml the next time they order. We want them to know that we do offer the big bottle, but it's just out of stock right now.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
I just set Allow Checkout to False. (still using potteryhouse code) Yay! now it won't add it to the cart, but opens the shopping cart showing that the quantity added has been adjusted per current inventory (in the case of no inventory, zero were added). We were really trying to avoid any adding to the shopping cart diverting the user from continuing on the path they were already on (buying stuff!) Thankfully, adding a quantity <= stock on hand still doesn't open the shopping cart.
I'm not trying to allow adding an out of stock item to the cart at all (SBA managed or not). This prevents even considering the option of a backorder, which is untenable with the changing availability of our products. Any product not tracked by SBA shows the "sold out" button rather than "add to cart" button, so there was no way to add an out-of-stock non-SBA item to the cart. We'd like to show that we offer a gizmo in green, even if it's out of stock. We just don't want it to be added to the cart. Preferably, with some indication of no stock when they are looking at and choosing the attributes.
Many of our items are consumables. If we're out of a 30ml bottle, most of our customers are perfectly happy to buy a couple 10ml bottles and try for the 30ml the next time they order. We want them to know that we do offer the big bottle, but it's just out of stock right now.
Suggest going back to the Dynamic Dropdown settings and/or stock settings for SBA.. Do product only have one option name assigned or multiple? If multiple, what are the variants?
Are you using the option name type: SBA Select List (Dropdown) Basic for single attribute product?
If you use dynamic dropdowns for attributes, then the question comes to do you have product that has multiple option names and how would you like to present the information?
Give it a shot or describe the condition to try to evaluate further, but there is still something I recall about a change in ZC 1.5.4 that modified how the add-to-cart notifications were provided in such an attempt to add to cart when product is out-of-stock condition.
The Dynamic Dropdowns features cut the customer off at the pass by not allowing adding the product to the cart but as desired above indicating the availability (future as it may be) of the product to come with an out-of-stock notification adjacent to the name. The only caveat and it is described in the last page or two is if say there are three option values for option name 1, and 2 option values for option name 2, but the company doesn't produce one of the combinations in full like only one of the option name 2 items for one of the option name 1 attributes, then the non-existent (never to be produced) combination will still be presented as out-of-stock for now... Still need to incorporate the what to do if a combination of options on screen doesn't exist in reality.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
FYI and FWIW,
Playing around with single attribute product to see how it is working currently and what can be done. Looks like in trying to "protect" from some undesirable actions being taken, single attribute (single option name) product have been affected to not work like they used to... Working on correcting that and not losing the multiple attribute functionality that has been added...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Suggest going back to the Dynamic Dropdown settings and/or stock settings for SBA.. Do product only have one option name assigned or multiple? If multiple, what are the variants?
Are you using the option name type: SBA Select List (Dropdown) Basic for single attribute product?
If you use dynamic dropdowns for attributes, then the question comes to do you have product that has multiple option names and how would you like to present the information?
Give it a shot or describe the condition to try to evaluate further, but there is still something I recall about a change in ZC 1.5.4 that modified how the add-to-cart notifications were provided in such an attempt to add to cart when product is out-of-stock condition.
The Dynamic Dropdowns features cut the customer off at the pass by not allowing adding the product to the cart but as desired above indicating the availability (future as it may be) of the product to come with an out-of-stock notification adjacent to the name. The only caveat and it is described in the last page or two is if say there are three option values for option name 1, and 2 option values for option name 2, but the company doesn't produce one of the combinations in full like only one of the option name 2 items for one of the option name 1 attributes, then the non-existent (never to be produced) combination will still be presented as out-of-stock for now... Still need to incorporate the what to do if a combination of options on screen doesn't exist in reality.
- About 1/4 of our products have no attributes.
- Half of what remain have a single attribute (such as color or size, with red, green, blue, yellow and white // small, medium, large, extra large)
- The remaining have two attributes (such as color AND size)
- For a small but notable number of products, red and green are only available in medium and large sizes.
- We have two products with three attributes (color, size and flavor). We've divided them into chocolate xxx and vanilla xxx as two separate parent items, each with color and size as attributes. Mucking about with managing two-tier attributes is enough fun without three tiers
We want to show all combinations of attributes (even those without stock), but prevent out-of-stock combinations to be added to the cart. About half of what is out of stock can be replenished, the other half can't (or won't). We will remove combinations that we won't replenish, but want them to display at least up to the last sale. We won't always know that we have the last three of the large green gadget until we try to order more.
- Until we sell the last large green gadget, we want it to display and be "addable" to the cart. No brainer, not a problem
- Once we sell the last large green gadget, we want that option to show up in the selections, but not be "addable," here being the crux of the issue because if it is a good seller, we'll try to get more. Preferably, the dropdown will show an out of stock notice when it's chosen as well as prevent adding to the cart and not take the customer off of the gadget page to tell them it wasn't added to the cart. Since a large number of our products are consumables, they'll gladly buy two of the 10ml bottles instead of one 30ml bottle. We want to make sure that the customer sees the large version is an option, just not at this moment.
- If we try to get more large green gadgets and find out that they aren't produced anymore, we'll remove that option from SBA
I have tried quite a few plugins related to selecting attributes over the last 6 months. I know that at least one of them used a Java array with the current inventory for each option and combination. For the dropdowns, the customer had to select the first option first (which showed current inventory for all "large" and all "small" items). The second dropdown updated with the number of "large green" and "large red" or "small green" and "small red". The Java checked the current stock from the array when the "add to cart" button was pushed and prevented the call going forward.
It seems clear that this isn't the plugin that had that feature. Our management didn't want us to show the stock on hand, so I thought I turned that off. From your questions, it appears that I selected SBA instead of that one.
I'm poking around the code to trace where the option lists are populated to determine if I can recreate the Java stock tracking.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
- About 1/4 of our products have no attributes.
- Half of what remain have a single attribute (such as color or size, with red, green, blue, yellow and white // small, medium, large, extra large)
- The remaining have two attributes (such as color AND size)
- For a small but notable number of products, red and green are only available in medium and large sizes.
- We have two products with three attributes (color, size and flavor). We've divided them into chocolate xxx and vanilla xxx as two separate parent items, each with color and size as attributes. Mucking about with managing two-tier attributes is enough fun without three tiers
We want to show all combinations of attributes (even those without stock), but prevent out-of-stock combinations to be added to the cart. About half of what is out of stock can be replenished, the other half can't (or won't). We will remove combinations that we won't replenish, but want them to display at least up to the last sale. We won't always know that we have the last three of the large green gadget until we try to order more.
- Until we sell the last large green gadget, we want it to display and be "addable" to the cart. No brainer, not a problem
- Once we sell the last large green gadget, we want that option to show up in the selections, but not be "addable," here being the crux of the issue because if it is a good seller, we'll try to get more. Preferably, the dropdown will show an out of stock notice when it's chosen as well as prevent adding to the cart and not take the customer off of the gadget page to tell them it wasn't added to the cart. Since a large number of our products are consumables, they'll gladly buy two of the 10ml bottles instead of one 30ml bottle. We want to make sure that the customer sees the large version is an option, just not at this moment.
- If we try to get more large green gadgets and find out that they aren't produced anymore, we'll remove that option from SBA
I have tried quite a few plugins related to selecting attributes over the last 6 months. I know that at least one of them used a Java array with the current inventory for each option and combination. For the dropdowns, the customer had to select the first option first (which showed current inventory for all "large" and all "small" items). The second dropdown updated with the number of "large green" and "large red" or "small green" and "small red". The Java checked the current stock from the array when the "add to cart" button was pushed and prevented the call going forward.
It seems clear that this isn't the plugin that had that feature. Our management didn't want us to show the stock on hand, so I thought I turned that off. From your questions, it appears that I selected SBA instead of that one.
I'm poking around the code to trace where the option lists are populated to determine if I can recreate the Java stock tracking.
Everything described there (except showing the total quantity of sub-product combined at the top of the list) was a part of this until I recently tried to make some improvements and didn't run through the complete litany of tests that between you and badarac have put it through... I tested things, and tried not to break previous operation, but on that latter part I missed a condition of consideration and was too focused on Dynamic Dropdown operation specifically with multiple option names (2, 3, etc...)... I'm finding some minor tweaks that are needed to restore this to it's former glory... Again, living breathing code... It needs people to identify the issues... There are some that have been repeated here multiple times and many if not all are captured in the github issues area... But the items identified recently have cropped up from some "over protection" that was too stringent.
As to the not allowing adding, if the javascript is capturing the products as out-of-stock, then it will/should also disable allowing selection of the product from the dropdown...
Currently in some situations/conditions I am still looking to apply SBA type features to the SBA style dropdown... If you give me a few more minutes of testing I can update the github repo with improvements to restore it's operation.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Okay, to let you move on with this in a functional state, I'm uploading the changes made thus far... There is still a minor issue in a thus far identified specific scenario with Dynamic Dropdowns when it is used for single attribute product, but the dropdown menu designed by potteryhouse/jeking is working the way it should have been including as described above to not allow selection of an out-of-attribute product but to at least show that the attribute is/might be a possibility... Should be posted momentarily to github.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Rereading your message, it would appear that this is infact a version that performed as described... When Dynamic Dropdowns is offered to provide for multiple attributes only, the javascript options/control described is available if then in the Dynamic Dropdowns menu: Product Info Multiple Attribute Display Plugin is set to: sba_sequenced_dropdowns
That will then provide/show Please Select First for the first attribute/option name and then Please Select Next for the subsequent attribute/option name(s).
BTW, not entirely sure what the difficulty is with managing multi-attribute stock. Have you tried using EasyPopulate v4 to manage the stock? It has an SBA option for variants that have been defined allowing stock control of SBA variants....
Okay, updated the https://www.github.com/mc12345678/St...butes_Combined repro with recent changes.
Still have an issue where the "out-of-stock" message "incorrectly" appears for a single option name product that is tracked by Dynamic Dropdowns, where a notification is enabled, and I haven't chased down all the other criteria, but the way it is designed the message really shouldn't be displayed which would confuse a customer (assuming they read it), but it doesn't prevent adding the in-stock product to the cart.
If though the person installing the software has a "better" version of the includes/classes/pad_multiple_dropdowns.php file, then it can be used in place of the one provided in this version and infact, because potteryhouse/jeking did the work they did for single attribute products I would recommend staying away from using Dynamic Dropdowns for single attribute product and only using it for multiple attribute product at least as provided with this plugin... The option is there if it "works" for you, but hasn't been fully revised/updated for use with this plugin and if not mistaken is still provided as originally developed. (Could be wrong on that one, sorry.)
Anyways, updated with what looks like is operating the way it should have been before.. If not seeing the results, then please show the current settings (not the possibility of various settings being in potential conditions) or request the recommended settings to meet the above results...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Fyi, tested the new/current code regarding adding a product that is out-of-stock when the product is allowed to be added while out-of-stock. Worked provided dynamic dropdowns was set to false for allowed to add product that is out-of-stock. (Making a note that if the store allows adding out-of-stock then the setting in dynamic dropdowns should be overridden automatically.) Also "helps" if the javascript popup notification for adding out-of-stock is turned off (working on providing a back-order notification so that there is an actual difference displayed for back-order versus out-of-stock product.)
At any rate, trying to confirm that I've restored functionality to what it was and so far it looks like it is possible to work with low/out-of-stock quantities.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Rereading your message, it would appear that this is infact a version that performed as described... When Dynamic Dropdowns is offered to provide for multiple attributes only, the javascript options/control described is available if then in the Dynamic Dropdowns menu: Product Info Multiple Attribute Display Plugin is set to: sba_sequenced_dropdowns
That will then provide/show Please Select First for the first attribute/option name and then Please Select Next for the subsequent attribute/option name(s).
I thought I was going crazy. I know I tested a number of options before choosing SBA, but was quite sure this was one of the pros of SBA. Nice to know my memory isn't as bad as I started thinking...
Quote:
BTW, not entirely sure what the difficulty is with managing multi-attribute stock. Have you tried using EasyPopulate v4 to manage the stock? It has an SBA option for variants that have been defined allowing stock control of SBA variants....
We're not having any difficulty in managing inventory with any combination of attributes. Our only problem was adding out-of-stock to the cart, and the later discovered shove to the shopping cart once we set Allow Checkout to false. The decision to limit our products to two attributes was for non-SBA reasons, but I was happy of this decision if I was going to tackle our issues in-house.
We (I) chose not to use EasyPopulate because managing the inventory was easy enough and seems to be glitch-free (aside from my understanding that canceled orders don't return "held" items to inventory). I don't want to pepper the site with lots of plugins, since managing updates quickly escalates to a major headache (as if a "clean" update is ever truly headache free).
Awesome! I'll try it out!
Quote:
Still have an issue where the "out-of-stock" message "incorrectly" appears for a single option name product that is tracked by Dynamic Dropdowns, where a notification is enabled, and I haven't chased down all the other criteria, but the way it is designed the message really shouldn't be displayed which would confuse a customer (assuming they read it), but it doesn't prevent adding the in-stock product to the cart.
So are you suggesting Product Info Single Attribute Display Plugin => single_dropdown or sba_sequenced_dropdowns
and Product Info Multiple Attribute Display Plugin => sba_sequenced_dropdowns ?
Quote:
If though the person installing the software has a "better" version of the includes/classes/pad_multiple_dropdowns.php file, then it can be used in place of the one provided in this version and infact, because potteryhouse/jeking did the work they did for single attribute products I would recommend staying away from using Dynamic Dropdowns for single attribute product and only using it for multiple attribute product at least as provided with this plugin... The option is there if it "works" for you, but hasn't been fully revised/updated for use with this plugin and if not mistaken is still provided as originally developed. (Could be wrong on that one, sorry.)
Anyways, updated with what looks like is operating the way it should have been before.. If not seeing the results, then please show the current settings (not the possibility of various settings being in potential conditions) or request the recommended settings to meet the above results...
I'll be trying the new update shortly. Thanks for your "ontopishness!"
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
I thought I was going crazy. I know I tested a number of options before choosing SBA, but was quite sure this was one of the pros of SBA. Nice to know my memory isn't as bad as I started thinking...
We're not having any difficulty in managing inventory with any combination of attributes. Our only problem was adding out-of-stock to the cart, and the later discovered shove to the shopping cart once we set Allow Checkout to false. The decision to limit our products to two attributes was for non-SBA reasons, but I was happy of this decision if I was going to tackle our issues in-house.
We (I) chose not to use EasyPopulate because managing the inventory was easy enough and seems to be glitch-free (aside from my understanding that canceled orders don't return "held" items to inventory). I don't want to pepper the site with lots of plugins, since managing updates quickly escalates to a major headache (as if a "clean" update is ever truly headache free).
Awesome! I'll try it out!
So are you suggesting Product Info Single Attribute Display Plugin => single_dropdown or sba_sequenced_dropdowns
and Product Info Multiple Attribute Display Plugin => sba_sequenced_dropdowns ?
I'll be trying the new update shortly. Thanks for your "ontopishness!"
Well, I started this once and dunno' what happened, but lost my writeup...
So actually was saying that if want the javascript actions using the software that is provided by this plugin, then set Dynamic dropdowns to display with multiple attributes only, then for multiple attributes in the DD menu select the option that has sba in t (default). For single attrbute product, to show the out-of-stock notification select the option name type that also has sba in it's name (would be the sixth available in a vanilla install).
Thing is that in the last couple of hours with some more testing it looks like I still have an issue with text and upload filename boxes... I'm trying to work around it without modifying any other core code sections and also to keep things going. Issue seen at the moment is if a variant is populated with an attribute and a text field, nothing is added to the text, then when adding the product to the cart, the maximum to add is whatever is assigned in the sba table, good. But with necessary corrections made to functions_lookups, now while in the cart, the product appears to be out-of-stock because the cart functionality removed the attrbute designation for the text block because it was blank... So there's one piece not trying to modfy. Okay, so was able to do a sort of validation to make that go away, but then when adding the same product to the cart again this time with something in the text field, again the product can inaccurately be added to the cart to the maximum assigned in the sba table... No good...
Have a couple of thoughts, but am not happy with the current condition because I thought I had resolved the text issue... It does appear that the above is like adding mixed quantities of a product with the goal to be that the total does not exceed the sba table quantity... I know that currently sba doesn't deal with mixed quantities like the zc store does, is something to consider addressing later, but need to look at how to handle this issue and how zc handles adding two product each with text boxes but one filled in the other not or filled in differently...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Add to this, a concern I have about using session data to move around the cart is that the session data goes away when a logged in customer with items in the cart logs off (or gets logged off) and then sort of back at square one...
Now, I could force the text field to contain a single character if it was pushed as empty, but not exactly sure that's the route I would want to go, might need to look at how it is handled later, like when brought back to the product after clicking on the item in the cart, does it contain the new single character or is it removed?
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Well, I started this once and dunno' what happened, but lost my writeup...
So actually was saying that if want the javascript actions using the software that is provided by this plugin, then set Dynamic dropdowns to display with multiple attributes only, then for multiple attributes in the DD menu select the option that has sba in t (default). For single attrbute product, to show the out-of-stock notification select the option name type that also has sba in it's name (would be the sixth available in a vanilla install).
I'm getting the best results with sba_sequenced_dropdowns for both Single and Multiple Attributes. For single attribute products, trying to add more than the available quantity adds zero to the cart without it. With it, it adds as many to the cart as inventory will support. If it would show single-attribute quantities, my week would be made, it would remove the jarring effect of jumping to shopping cart to be told there is no inventory.
Quote:
Thing is that in the last couple of hours with some more testing it looks like I still have an issue with text and upload filename boxes... I'm trying to work around it without modifying any other core code sections and also to keep things going. Issue seen at the moment is if a variant is populated with an attribute and a text field, nothing is added to the text, then when adding the product to the cart, the maximum to add is whatever is assigned in the sba table, good. But with necessary corrections made to functions_lookups, now while in the cart, the product appears to be out-of-stock because the cart functionality removed the attrbute designation for the text block because it was blank... So there's one piece not trying to modfy. Okay, so was able to do a sort of validation to make that go away, but then when adding the same product to the cart again this time with something in the text field, again the product can inaccurately be added to the cart to the maximum assigned in the sba table... No good...
Have a couple of thoughts, but am not happy with the current condition because I thought I had resolved the text issue... It does appear that the above is like adding mixed quantities of a product with the goal to be that the total does not exceed the sba table quantity... I know that currently sba doesn't deal with mixed quantities like the zc store does, is something to consider addressing later, but need to look at how to handle this issue and how zc handles adding two product each with text boxes but one filled in the other not or filled in differently...
I'm not much help for text or uploads. Thankfully, all of our products are predetermined attributes. If we weren't so slammed for our imminent release, I'd gladly help you with testing that part.
(note that we're leapfrogging each other, each composing a post at the same time)
Just updated it. Interesting results:
DYNAMIC DROPDOWNS
Enable Dynamic Dropdowns 2 (On for Multi-Attribute Only)
Product Info Single Attribute Display Plugin single_dropdown
Show Out of Stock Attributes True
Product Info Multiple Attribute Display Plugin sba_sequenced_dropdowns
Mark Out of Stock Attributes Right
Display Out of Stock Message Line True
Prevent Adding Out of Stock to Cart True
SBA Number of Records to Displayed 25
STOCK
Allow Checkout false
SBA Show Available Stock Level in Cart (when less than order) true
SBA Display Attributes Images false
SBA Display Custom ID true
SBA Display Search List Box true
SBA Display Images in Admin true
SBA Show Stock Level on Product Info Page true
SBA Original Price Struck Through true
SBA Display Search Box Only
PRODUCT 1 (one of our "toughest"):
Two Attributes, Not a "full grid" of size and color:
30ml
Red 5 in stock
Orange 0 in stock
Yellow 4 in stock
Green Not Offered (and not SBA tracked)
Blue Not Offered (and not SBA tracked)
15ml
Red Not Offered (and not SBA tracked)
Orange Not Offered (and not SBA tracked)
Yellow Not Offered (and not SBA tracked)
Green 0 in stock
Blue 0 in stock
The first attribute (size) now shows
15ml - Out of stock
30ml - (+$8.00) YAY!!!
Selecting 15ml gives a Java alert that all options are out of stock YAY!!!
Upon selecting 30ml, the second attribute (color) shows
Red Qty: 5
Orange greyed out and shows Out of Stock
Yellow Qty: 4
Green greyed out and shows Out of Stock
Blue greyed out and shows Out of Stock YAY!!!
It allows me to add up to 4 30ml/Yellow with just the "added to cart" notice YAY!!! Clicking to add 5 results in only 4 added. YAY!!! Dropdown doesn't update quantity available, so makes me think I can add 4 more, but doesn't allow me to add any more to the cart. I see the balancing act here, definitely hard to tell what's the best strategy, and there's no way to accommodate all preferences...Inventory could be eternally blocked by a shopping cart that doesn't make it to checkout and is overlooked by manual housekeeping. Customers will wind up having their cart contents change during checkout, based on who checks out first.
PRODUCT 2 (should be easiest):
Black 0 in stock
Blue 2 in stock
Grey 0 in stock
Red 2 in stock
Selecting Black or Grey: Does not add show out of stock, does not add to cart, but pushes the customer to the cart page
Selecting Blue...
Qty 1 or 2: Adds 1 or 2 to the cart
Qty 3+: Adds nothing to the cart and pushes the customer to the cart (STOCK => SBA Show Available Stock Level in Cart looks broken here)
CHANGING DYNAMIC DROPDOWNS TO
Enable Dynamic Dropdowns 1 (On for All SBA Tracked)
Product Info Single Attribute Display Plugin sba_sequenced_dropdowns
Product 1 behavior does not change YAY!!!
Using Product 2:
Does not show Available Stock or Out of Stock
Selecting Black or Grey: Does not add to cart, pushes the customer to the cart page
Selecting Blue...
Qty 1 or 2: Adds 1 or 2 to the cart
Qty 3+: Adds 2 to the cart and pushes the customer to the cart to notify too many added I'd call this better response, by letting me add as many as are in stock rather than 0, but would be supremely happy if they knew the max number they could add before they click add to cart
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Add to this, a concern I have about using session data to move around the cart is that the session data goes away when a logged in customer with items in the cart logs off (or gets logged off) and then sort of back at square one...
Now, I could force the text field to contain a single character if it was pushed as empty, but not exactly sure that's the route I would want to go, might need to look at how it is handled later, like when brought back to the product after clicking on the item in the cart, does it contain the new single character or is it removed?
Personally, I'd put this on a lower tier. If the customer logs off, they walked away from their cart. It would be nice to save the cart for them, but that's us being nicer than we have to be (not a bad thing, but not mandatory either). Thankfully, Zen Cart is stable enough that getting dumped is very rare from what I've seen.
I know it's a bad word thanks to twits misusing them, but cookies were designed specifically for this kind of thing...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Since we're actively developing a couple of tools, I'm constantly monitoring the logs..
After installing the most recent update:
Invalid argument supplied for foreach() in /includes/classes/pad_base.php on line 445
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
Since we're actively developing a couple of tools, I'm constantly monitoring the logs..
After installing the most recent update:
Invalid argument supplied for foreach() in /includes/classes/pad_base.php on line 445
That might be because of the use of the sba option for single attributes... (Haven't tested it for such)...
Great testing data, thank you... Will need to do something similar for product with text equivalent boxes..
But, again, when referring to product 2 above, take a look in the attributes controller at what option name is used for that product, then.. in option names (handy button in the top left corner), what is the option name type for that option name? My guess is simply 'dropdown'... Try changing it to 'SBA Select List (Dropdown) Basic' then again, with Dynamic Dropdowns set to only apply to multiple attributes check out that product again... Should act as desired.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
That might be because of the use of the sba option for single attributes... (Haven't tested it for such)...
Great testing data, thank you... Will need to do something similar for product with text equivalent boxes..
But, again, when referring to product 2 above, take a look in the attributes controller at what option name is used for that product, then.. in option names (handy button in the top left corner), what is the option name type for that option name? My guess is simply 'dropdown'... Try changing it to 'SBA Select List (Dropdown) Basic' then again, with Dynamic Dropdowns set to only apply to multiple attributes check out that product again... Should act as desired.
Doing my happy dance! Aside from the smaller quirks mentioned before, works precisely as we need!
Even with as much simplification as we've tried, we still have a total of 14 options with 3 to 30 values each. Is there a risk to setting all to "SBA Select List (Dropdown) Basic"? Thankfully, all of our attributes are from enumerated lists, so dropdown of some variant.
We have a wide array of pairing Options on products, we have just about every single and double attributes for Size, Color, Gauge, Resistance, Design, Length, Shape, Capacity...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Fyi, thought I fixed this the last go round, but one of the fixes identified was in includes/functions/extra_functions/products_with_attributes.php
Lines 489-491 change from:
Code:
if ($stockResult->EOF) {
$notAccounted = true;
}
To:
Code:
if ($stock_values->EOF) {
$notAccounted = true;
}
I had applied it and I believe that would resolve the "bounce" to cart to discover not available issue, but it led me to discover something else that I can't remember at the moment and probably won't get to tonight. :)
As to using the sba dropdown across the board, from what I have seen that the guys did was to take a standard dropdown and add some html capability to it... Guess could add a setup sql to change/allow the change of all of the appropriate option name data types to the sba version... Was just trying not to have/let the software take over "everything". :)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Oddly, one item in our catalog (which we have found so far) has completely wierded out. I've just started investigating the issue, but this is looking pretty big.
One of our products has two options: color and capacity
COLOR:
Black
Blue
Clear
Orange
Pink
Light Pink
CAPACITY
Small (2.5ml)
Large (5.0ml)
The attributes dropdowns that present on the product page:
Capacity
First Select Color
Black
Blue
Clear
Orange
Pink
Light Pink
COLOR
Next select capacity
(no options)
COLOR (note, smaller text size)
First Select Color
Black
Blue
Clear
Orange
Pink
Light Pink
No matter what order we try selecting the attributes, we never reach the state where we can select color and capacity to add it to the cart.
We just noticed that products_with_attributes_stock.product_attribute_combo is being nulled out in an as-yet-unseen pattern. The mentioned product has only one color/capacity combination with this field still populated. We are updating our inventory for imminent site release. We selected an item with product_attribute_combo populated, and updated it's inventory. This did not null product_attribute_combo...
Apologies for the segmented and incomplete info...I'm hoping this will spark a thought for a quick fix.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
Oddly, one item in our catalog (which we have found so far) has completely wierded out. I've just started investigating the issue, but this is looking pretty big.
One of our products has two options: color and capacity
COLOR:
Black
Blue
Clear
Orange
Pink
Light Pink
CAPACITY
Small (2.5ml)
Large (5.0ml)
The attributes dropdowns that present on the product page:
Capacity
First Select Color
Black
Blue
Clear
Orange
Pink
Light Pink
COLOR
Next select capacity
(no options)
COLOR (note, smaller text size)
First Select Color
Black
Blue
Clear
Orange
Pink
Light Pink
No matter what order we try selecting the attributes, we never reach the state where we can select color and capacity to add it to the cart.
We just noticed that products_with_attributes_stock.product_attribute_combo is being nulled out in an as-yet-unseen pattern. The mentioned product has only one color/capacity combination with this field still populated. We are updating our inventory for imminent site release. We selected an item with product_attribute_combo populated, and updated it's inventory. This did not null product_attribute_combo...
Apologies for the segmented and incomplete info...I'm hoping this will spark a thought for a quick fix.
Well there is also something else going on there, which I have seen if the tpl_modules_attributes.php file is not merged/replaced correctly. It looks like color options are being applied/listed against capacity and capacity items against color...
I don't understand the statement that products_with_attributes_stock.product_attribute_combo going to null... Doesn't need to be in depth, but helps to follow. :)
I'm still working on things on my end to ensure all that has been done previously remains functional.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Well there is also something else going on there, which I have seen if the tpl_modules_attributes.php file is not merged/replaced correctly. It looks like color options are being applied/listed against capacity and capacity items against color...
I'll replace it ASAP. I'm knees-deep in another bit of joy.
Quote:
Originally Posted by
mc12345678
I don't understand the statement that products_with_attributes_stock.product_attribute_combo going to null... Doesn't need to be in depth, but helps to follow. :)
Looking at products_with_attributes_stock.php, the "unique combo" field is blank, and looks random, but I'm sure it's not...For the product I mentioned, the unique combo was only populated for one attribute combo.
If I look at the table itself (products_with_attributes_stock) in the database, this field (product_attribute_combo) is NULL for some products and attributes, properly populated on others.
Quote:
Originally Posted by
mc12345678
I'm still working on things on my end to ensure all that has been done previously remains functional.
YAY!
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
Oddly, one item in our catalog (which we have found so far) has completely wierded out. I've just started investigating the issue, but this is looking pretty big.
One of our products has two options: color and capacity
COLOR:
Black
Blue
Clear
Orange
Pink
Light Pink
CAPACITY
Small (2.5ml)
Large (5.0ml)
The attributes dropdowns that present on the product page:
Capacity
First Select Color
Black
Blue
Clear
Orange
Pink
Light Pink
COLOR
Next select capacity
(no options)
COLOR (note, smaller text size)
First Select Color
Black
Blue
Clear
Orange
Pink
Light Pink
No matter what order we try selecting the attributes, we never reach the state where we can select color and capacity to add it to the cart.
We just noticed that products_with_attributes_stock.product_attribute_combo is being nulled out in an as-yet-unseen pattern. The mentioned product has only one color/capacity combination with this field still populated. We are updating our inventory for imminent site release. We selected an item with product_attribute_combo populated, and updated it's inventory. This did not null product_attribute_combo...
Apologies for the segmented and incomplete info...I'm hoping this will spark a thought for a quick fix.
Quote:
Originally Posted by
mc12345678
Well there is also something else going on there, which I have seen if the tpl_modules_attributes.php file is not merged/replaced correctly. It looks like color options are being applied/listed against capacity and capacity items against color...
I don't understand the statement that products_with_attributes_stock.product_attribute_combo going to null... Doesn't need to be in depth, but helps to follow. :)
I'm still working on things on my end to ensure all that has been done previously remains functional.
Under Configuration->Dynamic Dropdowns->Use ZC default HTML Attribute Tags
set it to false if it is not... Intent of that option is to eventually present the dynamic dropdown information with the tags that are provided by ZC so that formatting can be consistently applied. At the moment it's a series of generic tags...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Under Configuration->Dynamic Dropdowns->Use ZC default HTML Attribute Tags
set it to false if it is not... Intent of that option is to eventually present the dynamic dropdown information with the tags that are provided by ZC so that formatting can be consistently applied. At the moment it's a series of generic tags...
Doesn't exist under Dynamic Dropdowns...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Also found something in the original Dynamic Dropdowns file that may have sorted as was necessary when first developed but has changed since then.
When I was looking two attributes displayed, each had the same sort order, but alphabetically they would/may display in a modified sequence like what you showed above, when using Dynamic Dropdowns I too was seeing that the sequence did not follow the rules set by configuration->product info->Products Info - Products Option Name Sort Order..
I have locally updated the includes/classes/pad_base.php file to be uploaded with some other modifications/simplifications. Trying to clean up code as there are functions/features used in more than one location so would be best to consolidate the code rather than change multiple locations at least until it gets too complicated to keep as a single source.
The change was this for your interest:
includes/classes/pad_base.php
line 315 change from:
Code:
$products_options_name_query = "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_track_stock, popt.products_options_images_style, popt.products_options_type from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id = :products_id: and popt.products_options_id = patrib.options_id and popt.language_id = :languages_id: :stocked_where: order by popt.products_options_sort_order";
to:
Code:
//LPAD - Return the string argument, left-padded with the specified string
//example: LPAD(po.products_options_sort_order,11,"0") the field is 11 digits, and is left padded with 0
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';
}
$products_options_name_query = "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_track_stock, popt.products_options_images_style, popt.products_options_type from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id = :products_id: and popt.products_options_id = patrib.options_id and popt.language_id = :languages_id: :stocked_where:" . $options_order_by;
I do plan on updating the public download version of Dynamic Dropdowns plugin as there *are* some things about it that are broke or no longer accurate, but obviously still working out some of its operations.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
And in the same vein, looked at how the option values are/were sorted... Seems a similar "issue" was there...
So, to address that at "old" line 324 add the code that is below. Providing the code above and below the modification to show context:
Code:
$products_options_name_query = $db->bindVars($products_options_name_query, ':products_id:', $this->products_id, 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':stocked_where:', $stocked_where, 'passthru');
$products_options_name = $db->Execute($products_options_name_query);
$attributes=array();
while (!$products_options_name->EOF) {
$products_options_array = array();
$products_options_query = "select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = :products_id: and pa.options_id = :products_options_id: and pa.options_values_id = pov.products_options_values_id and pov.language_id = :languages_id: order by pa.products_options_sort_order";
$products_options_query = $db->bindVars($products_options_query, ':products_id:', $this->products_id, 'integer');
$products_options_query = $db->bindVars($products_options_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_query = $db->bindVars($products_options_query, ':products_options_id:', $products_options_name->fields['products_options_id'], 'integer');
$products_options = $db->Execute($products_options_query);
Code:
$products_options_name_query = $db->bindVars($products_options_name_query, ':products_id:', $this->products_id, 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':stocked_where:', $stocked_where, 'passthru');
$products_options_name = $db->Execute($products_options_name_query);
$attributes=array();
if (PRODUCTS_OPTIONS_SORT_BY_PRICE == '1') {
$order_by = ' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name';
} else {
$order_by = ' order by LPAD(pa.products_options_sort_order,11,"0"), pa.options_values_price';
}
while (!$products_options_name->EOF) {
$products_options_array = array();
$products_options_query = "select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = :products_id: and pa.options_id = :products_options_id: and pa.options_values_id = pov.products_options_values_id and pov.language_id = :languages_id: :order_by:";
$products_options_query = $db->bindVars($products_options_query, ':products_id:', $this->products_id, 'integer');
$products_options_query = $db->bindVars($products_options_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_query = $db->bindVars($products_options_query, ':products_options_id:', $products_options_name->fields['products_options_id'], 'integer');
$products_options_query = $db->bindVars($products_options_query, ':order_by:', $order_by, 'passthru');
$products_options = $db->Execute($products_options_query);
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
I'll replace it ASAP. I'm knees-deep in another bit of joy.
Looking at products_with_attributes_stock.php, the "unique combo" field is blank, and looks random, but I'm sure it's not...For the product I mentioned, the unique combo was only populated for one attribute combo.
If I look at the table itself (products_with_attributes_stock) in the database, this field (product_attribute_combo) is NULL for some products and attributes, properly populated on others.
YAY!
Ohh, that.. Umm as far as I've seen that particular "list" doesn't support anything... In otherwords unless you are personally using it for something, I wouldn't worry about what is being populated there, but I have seen some cases when generating a combination that the unique combo field hasn't gotten updated. One case I have seen this in was where old data was imported to the table but that field wasn't populated... Further, all of the information that is "captured" in that field is a combination of other fields that already exist. If the data must be regrouped then can probably provide a sql statement to recreate all of the missing data for that field..
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Under Configuration->Dynamic Dropdowns->Use ZC default HTML Attribute Tags
set it to false if it is not... Intent of that option is to eventually present the dynamic dropdown information with the tags that are provided by ZC so that formatting can be consistently applied. At the moment it's a series of generic tags...
Quote:
Originally Posted by
michael_rebreathe
Doesn't exist under Dynamic Dropdowns...
Under Configuration for SBA, run the rebuild/upgrade to repopulate the menu options with what is provided in the plugin. That is one of the options that was added in the process... The existing SBA stock table should remain untouched, but as with all things, please backup before doing so, just in case. :)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Ohh, that.. Umm as far as I've seen that particular "list" doesn't support anything... In otherwords unless you are personally using it for something, I wouldn't worry about what is being populated there, but I have seen some cases when generating a combination that the unique combo field hasn't gotten updated. One case I have seen this in was where old data was imported to the table but that field wasn't populated... Further, all of the information that is "captured" in that field is a combination of other fields that already exist. If the data must be regrouped then can probably provide a sql statement to recreate all of the missing data for that field..
Nice to know it isn't a genuine break...I didn't see anything that broke, but there's a lot of functionality I don't play in on a daily basis. Just 'cuz I didn't see something break because of it still left me concerned.
Yeah, it's a tiny SQL statement to rebuild the column, which I did before I posted the "issue," but wanted to send up the flag just in case it was a monkeywrench. update products_with_attributes_stock set product_attribute_combo = CONCAT(products_id, '-', replace(stock_attributes, ',', '-')) ;
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Under Configuration for SBA, run the rebuild/upgrade to repopulate the menu options with what is provided in the plugin. That is one of the options that was added in the process... The existing SBA stock table should remain untouched, but as with all things, please backup before doing so, just in case. :)
Now, I'm getting really worried...I'm not finding rebuild/upgrade anywhere on stock_by_attr_install.php or products_with_attributes_stock.php. The version of both on the site were updated 12/31/2015 when I updated it the last time.
Installation
Full/Upgrade DB Install
Removal
Remove All from DB
Optional SQL Scripts
Default SQL
Add all Product Attributes
Add display-only product attributes
Add product attributes that are NOT display-only
Remove product attributes that are ONLY read-only
Update Unique Combo field Here's a way to repopulate the field I mentioned earlier
Remove ALL entries from the PAS Table
Tests
File Check
Export / Import
Export Table Data
Import Table Data
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Well there is also something else going on there, which I have seen if the tpl_modules_attributes.php file is not merged/replaced correctly. It looks like color options are being applied/listed against capacity and capacity items against color...
I don't understand the statement that products_with_attributes_stock.product_attribute_combo going to null... Doesn't need to be in depth, but helps to follow. :)
I'm still working on things on my end to ensure all that has been done previously remains functional.
tpl_modules_attributes.php was updated with the last download from GitHub (2015-12-31)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
michael_rebreathe
Now, I'm getting really worried...I'm not finding rebuild/upgrade anywhere on stock_by_attr_install.php or products_with_attributes_stock.php. The version of both on the site were updated 12/31/2015 when I updated it the last time.
Installation
Full/Upgrade DB Install
Removal
Remove All from DB
Optional SQL Scripts
Default SQL
Add all Product Attributes
Add display-only product attributes
Add product attributes that are NOT display-only
Remove product attributes that are ONLY read-only
Update Unique Combo field Here's a way to repopulate the field I mentioned earlier
Remove ALL entries from the PAS Table
Tests
File Check
Export / Import
Export Table Data
Import Table Data
Sorry, I know I should have used exact terminology, but I intended:
Installation
Full/Upgrade DB Install
That has/was written to preserve the existing data table, add any fields that were necessary and redo the configuration options back to "default"...
Sorry for the delayed response, I saw the first hooray and didn't follow up to see if there was more. :). Going to be uploading some more changes (though none to the configuration options) very soon. Trying to verify that I have captured in the fileset what worked on the test site.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Hello, I am running into a small issue with trying to install this on my 1.5.4 Zen cart...I have already backed up my website and made an exact copy of my existing database. I uploaded the files and chose replace existing. I went to the install.php address and logged in to my Zen cart admin area. I selected check files and verified no errors. I selected the Full/Upgrade option and ran the script. Nothing happened...my screen didn't change in display and it never said the database was successfully changed as the directions state would happen. Please advise as I still don't see the SBA option under Catalodg.
I am new to this and REALLY need this add-on to track my inventory.
Alana
Adding: The screen shows SBA Version 1.5.3 for Zen Cart Version 1.5.1. I chose the most recent download which showed that it works with 1.5.4.