-
Re: Stock by Attribute v4.0 addon for v1.5.0-1.5.6
Quote:
Originally Posted by
Lordzoabar
Ok. That all does make sense, and if that's how it has to be, then that's fine. The one thing I'm still a bit confused on, is if I have a set of stock without the image upload (30 total after syncing) and then a set of stock WITH the upload (also synced?)... since the size attribute is what the stock is needing to look at, and the sizes are the same for the 2 variations (2x3 + image and 2x3 alone), is it going to count the stock once, and stay at 30, or is it actually going to double the count? Or do I just leave it unsynced after adding all the image variants?
Realized I didn't entirely answer the last line of questioning. If the variants remained, then syncing again would yes "double" the product quantity or total up the quantity to match the number of product identified by the sum of variants. Further, once the variants with the file were expended, the variants would identify as being empty except for those that didn't have the file, but thaose varaints will be "inaccessible".
-
Re: Stock by Attribute v4.0 addon for v1.5.0-1.5.6
I chose the cop-out method and just dropped the image upload attribute, and re-did the product variants fresh, and that literally fixed every issue. Everything is showing correctly, quantity per variant is showing, and everything on the store side is working and now I'm kicking myself for trying to make it all more complicated than it had need to be. Thanks again!
-
Re: Stock by Attribute v4.0 addon for v1.5.0-1.5.6
Quote:
Originally Posted by
Lordzoabar
I chose the cop-out method and just dropped the image upload attribute, and re-did the product variants fresh, and that literally fixed every issue. Everything is showing correctly, quantity per variant is showing, and everything on the store side is working and now I'm kicking myself for trying to make it all more complicated than it had need to be. Thanks again!
Whatever helps you sell your product and have return customers... Welcome for the assistance and thank you for identifying issues. Don't know what's wrong if someone doesn't say something...
On a side note, in the last couple of days there have been some changes/improvements added into the github repo, one in particular is the addition of returning product that contain customid information from within the search of the store. It adds criteria to the base search rather than taking over that search and without significantly increasing search time at least as seen on a store that had 6000+ variants. The time increase was something on the order of 0.05 seconds or so, very minimal increase.
-
Re: Stock by Attribute v4.0 addon for v1.5.0-1.5.6
Quote:
Originally Posted by
Lordzoabar
So I've managed to get everything installed, merged, and working mostly happily, the only issue I'm getting now is when I try to put in my second attribute variant, the page crashes and I get:
Code:
WARNING: An Error occurred, please refresh the page and try again.If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Logs are showing:
[15-Feb-2020 12:21:32 America/Phoenix] Request URI: /********/products_with_attributes_stock.php?products_id=2804&quantity=3&customid=23523V2&skuTitle=Burl%20Wallet%20Double&attributes=4399,,,&add_edit=add&action=execute, IP address: 47.46.139.205
#1 trigger_error() called at [/home/********/public_html/includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/home/********/public_html/includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/home/********/public_html/includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at [/home/********/public_html/********/includes/classes/products_with_attributes_stock.php:674]
#5 products_with_attributes_stock->insertNewAttribQty() called at [/home/********/public_html/********/products_with_attributes_stock.php:557]
--> PHP Fatal error: 1054:Unknown column '23523V2' in 'where clause' :: SELECT count(*) AS total FROM zen_products_with_attributes_stock WHERE (products_id = 2804 AND stock_attributes = 4399) OR product_attribute_combo = '2804-4399' OR customid = 23523V2 ==> (as called by) /home/********/public_html/********/includes/classes/products_with_attributes_stock.php on line 674 <== in /home/********/public_html/includes/classes/db/mysql/query_factory.php on line 171.
I've checked the Install.php page, run file check, made sure the database updates were run, and everything on that end says there aren't any errors.
In a recent update to the master branch, this has been corrected. There are some other updates as described below.
Quote:
Originally Posted by
Lordzoabar
One other small thing I've noticed. Now when I go to the live product page, the attribute prices are duplicating themselves. They aren't adding themselves to the final price, just displaying twice in the same place.
Attachment 18853
I've taken another swag at resolving this. While it worked as "intended" fo only showing two prices when there was a difference, I have a feeling I missed a test condition.
Other things done in that update, added the ability in the admin window to adjust the quantity of a single variant when that variant is uniquely returned using the search box. If multiple variants match, a notification is made that adjustment is currently not supported (feature to be added) and a notification is made to identify that no results were found to match the search.
Additionally, some of the code was refactored to provide early escape from a procedure, adjust code alignment, etc...
For those using older versions of Zen Cart where I had tried to use the built in sanitization for float type numbers, which was found in some of those earlier Zen Cart versions to not properly handle float type numbers (eg. 1.5), I incorporated some fallback operations to at least sanitize the input to remain as some semblance of a number and centralized the operation to reduce code duplication.
I'm still working on changes to be incorporated to support the expanded capability of the Zen Cart version 1.5.7 attributes file which appears to support incorporation of this module without touching that file. Part of incorporating those capabilities is to continue support of use of an older attributes file in the event an upgrade sustains the older functional version possibly in support of some other module that may not have been upgraded for ZC 1.5.7 or other reason... the file that will be affected by this will be the catalog side observer class.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
cfsheridan
I've done a bit of searching, and cannot find an answer other than a short discussion from 2006.
I sell green coffee by the pound, and the offerings are priced by attributes with 1#, 2#, 5#, 10#, and 20$ quantities offered. The problem is that there is not a stock quantity associated with the attributes, and it does not appear that this mod addresses attribute quantities where all the attribute items are merely different quantities of the same stock item. Does something like that exist, or alternatively, is there a way to price by quantity with discrete amounts available (the weights match my shipping packaging).
Thanks for the help.
site is
www.noquartercoffee.com
I am in a similar situation. We sell products by 1 oz, 4 oz, 16 oz, and kg quantities. The last time I worked with this mod was with 1.39, and things have clearly progressed since then, but I am wondering if something has been resolved to assist for those who sell different weights of the same product. The only thing I could think of when I tried this mod previously was setting the stock to 10,000 or so, and doing the numbers manually. For a site with 600+ products, all of them with different weight options, this becomes an issue of time. I suppose I could make a new category for each product, and do some custom editing to make the last sub-category look like a product page, but ideally there is a better solution. Am I out of luck?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
Koda
I am in a similar situation. We sell products by 1 oz, 4 oz, 16 oz, and kg quantities. The last time I worked with this mod was with 1.39, and things have clearly progressed since then, but I am wondering if something has been resolved to assist for those who sell different weights of the same product. The only thing I could think of when I tried this mod previously was setting the stock to 10,000 or so, and doing the numbers manually. For a site with 600+ products, all of them with different weight options, this becomes an issue of time. I suppose I could make a new category for each product, and do some custom editing to make the last sub-category look like a product page, but ideally there is a better solution. Am I out of luck?
So, yeah, haven't really been asked much about this type characteristic of using attributes. While it is something that could maybe be incorporated, this issue in my opinion is actually outside of what SBA does and is for. This could be addressed by an additional field on the attributes controller to identify either the value that is to be "subtracted" as part of the stock quantity for selecting one instance of that attribute or as a marker to use say the weight value or whatever. Then as stock is decremented, for each instance of that product that the associated "factor" is removed from the total with the total being however much you have to sell...
So if the store has 20 lbs of material, then it could be sold in groups of 1 ounce, 5 ounce, whatever, and as each group is removed the quantity of that group times the "weight" would be subtracted from the total and then the number/weight of that product is the quantity remaining to an extent...
But, no this module does not necessarily do this "math" situation and in my opinion wouldn't necessarily fit into the existing reworked tables until those tables are again split out like they probably should be. Specifically to simplify the listing of items being controlled/managed and separate that from the actually stored data for those managed items.
If on the other hand you only sell so many of each size of the item, then yes this module works for that. As to populating data, there are plenty of mass data populating programs that could make the task easier/faster, but it depends on how hard you wish to make it on yourself.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Preferably trying to keep things simple without needing to dedicate myself to any monthly/yearly plans. I am a huge fan of open source software, so would generally prefer something like this. If you have any recommendations or suggestions, I would be game to hear them. I am near 10 years with my zen business, and figure it is about time to actually start doing things like inventory correctly. Especially if I want to expand and bring in staff. I am more concerned about keeping track of inventory than I am stock of products running low, but nothing wrong with 2 birds with 1 stone.
I imagine I am not the only one who sells items that can be pieced apart and sold in different weights who is dealing with this roadblock. So I am sure there is a solution. It just might be right outside my current reach.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
Koda
Preferably trying to keep things simple without needing to dedicate myself to any monthly/yearly plans. I am a huge fan of open source software, so would generally prefer something like this. If you have any recommendations or suggestions, I would be game to hear them. I am near 10 years with my zen business, and figure it is about time to actually start doing things like inventory correctly. Especially if I want to expand and bring in staff. I am more concerned about keeping track of inventory than I am stock of products running low, but nothing wrong with 2 birds with 1 stone.
I imagine I am not the only one who sells items that can be pieced apart and sold in different weights who is dealing with this roadblock. So I am sure there is a solution. It just might be right outside my current reach.
Check your recent post history and any responses to them, I believe lankeeyankee responded to one about this topic indicating that the solution might be more along the lines of rethinking the problem.
I believe it went something like, if you need to sell your product by weight, then use the quantity in stock to identify your weight and somewhere identify to the customer what units are being used (if that's a script type feature that does conversion for a customer from kg to ounces or something, then so be it), but basically they enter in their desired weight quantity rather than having to consider/plan for attribute style quantities. If want to sell in units of 5 each, then in product setup there is an option to identify the units associated with product quantity and the customer will be required to resolve any unit discrepancy before final checkout...
Whatever the state of your cart, if you are bringing in new people, you will want to be able to pass on to them what it takes for you to do business. if that means that on the first Tuesday of every month you have to stand on one foot with your left index finger on your nose in order to login, then they will need to know that so that they can merrily move along with business or find another job. :) One where the staff are not so weird... :)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
1.5.6c, php 7.1, completely fresh files and my normal template but database upgraded from 1.3.9
after I installed this using the master from github, the attributes disappeared completely from the product info. I'm truly unsure why - there's no error log, no message of any kind on the website. Nothing in the javascript console. The only extra jquery I added I removed It has been a while since i installed this but I don't recall ever seeing anything like this before. The stock_by_attr_install.php still says to look for the instructions folder but of course it is not in the github docs. Guidance please!
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
delia
1.5.6c, php 7.1, completely fresh files and my normal template but database upgraded from 1.3.9
after I installed this using the master from github, the attributes disappeared completely from the product info. I'm truly unsure why - there's no error log, no message of any kind on the website. Nothing in the javascript console. The only extra jquery I added I removed It has been a while since i installed this but I don't recall ever seeing anything like this before. The stock_by_attr_install.php still says to look for the instructions folder but of course it is not in the github docs. Guidance please!
This is *typically* seen (and drawing from memory here) when there has been something that was installed (at some point) where the configuration value of 0 has been removed from the database by some utility. It was supposed to be addressed/corrected in one of the update sql queries like 1.5.4 and/or 1.5.5 to change the storage location in cID 6. There is a "feature" in the SBA configuration to try to restore that same setting. Oye, again from memory it is something like to restore attribute options for dropdowns or the like...
Other thing of note is that the primary file path of includes has files that should be placed in the template overrides directory such as includes/modules/YOUR_TEMPLATE/attributes.php
Will try to look more in a few when get to a computer...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I ran several of the scripts that might be pertinent but no dice so far. I'm okay with waiting as this is driving me crazy
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
delia
I ran several of the scripts that might be pertinent but no dice so far. I'm okay with waiting as this is driving me crazy
Like to try to gather a few facts too. When in option names manager, what attribute types appear?
The oduct affected, what type of attribute was assigned that is not appearing?
Do any product have attributes showing and what type are they?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
It says grid - this site was highly customized in 1.3.9. I don't ever remember seeing grid as an option before. Is it supposed to be that now?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
delia
It says grid - this site was highly customized in 1.3.9. I don't ever remember seeing grid as an option before. Is it supposed to be that now?
The grid software is compatible with SBA, but would need to obtain the latest copy. I haven't tried it recently with php 7.x though. What it does (if weren't aware) is offer two attributes to be presented as a combination on the product info page. There a customer could enter a quantity for each combination (say 1 L-green, 1 S-blue) and then when the product is added to the cart, each of those is added separately but in one submission...
Hmm, shoot, going to have to go back and look at that plugin again...
If though the product only has one attribute set to grid, then it is possible to add multiple "product" each having just that one attribute. That is like looking at the product list where the product doesn't have attributes and entering a quantity for each desired product and then submitting the page.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
good grief! Never mind then. I had removed the attribute grid - stupid! Thanks for your help on this.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
delia
good grief! Never mind then. I had removed the attribute grid - stupid! Thanks for your help on this.
No problem. :) Glad that the cause could be identified (and not specifically this plugin). :)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
i want to turn off the words out of stock next to the attribute value, i tried different settings, always shows
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
jimmie
i want to turn off the words out of stock next to the attribute value, i tried different settings, always shows
As usual, need to know more details about the "setup". How many attributes are applied to the product in question? Ie. How many option names is it one or more than one?
Using the exact verbiage ('Out of Stock:') can find a few things, first is the language define that actually provides that content (In a way why the colon is at the end of that statement, so that it would drive one to potentially make it what is desired instead of default.)
Then from there, searching for example on 'PWA_OUT_OF_STOCK' which is one of the defines with that content: there are two files that result where in one there is a "switch" to turn off the display of that text and in the other, well there does not appear to be a switch at the moment but basically the content is displayed if the quantity available is 0 or less. There was a plan to further modify that control; however, as implemented, it appears like it would take yet another configuration option, or perhaps the existing one would be moved, though that too is/was part of the current plan forwards...
The text could be modified, the code could be changed in the areas where it is to be displayed, and/or perhaps some additional modification.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
jimmie
i want to turn off the words out of stock next to the attribute value, i tried different settings, always shows
The change would be an all or nothing condition, but in this case, because there is one attribute (option name), the change to apply is to delete the text 'Out of Stock:' from the associated define leaving behind just a pair of single quotes instead of single quotes around that text.
I haven't been asked/considered applying a "switch" at each product to support individual control of identifying the attributes as out of stock or not. I do see that the site supports adding such out of stock product to the cart.
One "issue" with doing the above is that let's say 3 out of 4 option values are available and the fourth is really out of stock, the customer will not have knowledge of that until it has been added to the cart... unfortunately a further fix to that with consideration of the above is that yet another condition to consider is to remove out of stock if all are, but leave it if less than all are out of stock...
In the case of this site, it appears that the text could be changed to 'back order' or something similar...
BTW, recommend reviewing the text presented to customers when a back ordered product is added to the cart and the cart is reviewed. There are some grammatical/spelling issues. Ensuring correct spelling helps instill confidence in the site (or at least doesn't lose it as a result of what is presented).
-
1 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Hi everyone sorry for my english, I speak Italian I use google traslator, I ask you for help I updated installed zen cart 1.5.5e Italian version, I inserted the SBA module Version 1.5.4, I loaded all the files correctly and then installed from the path "stock_by_attr_install.php" after I ran the first "full upgrade install" script and immediately after also "non - stock DB Table Install" no error appears, at this point even if I try to create new articles with attributes if I go to the aka page SBA I see the search boxes but no list of articles appears, I get this message: WARNING: An Error occurred, please refresh the page and try again.
I had tested this form before making the transfer by purchasing a web space and it seemed to work, when I actually had to do the transfer it no longer works ... who can help me is 3 days that I try to get out of it but I can't, I'm not an expert, maybe it takes special permissions to folders?
I copy the server data if it can be useful to understand
Host Server: webxc300s02.ad.aruba.it (89.46.109.82)
OS server: Linux 3.10.0-862.2.3.el7.x86_64
Server Date: 05/17/2020 22:07:05
Server Up Time: 22:07:05 up 27 days, 8:37, 0 users, load average: 36.46, 34.61, 40.22
HTTP Server: Apache
PHP Version: 7.0.33 (Zend: 3.0.0)
PHP File Uploads: On
Upload Max Size: 50M
PHP Memory Limit: 256M
POST Max Size: 30M
Database: MySQL 5.7.29-32-log
Host Database: 89.46.111.190 (89.46.111.190)
Database Date: 05/17/2020 22:07:04
Database Data Size: 17,650 kB
Database Index Size: 4,331 kB
MySQL Slow Query Log Status: On
MySQL Slow Query Log File: / var / lib / mysql / mysql1 / slow_queries
MySQL Mode: ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTIONAttachment 18985
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
There should be something in the logs folder.
You also need to check the settings in the two configure.php files. I think something is not right in one of them.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Also when say that downloaded version 1.5.4, could you please identify the Web address used to download the software?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Thanks so much for the quick reply.
the installed version is downloaded from https://github.com/mc12345678/Stock_...butes_Combined
I used the folders for version 1_5_5 and then the admin and includes files.
I have many logs so I did a search for an item in catalog -> aka SBA in order to generate the error I copy below:
[18-May-2020 18:06:03 Europe/Rome] Request URI: /TEST2/password/products_with_attributes_stock.php?search=&pwas-search-button=Search&search_order_by=products_model, IP address: 151.48.100.0
#1 trigger_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/web/htdocs/www.miosito.com/home/TEST2/password/products_with_attributes_stock.php:1012]
[18-May-2020 18:06:03 Europe/Rome] PHP Fatal error: 3065:Expression #1 of ORDER BY clause is not in SELECT list, references column 'Sql1427045_2.d.products_name' which is not in SELECT list; this is incompatible with DISTINCT :: select distinct pa.products_id FROM products_attributes pa, products_description d, products p WHERE d.language_id='2' and pa.products_id = d.products_id and pa.products_id = p.products_id AND ( p.products_id = '' OR d.products_name LIKE '%%' OR p.products_model LIKE '%' ) order by d.products_name ==> (as called by) /web/htdocs/www.miosito.com/home/TEST2/password/products_with_attributes_stock.php on line 1012 <== in /web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php on line 167
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
While I haven't tested this suggested change yet and I recognize that the above query was last incorporated when the database was *not* set to provide STRICT type operations, do you think you could try this revision?
In the current fileset (unchanged for a while now), the query that is assembled to give that result begins on line 1123 which is 10 lines before the query is executed. I would say then that if you were to go to line 1002 of your current admin/products_with_attributes_stock.php file and change the code from:
Code:
$query_products = "SELECT distinct pa.products_id
To:
Code:
$query_products = "SELECT distinct pa.products_id, d.products_name
By adding the comma and the additional field name, that perhaps the issue in this query would go away?
Note also, that as of this "second" the github fileset has not yet been updated to reflect that change either. I'll take a look as soon I can especially at any new queries to ensure they are "strict"-like compatible.
Could you
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
after you suggested modification I have this log:
[18-May-2020 20:07:47 Europe/Rome] Request URI: /TEST2/password/products_with_attributes_stock.php?search_order_by=products_model, IP address: 151.48.100.0
#1 trigger_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/web/htdocs/www.miosito.com/home/TEST2/password/includes/classes/products_with_attributes_stock.php:399]
#5 products_with_attributes_stock->displayFilteredRows() called at [/web/htdocs/www.miosito.com/home/TEST2/password/products_with_attributes_stock.php:1278]
[18-May-2020 20:07:47 Europe/Rome] PHP Fatal error: 3065:Expression #1 of ORDER BY clause is not in SELECT list, references column 'Sql1427045_2.po.products_options_sort_order' which is not in SELECT list; this is incompatible with DISTINCT :: SELECT DISTINCT pa.products_attributes_id
FROM products_attributes pa
LEFT JOIN products_options po on (po.products_options_id = pa.options_id)
WHERE pa.products_attributes_id in (1918)
order by LPAD(po.products_options_sort_order,11,"0"), po.products_options_name ==> (as called by) /web/htdocs/www.miosito.com/home/TEST2/password/includes/classes/products_with_attributes_stock.php on line 399 <== in /web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php on line 167
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Instead of addressing each one at a time, I have put together a commit/PR to address this issue that was introduced into the admin variant handler. It can be found here: https://github.com/mc12345678/Stock_By_Attributes_Combined/pull/70/files
The red represents areas "removed" the green are areas added... Also the line numbers are based off of the software there in github and may differ from what you have on your system, but the surrounding code should relatively relate.
-
4 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Thanks for your time.
i downloaded latest version on https://github.com
I made the changes you sent.
I performed a new 1.5.5e Italian FE installation, I loaded the sample products in the shop, I uploaded the Stock_By_Attributes_Combined-master files, I ran SBA setup link -> full / upgrade DB install dynamic drop down and here I check the first one problem seen in photos Configuration -> Dynamic drop downs I can't find anything Attachment 18990
after install from -> SBA setup link -> non-stock DB table install and now it appears
Attachment 18991
if now I go to Catalog -> aka SBA the list appears but without division of the attributes and quantity
Attachment 18993
if i try to load quantities in any item i return to error.
Attachment 18994.
the only way to remove the error is to remove everything from the db.
help me understand what and where am i wrong i made the steps many times always same problem. copy last log:
[19-May-2020 02:31:15 Europe/Rome] Request URI: /TEST/Password/products_with_attributes_stock.php, IP address: 151.48.100.0
#1 trigger_error() called at [/web/htdocs/www.miosito.com/home/TEST/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/web/htdocs/www.miosito.com/home/TEST/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/web/htdocs/www.miosito.com/home/TEST/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/web/htdocs/www.miosito.com/home/TEST/Password/includes/classes/products_with_attributes_stock.php:454]
#5 products_with_attributes_stock->displayFilteredRows() called at [/web/htdocs/www.miosito.com/home/TEST/Password/products_with_attributes_stock.php:1411]
[19-May-2020 02:31:15 Europe/Rome] PHP Fatal error: 3065:Expression #1 of ORDER BY clause is not in SELECT list, references column 'Sql1427045_5.po.products_options_sort_order' which is not in SELECT list; this is incompatible with DISTINCT :: SELECT DISTINCT pa.products_attributes_id
FROM products_attributes pa
LEFT JOIN products_options po on (po.products_options_id = pa.options_id)
WHERE pa.products_attributes_id in (1037)
ORDER BY LPAD(po.products_options_sort_order,11,"0"), po.products_options_name ==> (as called by) /web/htdocs/www.miosito.com/home/TEST/password/includes/classes/products_with_attributes_stock.php on line 454 <== in /web/htdocs/www.miosito.com/home/TEST/includes/classes/db/mysql/query_factory.php on line 167
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Added some more changes to the same link above (meaning, recommend going back over those changes and incorporating them)...
Found another query that used distinct with order by/group by but did not include the field(s) in the select portion of the query and then as part of that found that some of the tables referenced used a different "prefix" or table reference than other references to the same table so I made the table references consistent and needed to add some field "controls".
Hopefully there are no others found, but if so, please report.
-
1 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Thank you very much for your work, all the problems I had have disappeared thank you thank you, I found that the attributes are duplicated I attach photos. I keep testing if everything is fine, and then I confirm if everything is ok.
Thank you for your support.Attachment 18995
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
snakes7575
Thank you very much for your work, all the problems I had have disappeared thank you thank you, I found that the attributes are duplicated I attach photos. I keep testing if everything is fine, and then I confirm if everything is ok.
Thank you for your support.
Attachment 18995
Based on discussion of English being a second language, I assume that the site also has at least two languages? I believe it is because there are two or more languages (and not quite sufficient handling of the additional language(s)) that there are two option names shown for every record.
I am preparing another code change to possibly address this. I would be interested to see the result when a product has two or more option names assigned to it and the site uses two or more languages.
I hope that it would display as:
lang1: Option 1
lang1: Option 2
lang2: Option 1
lang2: Option 2
or in the sequence associated with that language as it is possible in different languages to have a different sort order for the option names. Currently it displays or is expected to display in the language of the current session which is further why I believe that what is being seen is from a site having multiple languages (and how the code is currently written).
Note that what is further seen is that regardless the language, there are only so many of a product and that quantity is not dependent on "language".
The PR to review this possible solution is: https://github.com/mc12345678/Stock_By_Attributes_Combined/pull/74/files
-
1 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I understand, my shop has 2 languages English and Italian, to speed up I did not carry out the attributes in English if I had I would have realized that it is useful and the correct reference.
although it's okay as you made the double names initially, I modified as you suggested admin / includes / classes / products_with_attributes_stock.php but unfortunately I get the main error I attach photos
Attachment 18996
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
snakes7575
I understand, my shop has 2 languages English and Italian, to speed up I did not carry out the attributes in English if I had I would have realized that it is useful and the correct reference.
although it's okay as you made the double names initially, I modified as you suggested admin / includes / classes / products_with_attributes_stock.php but unfortunately I get the main error I attach photos
Attachment 18996
What about the log file that is generated when that happens? Please sanitize the admin folder name out of the result. I am curious about what it identifies as my test site (which only has one language installed) is running with that code change and is not having an issue and I would like to be able to merge that change into the master fileset.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I just reloaded deleted the logs and rerun and your file on the first screen from error as a photo already sent, here is the log I hope is correct.
[21-May-2020 23:35:34 Europe/Rome] Request URI: /TEST2/password/products_with_attributes_stock.php?products_filter=279¤t_category_id=97, IP address: 151.20.130.237
#1 trigger_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/web/htdocs/www.miosito.com/home/TEST2/password/includes/classes/products_with_attributes_stock.php:468]
#5 products_with_attributes_stock->displayFilteredRows() called at [/web/htdocs/www.miosito.com/home/TEST2/password/products_with_attributes_stock.php:1417]
[21-May-2020 23:35:34 Europe/Rome] PHP Fatal error: 1055:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'Sql1427045_2.pa.products_attributes_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by :: SELECT DISTINCT pa.products_attributes_id, po.products_options_sort_order, po.products_options_name
, po.language_id
FROM products_attributes pa
LEFT JOIN products_options po on (po.products_options_id = pa.options_id)
WHERE pa.products_attributes_id in (1545,1547)
GROUP BY po.language_id
ORDER BY LPAD(po.products_options_sort_order,11,"0"), po.products_options_name ==> (as called by) /web/htdocs/www.miosito.com/home/TEST2/password/includes/classes/products_with_attributes_stock.php on line 468 <== in /web/htdocs/www.miosito.com/home/TEST2/includes/classes/db/mysql/query_factory.php on line 167
-
1 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
as soon as you press on catalog -> SBA aka the error occurs, on some articles pressing on search finds them as in the picture.
others find nothing, if instead I press catalog -> sba aka all the articles come out and if I turn page by page there are all the articles. only on search does not find them
Attachment 18997
[22-May-2020 00:18:53 Europe/Rome] Request URI: /password/products_with_attributes_stock.php?products_filter=311¤t_category_id=72, IP address: 151.20.130.237
#1 trigger_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/web/htdocs/www.miosito.com/home/password/includes/classes/products_with_attributes_stock.php:468]
#5 products_with_attributes_stock->displayFilteredRows() called at [/web/htdocs/www.miosito.com/home/password/products_with_attributes_stock.php:1417]
[22-May-2020 00:18:53 Europe/Rome] PHP Fatal error: 1055:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'Sql1427045_1.pa.products_attributes_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by :: SELECT DISTINCT pa.products_attributes_id, po.products_options_sort_order, po.products_options_name
, po.language_id
FROM products_attributes pa
LEFT JOIN products_options po on (po.products_options_id = pa.options_id)
WHERE pa.products_attributes_id in (1675,1677)
GROUP BY po.language_id
ORDER BY LPAD(po.products_options_sort_order,11,"0"), po.products_options_name ==> (as called by) /web/htdocs/www.miosito.com/home/password/includes/classes/products_with_attributes_stock.php on line 468 <== in /web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php on line 167
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
snakes7575
as soon as you press on catalog -> SBA aka the error occurs, on some articles pressing on search finds them as in the picture.
others find nothing, if instead I press catalog -> sba aka all the articles come out and if I turn page by page there are all the articles. only on search does not find them
Attachment 18997
[22-May-2020 00:18:53 Europe/Rome] Request URI: /password/products_with_attributes_stock.php?products_filter=311¤t_category_id=72, IP address: 151.20.130.237
#1 trigger_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/web/htdocs/www.miosito.com/home/password/includes/classes/products_with_attributes_stock.php:468]
#5 products_with_attributes_stock->displayFilteredRows() called at [/web/htdocs/www.miosito.com/home/password/products_with_attributes_stock.php:1417]
[22-May-2020 00:18:53 Europe/Rome] PHP Fatal error: 1055:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'Sql1427045_1.pa.products_attributes_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by :: SELECT DISTINCT pa.products_attributes_id, po.products_options_sort_order, po.products_options_name
, po.language_id
FROM products_attributes pa
LEFT JOIN products_options po on (po.products_options_id = pa.options_id)
WHERE pa.products_attributes_id in (1675,1677)
GROUP BY po.language_id
ORDER BY LPAD(po.products_options_sort_order,11,"0"), po.products_options_name ==> (as called by) /web/htdocs/www.miosito.com/home/password/includes/classes/products_with_attributes_stock.php on line 468 <== in /web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php on line 167
Thanks for the log(s). I thought that I had the catalog side set to use ONLY_FULL_GROUP_BY, but definitely did not have my admin side set for that. I have updated the query (adding just the content between the quotes ', pa.products_attibutes_id' just after the newly added 'GROUP BY po.language_id' statement. so that line now reads:
Code:
GROUP BY po.language_id, pa.products_attributes_id
I have tested this rewritten query with the same settings identifying that it works as rewritten (latest rewrite) and had the same issue as reported above when written as I first suggested.
Again, thank you for identifying those issues.
-
2 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
thank you for your time and patience.
I also added the last modification you made in the previous post, I'm continuing to try and I noticed that if I make the quantity available in the warehouse appear on the selection of the attribute, they are replicated 2 times, I attach photos.
Attachment 19000
if instead the article has multiple attributes then it works I attach photos
Attachment 19001
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
snakes7575
thank you for your time and patience.
I also added the last modification you made in the previous post, I'm continuing to try and I noticed that if I make the quantity available in the warehouse appear on the selection of the attribute, they are replicated 2 times, I attach photos.
Attachment 19000
if instead the article has multiple attributes then it works I attach photos
Attachment 19001
I haven't' been able to duplicate the problem in the first picture yet, but am continuing to try.
The issue there is something related with the process of generating/displaying the Single SBA Select List (Dropdown) Basic type selector as compared to Dynamic Dropdowns. I'll look to see what modifications are on my site that are not in the fileset, although I have been working on what is needed to support ZC 1.5.7 and to not need to edit the attributes.php file which means I may have some modification on my system not yet captured in the distribution, but this also seems like the first I've heard of this issue. Not sure if possibly related to the multiple languages aspect...
It does appear though that the option name type is a standard dropdown instead of the recommended SBA Select List (Simple Dropdown). This can be altered in catalog->Option Names Manager for the associated Option Name.
-
4 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Thank you for your answer,
thinking I did something wrong in my shop I reinstalled the demo shop with only SBA module, the problem is repeated but other errors happen I send you photos
Attachment 19003
if I duplicate an article from the catalog, they double the attributes
Attachment 19004
then if I go to see in catalog -> SBA link an attribute with empty space is generated
Attachment 19005
if I duplicate an article with multiple attributes, this is what you see in the picture
Attachment 19006
I hope the information I send you will help you solve the problem. thanks for your help
-
3 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
I also find that if the dropdown set is on 1 or 3 I get an error
Attachment 19007
Attachment 19008
Attachment 19009
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
snakes7575
Not too much of a surprise on the 1/3 setting. Options are provided for those that personally require or have some other need to basically use dynamic dropdowns to handle single attribute product instead of the alternate method that was developed by potteryhouse. Nice to know, but at the moment is not a show stopper. There are even other dropdown type selections possible that may not work with such a strict database, potentially strict php setting...
As to the issues seen on the admin side of additional "blank" fields, I'm still looking into what is/did cause that. Seems unusual indeed. There is something going on that seems to be allowing earlier records to be visible with this new "product" even though there seems to be no reason for that earlier record to be shown with this new one... Further because those records that are blank have a lower record ID I suspect that they were created earlier and then just now associated with a new record otherwise there is something that is modifying existing records and providing the unusual results.
What I might suggest doing is to export the PWAS table (recommend using phpmyadmin or something similar to ensure retrieval of the full table), then performing one of those operations that have caused what is seen. Export the table again and compare to see if/what changed in the exisitn records...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
snakes7575
I have resolved this one issue I believe with https://github.com/mc12345678/Stock_By_Attributes_Combined/pull/76/files
Operation is expected to be with the default settings in Dynamic Dropdown at least for selection of what handles what type of attributes, with selections made from things such as to display available stock or not, etc...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
snakes7575
thank you for your time and patience.
I also added the last modification you made in the previous post, I'm continuing to try and I noticed that if I make the quantity available in the warehouse appear on the selection of the attribute, they are replicated 2 times, I attach photos.
Attachment 19000
if instead the article has multiple attributes then it works I attach photos
Attachment 19001
Found where this issue is generated. Apparently in my test site I've been working on/with attempting to display the customid on the "left" which caused this issue to be "hidden".
in the file: includes/classes/observers/class.products_with_attributes_stock.php
When I reverted to the default of customid being displayed on the right as assigned in lines 15-17:
Code:
if (!defined('PWA_DISPLAY_CUSTOMID')) {
define('PWA_DISPLAY_CUSTOMID', 'right'); // Three values currently used: 'right', 'left', or ''. Original design considered right.
}
I was able to see the problem you described and showed above.
If you do nothing else, then modify line 480 of: includes/classes/observers/class.products_with_attributes_stock.php
from:
Code:
$products_options_display_price .= $originalpricedisplaytext . $PWA_STOCK_QTY;
to:
Code:
$products_options_display_price .= $originalpricedisplaytext;
And this should resolve the issue of the duplicate information on the right side of the text...
But if you would like to see a more comprehensive incorporation/ability to place information, then may I suggest the below which I would like to merge into the master if someone else identifies successful use or provides comment in github.
I'm still working on more properly incorporating the ability to sequence the displayed information. It appears that at some point I originally intended the customid to possibly be displayed at the beginning of the text or at the end; however, looking at the various pieces that are put together, it appears that more control is needed. I've addressed the above as well as added some additional placement options (when using a single attribute type display such as the option name type: SBA Select List (Dropdown) Basic) with the changes found at: https://github.com/mc12345678/Stock_.../pull/79/files
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
55/5000
Thanks a lot, this is ok I just tried it and it works
-
1 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
this works eliminates double quantities if I copy what you posted here.
HTML Code:
$products_options_display_price .= $originalpricedisplaytext;
if instead I carry out the complete modification on gitub it gives me a blank page with a syntax error
Attachment 19010
[27-May-2020 01:56:06 Europe/Rome] PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting ',' or ';' in /web/htdocs/www.miosito.com/home/includes/classes/observers/class.products_with_attributes_stock.php on line 60
-
1 Attachment(s)
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
I found another error I try to explain it to you, in catalog -> SBA aka if I press the link sort
Attachment 19011
copy error log
[27-May-2020 02:14:37 Europe/Rome] Request URI: /admin/products_with_attributes_stock.php?action=auto_sort&search_order_by=p.products_m odel, IP address: 151.64.208.91
#1 trigger_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/web/htdocs/www.miosito.com/home/admin/products_with_attributes_stock.php:695]
[27-May-2020 02:14:37 Europe/Rome] PHP Fatal error: 1366:Incorrect integer value: '' for column 'sort' at row 1 :: UPDATE products_with_attributes_stock set sort = '' WHERE stock_id = '3' LIMIT 1; ==> (as called by) /web/htdocs/www.miosito.com/home/admin/products_with_attributes_stock.php on line 695 <== in /web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php on line 167
For me the modolu SBA after last modification is fine and it is fantastic and thank you very much for creating it, I am trying everything in your form for any errors that I will report as I find them, explaining the best I can. thanks again I continue my test...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5+
Quote:
Originally Posted by
snakes7575
this works eliminates double quantities if I copy what you posted here.
HTML Code:
$products_options_display_price .= $originalpricedisplaytext;
if instead I carry out the complete modification on gitub it gives me a blank page with a syntax error
Attachment 19010
[27-May-2020 01:56:06 Europe/Rome] PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting ',' or ';' in /web/htdocs/www.miosito.com/home/includes/classes/observers/class.products_with_attributes_stock.php on line 60
Interesting. While I have some additional "future" code after that line, I don't get any errors logged even though the line is incorrect as plain as day... it is missing a semi-colon (;) at the end. I'm force pushing that instead of creating another commit.
Thank you for letting me know. I mean I'm running on php 7.4.3, strict php reporting, now have the database using that same full group sort by setting or whatever it is/was, and I'm not notified of a generic typo until someone half way across the world tries to apply the same changes? Sheesh... thank you for your feedback though. :)
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
snakes7575
I found another error I try to explain it to you, in catalog -> SBA aka if I press the link sort
Attachment 19011
copy error log
[27-May-2020 02:14:37 Europe/Rome] Request URI: /admin/products_with_attributes_stock.php?action=auto_sort&search_order_by=p.products_m odel, IP address: 151.64.208.91
#1 trigger_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/web/htdocs/www.miosito.com/home/admin/products_with_attributes_stock.php:695]
[27-May-2020 02:14:37 Europe/Rome] PHP Fatal error: 1366:Incorrect integer value: '' for column 'sort' at row 1 :: UPDATE products_with_attributes_stock set sort = '' WHERE stock_id = '3' LIMIT 1; ==> (as called by) /web/htdocs/www.miosito.com/home/admin/products_with_attributes_stock.php on line 695 <== in /web/htdocs/www.miosito.com/home/includes/classes/db/mysql/query_factory.php on line 167
For me the modolu SBA after last modification is fine and it is fantastic and thank you very much for creating it, I am trying everything in your form for any errors that I will report as I find them, explaining the best I can. thanks again I continue my test...
Hmm. Trying to remember why I wrote this the way I did...
Basically it oges: if there are no records to report, set the sort order to the non-existent value and then increment on it... I guess what I was trying to do was to request the software to use the default value for the field instead of trying to always use a field value of zero.. Really at the time it came down to seeing that it worked in the environment that was used to test.
While currently a value of 0 can be substituted (or the value "unnecessarily" cast as an integer) I do plan to further implement the targetted goal of identifying the expected value to implement the potential of the table having an other than 0 default value...
-
3 Attachment(s)
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
hello, in the photo you can see the attributes (colors) of an article in this case SBA is in Off selector 0, if it is selected in position 2 it is not possible to see the images of the attributes as in the photo
Attachment 19014
also that it is in position 0 or in position 2 when I insert an article with image attributes in the shopping cart I display not the main photo but the attribute (color) as seen in the photo
Attachment 19015
this selector, next photo, I believe it allows the exchange, but it does not work in any position
Attachment 19016
I would like if you can see as in the first photo with image attributes (colors) SBA activated position 2 and view quantities available in the warehouse, and when you insert it in the cart see the main image of the item not that of the attribute (color)
can you please check if everything is correct thanks so much for your availability
-
2 Attachment(s)
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
I found another selector that generates an error maybe you are already aware of it if it is so sorry,
if I select true
Attachment 19017
I get as in the photo
Attachment 19018
I think I have tried everything, I hope I have not missed anything else, the rest is all ok.
I have seen that there is also a way to export the table to CSV file, in your experience it would be possible in the future to do a similar thing but obtaining article name attributes and quantities with name instead of ID codes, it would be very useful to have a list for inventory to print
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
snakes7575
hello, in the photo you can see the attributes (colors) of an article in this case SBA is in Off selector 0, if it is selected in position 2 it is not possible to see the images of the attributes as in the photo
Attachment 19014
also that it is in position 0 or in position 2 when I insert an article with image attributes in the shopping cart I display not the main photo but the attribute (color) as seen in the photo
Attachment 19015
this selector, next photo, I believe it allows the exchange, but it does not work in any position
Attachment 19016
I would like if you can see as in the first photo with image attributes (colors) SBA activated position 2 and view quantities available in the warehouse, and when you insert it in the cart see the main image of the item not that of the attribute (color)
can you please check if everything is correct thanks so much for your availability
The image swapping is intended to work for the SBA simple Select (dropdown) option name type. As I believe I commented earlier, the option name type for this/these attributes (catalog->option name manager) should be changed away from the first option in the list which is dropdown to the one that has been added for SBA. As for the swap occurring on the shopping cart page, there currently is no admin switch to disable the swap. The capability is provided and it can be disabled by code. That said, I have locally written some extra code to disable the swap if the option is set to 0.
Again, that selector is the correct one, but the swap on the product information page will only occur when the dropdown type is the SBA dropdown. There is also a separate plugin for attribute image swapping that works with SBA (I actually had to disable it to track down the issue(s) above).
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
feature request, id like to see a function that changes the model number on product info page when image is swapped or selection is made.
-
1 Attachment(s)
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
The image swapping is intended to work for the SBA simple Select (dropdown) option name type. As I believe I commented earlier, the option name type for this/these attributes (catalog->option name manager) should be changed away from the first option in the list which is dropdown to the one that has been added for SBA. As for the swap occurring on the shopping cart page, there currently is no admin switch to disable the swap. The capability is provided and it can be disabled by code. That said, I have locally written some extra code to disable the swap if the option is set to 0.
Again, that selector is the correct one, but the swap on the product information page will only occur when the dropdown type is the SBA dropdown. There is also a separate plugin for attribute image swapping that works with SBA (I actually had to disable it to track down the issue(s) above).
I'm sorry, I tried to try alone to solve this last problem of mine, maybe the translation of google traslator is wrong or it is I who am I can not understand.
I ask you for help, I read and reread what you wrote and I tried before writing again, but for me it is too difficult.
I try to explain myself:
I go to catalog -> option name manager type of option SBA Select List (Dropdown) Basic settings as in the photo
Attachment 19025
The visualization of the image attributes (colors) in the article page, I only get it with single attributes, or with Dynamic DropDowns off (0) if I have multiple attributes (sizes + Colors) I cannot get the display of the attributes (color images ), my shop must have size and color, the colors I wanted to see on the product page. Is this possible with SBA?
to disable the exchange of the original image with the attribute (color) on the cart page, I understood that I have to manually change the code to 0 but I did not understand in which file I must search.
Forgive me but I can't solve it, thanks again for your help.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
snakes7575
I'm sorry, I tried to try alone to solve this last problem of mine, maybe the translation of google traslator is wrong or it is I who am I can not understand.
I ask you for help, I read and reread what you wrote and I tried before writing again, but for me it is too difficult.
I try to explain myself:
I go to catalog -> option name manager type of option SBA Select List (Dropdown) Basic settings as in the photo
Attachment 19025
The visualization of the image attributes (colors) in the article page, I only get it with single attributes, or with Dynamic DropDowns off (0) if I have multiple attributes (sizes + Colors) I cannot get the display of the attributes (color images ), my shop must have size and color, the colors I wanted to see on the product page. Is this possible with SBA?
to disable the exchange of the original image with the attribute (color) on the cart page, I understood that I have to manually change the code to 0 but I did not understand in which file I must search.
Forgive me but I can't solve it, thanks again for your help.
Actually, that was very well stated and I fully understood it.
The problem is that currently Dynamic Dropdowns does not fully support image swapping without making some code modifications. I've worked out something of a solution, but there also are a number of ways for images to be captured/stored for display, whether it is stacking images atop each other, merging the images as appropriate and storing those merged images, etc...
Right now I have it so that as an option is changed the image changes either to the image that is assigned in the attributes controller for that one option value. I am trying to identify a way to do a lookup based on the selected attributes; however, I'm getting to a turning point where I may have to do a bit of work to make that happen, not to mention that I will need to modify one of the tables and add features in the admin to be able to address/update the images.
I was able to make a minor modification to the code to support attributes image swap for dynamic dropdowns; however, as identified image swapping seems to work for multi-attribute product, provided dynamic dropdowns are not active which also has an impact on customer interaction..
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Actually, that was very well stated and I fully understood it.
The problem is that currently Dynamic Dropdowns does not fully support image swapping without making some code modifications. I've worked out something of a solution, but there also are a number of ways for images to be captured/stored for display, whether it is stacking images atop each other, merging the images as appropriate and storing those merged images, etc...
Right now I have it so that as an option is changed the image changes either to the image that is assigned in the attributes controller for that one option value. I am trying to identify a way to do a lookup based on the selected attributes; however, I'm getting to a turning point where I may have to do a bit of work to make that happen, not to mention that I will need to modify one of the tables and add features in the admin to be able to address/update the images.
I was able to make a minor modification to the code to support attributes image swap for dynamic dropdowns; however, as identified image swapping seems to work for multi-attribute product, provided dynamic dropdowns are not active which also has an impact on customer interaction..
Thank you MC for your answer and explanation, sorry but I did not understand initially I thought of my configuration error.
I will observe github when you make new changes.
Thanks for your patience and the work you do.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
jimmie
feature request, id like to see a function that changes the model number on product info page when image is swapped or selection is made.
There is a function that returns the customid/model number based on provided attributes.. The missing part is the screen update based on the selections... Still a little unsure about whether to incorporate directly into here (where some additional "monitoring" code is necessary) or say in Dynamic Price Updater which collects the information and has a general way to replace the desired data but does not yet attempt to access the model information.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Is it compatible with zen1.5.6c?
I downloaded Stock_By_Attributes_Combined-master and installed it on zen1.5.6c.
However, "All - Attributes - Combo " is not working even though there are 2 attribute groups.
However "All - Attributes" is working.
Just let me know whether it is compatible with zen1.5.6c?
Thanks.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
sungmo
Is it compatible with zen1.5.6c?
I downloaded Stock_By_Attributes_Combined-master and installed it on zen1.5.6c.
However, "All - Attributes - Combo " is not working even though there are 2 attribute groups.
However "All - Attributes" is working.
Just let me know whether it is compatible with zen1.5.6c?
Thanks.
What do you mean by "not working"?
Yes, the software as provided also works with ZC 1.5.6c. In fact I'm working on its compatibility with ZC 1.5.7 where the biggest change is that the includes/modules/attributes.php file appears to not require any overload which at least reduces the number of files by one. :)
Anyways, what is being seen and what is expected when using the all attributes - combo selection(s)?
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
What do you mean by "not working"?
Yes, the software as provided also works with ZC 1.5.6c. In fact I'm working on its compatibility with ZC 1.5.7 where the biggest change is that the includes/modules/attributes.php file appears to not require any overload which at least reduces the number of files by one. :)
Anyways, what is being seen and what is expected when using the all attributes - combo selection(s)?
thanks for your reply..
and below link will show you what i mean.
https://youtu.be/VR2qYc1HlFU
First. i choose "All - Attributes" for color then I typed 200 for quantity.
then i clicked "Sync Quantities" it worked. and i can see all variants. that is what i want.
Second, I choose "All - Attributes - Combo" for color and Size then i typed 2 for quantity.
then i clicked "Sync Quantities". after that i can not see all variants anymore. it disappeared. I can not edit the quantity.
Third, Can i search with "Product Name"?
thanks and please let me know why All - Attributes - Combo is not working.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
kuroi
To put this add-on in context, it is a stop gap. This feature is scheduled to be added to the next major release of Zen Cart, and probably in a rather more integrated way than is appropriate for an add-on such as this. Furthermore the add-on from which this was adapted has a major flaw in its table structure, which I am sure the Zen Cart team will not replicate.
So I have no desire to add extra functionality that will probably have a very short shelf life, may not be included in the Zen Cart solution anyway and might make future conversion to the differently structured and more integrated Zen Cart version more complex. So please don't post requests for new functionality in this support thread.
However, if you are having problems installing or using the add-on or think that there are errors / bugs in it, then your posts will be welcome.
Hi, I'm looking at my options here for this type of functionality. I note the age of this post (2006), as well as the latest updates to SbA add-on being in 2014. Has this functionality been integrated into Zen Cart 1.5.6c? If not, is there a road-map as to what version (noting ZC 1.5.7 is just around the corner?).
appreciate any thoughts on this.
Thanks,
Chris
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
gohealth
Hi, I'm looking at my options here for this type of functionality. I note the age of this post (2006), as well as the latest updates to SbA add-on being in 2014. Has this functionality been integrated into Zen Cart 1.5.6c? If not, is there a road-map as to what version (noting ZC 1.5.7 is just around the corner?).
appreciate any thoughts on this.
Thanks,
Chris
Ummmm... Great that looking wayyyyyyyyy back at posts on this thread... Wondering, have any of the more recent posts been reviewed (excluding the last 3 posts as there are plenty of others before that which were successful)? At least to identify the operability with ZC 1.5.6c?
I can't speak to ZC team incorporating with core code, but I am seeing that there are ever more possible ways to incorporate it without touching core files... In fact with ZC 1.5.7 it will be possible to incorporate without any modifications (or overrides) to includes/modules/attributes.php.
As to a "flaw" in the database structure? I agree, though it does seem like it is becoming "easier" to be able to transition to a more appropriate database structure because the code is becoming more "compartmentalized". There are two "major" portions to address/overcome. The customer front end display of the attribute selections (needs to be more javascript related and less "hard-coded") and then the admin facility actually needs more information displayed to better understand what variations exist.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
Ummmm... Great that looking wayyyyyyyyy back at posts on this thread... Wondering, have any of the more recent posts been reviewed (excluding the last 3 posts as there are plenty of others before that which were successful)? At least to identify the operability with ZC 1.5.6c?
I can't speak to ZC team incorporating with core code, but I am seeing that there are ever more possible ways to incorporate it without touching core files... In fact with ZC 1.5.7 it will be possible to incorporate without any modifications (or overrides) to includes/modules/attributes.php.
Ok, a fair comment if I was looking for the compatibility of this module. That was not my question. My purpose to going wayyyyyy back was to ascertain if the ZC team had incorporated any of this functionality as standard, even the very basic function at some point prior. Noting that, a lot of the add-ons and extensions provide similar functionality to standard (some gets pulled in at some point). So, it could very well be that ZC 1.5.6c (1.5.7 or 1.5.8 or earlier!) does cater for a similar feature, just not as rich as this module. Hope that clarifies why trolling through 3000 entries was really not getting anywhere. Also, there are a fair few forums related to this add-on, with the heading of this one being quite confusing really as "THE" forum for version SbA 4.7 on Zen Cart 1.5.x.
Thanks for the feedback.
Chris
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
"All - Attributes - Combo" does not work.
Please see below link. if you want to see my dashboard i can give you the information.
https://youtu.be/VR2qYc1HlFU
please let me know how to solve this problem?
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
sungmo
"All - Attributes - Combo" does not work.
Please see below link. if you want to see my dashboard i can give you the information.
https://youtu.be/VR2qYc1HlFU
please let me know how to solve this problem?
As I said before, I saw the video but had been unable to recreate the problem.
I certainly can take a look at the files (via FTP) and as permitted access to the admin screen to at least reach the SBA menu. Credentials can be sent via PM as necessary.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
As I said before, I saw the video but had been unable to recreate the problem.
I certainly can take a look at the files (via FTP) and as permitted access to the admin screen to at least reach the SBA menu. Credentials can be sent via PM as necessary.
I sent you all information to access admin and FTP
Thanks...
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
sungmo
"All - Attributes - Combo" does not work.##
Please see below link. if you want to see my dashboard i can give you the information.
https://youtu.be/VR2qYc1HlFU
please let me know how to solve this problem?
From the looks of it, the database had an issue that helped to chase down a possible issue and provide a resolution.
So, in the admin, when a combination was found to try to attach to the pwas table, but the combination is not possible then it is/was to remove that group(ing). In this database there were two languages at some point added and attributes used, but then the languages were removed and some remnant remained. (install/removal is assumed)
The fix was to force determination of the number of records returned from one query instead of identifying that at the end of the file (caching issue?), and the other was to do an early return when it is determined that there are no results as compared to finding a sort of blank set of results.##
What was happening was that with the extra database information, upon the request to create the combinations, all of the available/associated combinations were being created and they were being displayed (seems that the cache may have supported proving that the combinations were correct). Then when the screen was updated/listings made to be displayed, the queries involved caused the function to return an empty set of data instead of populating an array. Then because it was empty, the logic was to remove that combination of items because something happened to the source data to negate the allowance of that combination and therefore the variant is/was to be removed.##
In a way, the issue was "planned" to occur, though not so abruptly. It was expected that the queries wouldn't result in a EOF condition immediately after Execute where there are/were records in the query. Unfortunately (geekspeak) a RecordCount requires operations be executed as compared to EOF which returns the current/last variable condition.
Anyways, I've applied the change to the master branch. It doesn't "fix" the database problem and doesn't notify of it either, but it does allow the program to operate and not be seen as the problem causer. It just rolls along with the problem. :)
-
2 Attachment(s)
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
ZenCart 1.5.4
Hi everyone,
Does somebody can tell me why I can't see or modify the quantity of a product when there are different attributes. I simply do not see any options for that. I have updated everything according to the instructions, checked if a file is missing, but no errors have been found.
Attachment 19072
Attachment 19073
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
bennito
ZenCart 1.5.4
Hi everyone,
Does somebody can tell me why I can't see or modify the quantity of a product when there are different attributes. I simply do not see any options for that. I have updated everything according to the instructions, checked if a file is missing, but no errors have been found.
Attachment 19072
Attachment 19073
The screen shown second below is where there should be more information displayed to allow controlling attribute quantities; however, this appears to be a partial white screen. To identify what the problem is, would recommend reviewing this help document on that subject: https://docs.zen-cart.com/user/troub...ng/blank_page/
There should be a debug file that identifies the issue. Also, what was the source of the files used to install and when was it downloaded? There have been some improvements for systems that run strict operations.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
The screen shown second below is where there should be more information displayed to allow controlling attribute quantities; however, this appears to be a partial white screen. To identify what the problem is, would recommend reviewing this help document on that subject:
https://docs.zen-cart.com/user/troub...ng/blank_page/
There should be a debug file that identifies the issue. Also, what was the source of the files used to install and when was it downloaded? There have been some improvements for systems that run strict operations.
Hi, I have re-installed the add-on. The files has been downloaded from GitHUb. https://github.com/mc12345678/Stock_...butes_Combined
The log shows the following:
[05-Jul-2020 23:26:10 Europe/Sofia] PHP Fatal error: Call to undefined function zen_draw_label() in /home/nyvinhus/public_html/bennito/products_with_attributes_stock.php on line 1217
On the file "Product_with_attributes_stock.php" line 1217 says:
echo zen_draw_label(PWA_TEXT_SEARCH, 'search', '');
As I am really not expert on what means that, maybe you could give me some hint where and what to do?:(:(:(
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
bennito
Hi, I have re-installed the add-on. The files has been downloaded from GitHUb.
https://github.com/mc12345678/Stock_...butes_Combined
The log shows the following:
[05-Jul-2020 23:26:10 Europe/Sofia] PHP Fatal error: Call to undefined function zen_draw_label() in /home/XXxxxx/public_html/admin/products_with_attributes_stock.php on line 1217
On the file "Product_with_attributes_stock.php" line 1217 says:
echo zen_draw_label(PWA_TEXT_SEARCH, 'search', '');
As I am really not expert on what means that, maybe you could give me some hint where and what to do?:(:(:(
It'll be best if I create a small change.
Back in February of this year, I went through that admin screen and in places I "upgraded" the code to use ZC available code. Unfortunately, the function zen_draw_label wasn't introduced until ZC 1.5.5. I know that I had previously reviewed the code to possibly use ZC functions but either it didn't exist then or I had decided not to incorporate certain functions because they were "new".
Anyways, I will add the function to the code such that if it doesn't exist in the ZC software then it will for this operation... Ideally, would upgrade ZC versions.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
It'll be best if I create a small change.
Back in February of this year, I went through that admin screen and in places I "upgraded" the code to use ZC available code. Unfortunately, the function zen_draw_label wasn't introduced until ZC 1.5.5. I know that I had previously reviewed the code to possibly use ZC functions but either it didn't exist then or I had decided not to incorporate certain functions because they were "new".
Anyways, I will add the function to the code such that if it doesn't exist in the ZC software then it will for this operation... Ideally, would upgrade ZC versions.
I've added code to the file that was reporting the issue on github... I'm continuing to work a change to simplify the incorporation with ZC 1.5.7 (won't need to override the includes/modules/attributes.php file), just trying to make sure I have all conditions considered and then also incorporating the new method of using observers.
The specific commit that further supports this plugin on systems pre ZC 1.5.5 until further issue is identified is: https://github.com/mc12345678/Stock_...4a45c95d733a6a
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
mc12345678
I've added code to the file that was reporting the issue on github... I'm continuing to work a change to simplify the incorporation with ZC 1.5.7 (won't need to override the includes/modules/attributes.php file), just trying to make sure I have all conditions considered and then also incorporating the new method of using observers.
The specific commit that further supports this plugin on systems pre ZC 1.5.5 until further issue is identified is:
https://github.com/mc12345678/Stock_...4a45c95d733a6a
Hi again,
Thank you for your prompt actions! I am sorry that I did not replied to your last post. I am having really terrible week. This weekend I hope I have time and will implement this new line and check if everything works and I will return to you with a feedback.
Thank you once again!
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
bennito
Hi again,
Thank you for your prompt actions! I am sorry that I did not replied to your last post. I am having really terrible week. This weekend I hope I have time and will implement this new line and check if everything works and I will return to you with a feedback.
Thank you once again!
No problem, please take care of the things that need to be. This stuff will be here.
I did also recreate the issue to make sure that the code insertion point would allow continued operation. Like said, I should have left myself some better code notes so that I could have prevented the problem(s) caused by *simplifying* the code.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
I am trying to upgate my v1.5.7 version with the current Stock_By_Attributes-master from GitHIb
Copied Stock_By_Attributes_combined-master/1_5_6/admin/orders.php to my v1.5.7 version and the order.php runs. But it is missing v1.5.7 features such as the products ordered link on the order.php page.
Size 71,075
Runs without an error
Copied the orders.php from zen-cart v-1.5.7-06232020/admin/orders.php
Size 87,115
Original v1.5.7 Download
Runs without an error and displays the order product the products ordered link displayed
Here is what i tried:
Merged the two files above orders.php
Size now 89,283
orders.php just displays a white background page
No error log created
The same problem exists with the attributes_controller.php
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Just uploaded all of the "merge" files for ZC 1.5.7, as well as made changes in the catalog side observer class to handle using the ZC 1.5.7 provided includes/modules/attributes.php while the observe file still works with the previously provided attributes file... This means that the code provided in the combined package should continue to work with earlier ZC versions. Note this also means that in the base set of files, the attributes.php file is no longer provided as it comes as a part of one's default ZC installation of version 1.5.7. For previous ZC versions, the attributes.php file is included in each of the associated ZC version folders.
Still have some other "patches" to apply for the admin window, but checking the master branch should reflect software that should work in any 1.5.x provided distribution.
Note that for ZC 1.5.7 that there is an issue with the originally provided includes/modules/attributes.php file for standard product that are shown as a dropdown and have a default other than the first selectable item. In that situation and until an alternate method is applied, if something other than the first item is set as the default then that item will not appear as the default. This has been reported as an issue in github: https://github.com/zencart/zencart/issues/3734, proposed solution(s) are provided at: https://github.com/zencart/zencart/pull/3738.
Note that there have been a few different proposals made within that pull request. DrByte is aware of the issue but is also trying to consider a best way forwards.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
I am looking for a process to post physical inventory with the Stock_By_Attributes without entering each attribute quantity manually in the SBA screen.
-
Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9
Quote:
Originally Posted by
jodean
I am looking for a process to post physical inventory with the Stock_By_Attributes without entering each attribute quantity manually in the SBA screen.
Somewhat of two options available, for the product that have a single option name (any number of option values), the export/import option of the SBA admin under configuration menu works. If there are more than one option name, then EasyPopulate 4.0 supports populating data for existing variants. It does not yet support generating new variants from EP4.
-
4 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
SBA Version 1.5.4 for Zen Cart Version 1.5.6c
Have some issues with this and cant work out what's going on.
Please see pics below
Pic no1 shows the SBA page for an item on my site. The quantities on this page are correct.
pic no2 shows the option dropdown for the product on the website. As you can see these options are NOT correct according to the SBA page...
pic nos 3 and 4 display same pics for a different product. Again the stock on the SBA page are correct but the options drop down on the product page are wrong as well...
Have same issue with some of the other products in this category too, though not all of them...
ANY IDEAS ???
Attachment 19111
Attachment 19112
Attachment 19113
Attachment 19114
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Took a moment to identify the presence/absence of all of the images. For those that are unable to see the pictures for whatever reason, please at least allow me to describe two of them as the other two tell the same story.
In the first image, we are shown the admin screen portion of SBA for the given product where there are three rows of data showing quantity for each of three different option value selections within a single option name. The quantity of stock is different for each of the three option values which is also different than the total quantity of stock marked as available for the product stock quantity. In a second image, we are shown the catalog side of the store showing the product information page with all of the attributes assigned to the product and the stock quantity identified to each attribute (option value off of the one option name).
In this second image though there are more than three selections displayed. Here there are 10 or more selections displayed. The quantity of stock entered for the firs three shown in the admin match, but the other 7+ displayed options all appear to have the quantity that the overall product has...
This *is* a feature of SBA... it may not be usable in some stores, it may cause complete confusion in others, but it is part of the design. The concept is this: to limit the sale of quantity of product, one must identify the quantity of product that is available. By not defining the individual quantity, the quantity available is that defined by the product.
Thus, to remove the availability of the other option values, either the option values should be removed from the product or the quantity available for each of the option values should be identified even if it is a quantity of zero.
Of course, even with a quantity of zero, there comes the question of whether the "product" should be displayed. If the answer is no, I ask the question of why the option value remains assigned? If the answer is yes, I suggest reviewing the out-of-stock options to be sure that they "one day" will be returned to stock.
Sorry for the delay in responding, it's been a long day, but from the design perspective what you are seeing is "correct"... it may not fit your store or desired expectation but is functioning as designed/expected.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
how to add customid to advanced search result
jimmie
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
jimmie
how to add customid to advanced search result
jimmie
For a default ZC store, be sure to have the file provided in the main fileset: includes/classes/observers/auto.advanced_search_categories_custom_id.php
Works for ZC 1.5.6 and expected to work for ZC 1.5.7. Otherwise will need to identify the version of ZC and changes that have been made to the search feature...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Hello there,
I am just wondering if I am able to make the following code excerpts changed somehow (using 1.57 zencart, php 7.3.22) as I get the following error logs:-
Quote:
PHP Warning: count(): Parameter must be an array or an object that implements Countable in /chroot/home/gemtree/thegemtree.com/html/includes/templates/goodwin/templates/tpl_modules_attributes.php
Quote:
for ($k = 0, $m = count($options_name); $k < $m; $k++) {
Quote:
for($i=0, $j=count($options_name); $i<$j; $i++) {
they come at line 109 and 138. I have been looking up example codes to add to the line above, but they mention 'row' and think this might not be zencart compliant. Not sure if anybody has had any success?
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
HeathenMagic
Hello there,
I am just wondering if I am able to make the following code excerpts changed somehow (using 1.57 zencart, php 7.3.22) as I get the following error logs:-
they come at line 109 and 138. I have been looking up example codes to add to the line above, but they mention 'row' and think this might not be zencart compliant. Not sure if anybody has had any success?
It would appear that the ZC 1.5.7 version of includes/modules/attributes.php is not being used in this environment or there is something that is modifying $options_name away from an empty array when a product with attributes is provided that doesn't have an $options_name value...
SBA has been modified to support ZC 1.5.7 by not requiring an associated includes/modules/YOUR_TEMPLATE/attributes.php override file allowing the use of the now "default" version of the attributes.php file (though there was a modification that was incorporated to the originally provided ZC 1.5.7 version here: https://github.com/zencart/zencart/pull/3738/files). Hmmm, thought it was also identified in the 1.5.7 bugs list, but I don't see it.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mc12345678
It would appear that the ZC 1.5.7 version of includes/modules/attributes.php is not being used in this environment or there is something that is modifying $options_name away from an empty array when a product with attributes is provided that doesn't have an $options_name value...
SBA has been modified to support ZC 1.5.7 by not requiring an associated includes/modules/YOUR_TEMPLATE/attributes.php override file allowing the use of the now "default" version of the attributes.php file (though there was a modification that was incorporated to the originally provided ZC 1.5.7 version here:
https://github.com/zencart/zencart/pull/3738/files). Hmmm, thought it was also identified in the
1.5.7 bugs list, but I don't see it.
I beg your pardon, I think during merge upgrade I assumed it was still part of the code for SBA and overlooked that it needed removing. I have put the 1.57 attributes.php file as you suggested. Sorry about that! I was looking to see how to remove my post or edit as it is my oversight, happy for the moderators to remove as necessary. Thanks for your help! Going through the debug logs to tidy up deprecated / php warnings is hard work! For me anyway ha
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
HeathenMagic
I beg your pardon, I think during merge upgrade I assumed it was still part of the code for SBA and overlooked that it needed removing. I have put the 1.57 attributes.php file as you suggested. Sorry about that! I was looking to see how to remove my post or edit as it is my oversight, happy for the moderators to remove as necessary. Thanks for your help! Going through the debug logs to tidy up deprecated / php warnings is hard work! For me anyway ha
No worries. Also, I would imagine that the discussion would likely help others that go the same route. Instructions on how to install and/or upgrade would help prevent that type issue. Personally I find that the new attributes.php file covers a lot of new ground and offers a great deal of flexibility in responding to attribute type demands. DrByte did a lot of work to come up with the new revision.
Just an FYI, again, there is no longer a need for there to be an includes/modules/YOUR_TEMPLATE/attributes.php file at least for SBA.
That of course also depends on incorporating the other software associated with the plugin that has been updated to use that attributes.php as well as to still "work" with the older version. The issue raised though is inherent with the attributes.php file and more stringent "requirements" of php. Ie a lower version of php (without strict enforcement) would not have generated that type of warning which is one reason that the file was "ok" in the past. :)
Anyways, please be sure to evaluate the latest files for the module in relation to your upgrade/rebuild. Again, the includes and admin base directories support the basic operation of the software and then the folder for the associated Zen Cart version is setup to provide the file(s) necessary for that version of ZC. Because those files are effectively template override files, blank versions of removed files are not provided. Basically in an "upgrade" situation, if a file existed in a previous ZC version(s) folder and does not exist in the current/upgraded folder, then any modifications in the previous version do not need to be carried over to the new version... In some cases changes should be removed, in others a file could be removed. In all though as ZC versions go up, less template and/or core files have needed to be touched. More than likely jQuery could be used to remove many of the other file edits in support of adding items to "lists" of things. I'm not there yet though. :) I already have one (probably unnecessary) "trick" I have to undo in support of php 8... :/
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mc12345678
No worries. Also, I would imagine that the discussion would likely help others that go the same route. Instructions on how to install and/or upgrade would help prevent that type issue. Personally I find that the new attributes.php file covers a lot of new ground and offers a great deal of flexibility in responding to attribute type demands. DrByte did a lot of work to come up with the new revision.
Just an FYI, again, there is no longer a need for there to be an includes/modules/YOUR_TEMPLATE/attributes.php file at least for SBA.
That of course also depends on incorporating the other software associated with the plugin that has been updated to use that attributes.php as well as to still "work" with the older version. The issue raised though is inherent with the attributes.php file and more stringent "requirements" of php. Ie a lower version of php (without strict enforcement) would not have generated that type of warning which is one reason that the file was "ok" in the past. :)
Anyways, please be sure to evaluate the latest files for the module in relation to your upgrade/rebuild. Again, the includes and admin base directories support the basic operation of the software and then the folder for the associated Zen Cart version is setup to provide the file(s) necessary for that version of ZC. Because those files are effectively template override files, blank versions of removed files are not provided. Basically in an "upgrade" situation, if a file existed in a previous ZC version(s) folder and does not exist in the current/upgraded folder, then any modifications in the previous version do not need to be carried over to the new version... In some cases changes should be removed, in others a file could be removed. In all though as ZC versions go up, less template and/or core files have needed to be touched. More than likely jQuery could be used to remove many of the other file edits in support of adding items to "lists" of things. I'm not there yet though. :) I already have one (probably unnecessary) "trick" I have to undo in support of php 8... :/
Thanks for your reply. Yes I thought possibly it might help somebody else. I will remember that, and I will be a bit more thorough when updating in future.
Its sage advice you have given with to that regards. Gosh PHP 8 no doubt another lot of php warnings to come then haha :-)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
HeathenMagic
Thanks for your reply. Yes I thought possibly it might help somebody else. I will remember that, and I will be a bit more thorough when updating in future.
Its sage advice you have given with to that regards. Gosh PHP 8 no doubt another lot of php warnings to come then haha :-)
You're welcome, it is because of reports like this that either things can be made better or others can solve their similar problem or realize that they too can contribute to the solution(s). Thank you again for bringing it up and being patient/understanding with my replies.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Hello everyone.
I have a question.
I'm working on an art website, and I'm looking at replacing the SOLD OUT that appears next to the attribute, with a red dot instead.
I've tried adding an image in the defines, but it won't work.
I've tried changing the text SOLD OUT for just a simple '.' styling it as a class using CSS, but it won't work either.
Is there a way to do what I'm trying to accomplish without going above my very limited php knowledge?
Thank you in advance for any help you could provide.
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mvstudio
Hello everyone.
I have a question.
I'm working on an art website, and I'm looking at replacing the SOLD OUT that appears next to the attribute, with a red dot instead.
I've tried adding an image in the defines, but it won't work.
I've tried changing the text SOLD OUT for just a simple '.' styling it as a class using CSS, but it won't work either.
Is there a way to do what I'm trying to accomplish without going above my very limited php knowledge?
Thank you in advance for any help you could provide.
The ability to "style" the content adjacent to the attribute depends most on the type of attribute being used. For example, if the attribute type (controllable by admin->products->options name manager) is a dropdown or select type attribute, then unfortunately html prevents doing styling in that "simple" type selector. That would require a javascript type application to handle. If it is a radio button or checkbox, then things are different as those are more html friendly.
That said, a link always helps to see what is going on and possibly how to help. Can PM if not able to post in some cryptic way. :)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mc12345678
The ability to "style" the content adjacent to the attribute depends most on the type of attribute being used. For example, if the attribute type (controllable by admin->products->options name manager) is a dropdown or select type attribute, then unfortunately html prevents doing styling in that "simple" type selector. That would require a javascript type application to handle. If it is a radio button or checkbox, then things are different as those are more html friendly.
That said, a link always helps to see what is going on and possibly how to help. Can PM if not able to post in some cryptic way. :)
Thank you for the reply! Forgot to mention the attribute in question is a dropdown menu. It's a shame that cannot be done with just simple CSS =(
The website is www.manuelavalenti.com. If you register an account I'll approve you right away. I just have it private for now as I'm working on it, and don't want to display the "we're working" page.
Question, if I decide to go the javascript route, would that entire dropdown be affected by say someone who has disabled java? Would it still be functional and perhaps instead display a "sold" text in place of a red dot?
-
1 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Trying some other options, rather than complicating matters, I switched from dropdown attributes to checkboxes, which actually worked out better than I thought for my theme.
Attachment 19243
However the price is out of place in my design (mild OCDish) and I would like instead the red dot (sold) to be at the end on the other side of the price.
I tried moving things around on includes/classes/observers/class.products_with_attributes_stock.php which is the file I determined controlled the elements, but nothing I tried worked as I was expecting, so my question is, how/where/what would I need to edit on that file to accomplish this? And if not that file, which file would it be?
Thank you!!
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mvstudio
Thank you for the reply! Forgot to mention the attribute in question is a dropdown menu. It's a shame that cannot be done with just simple CSS =(
The website is
www.manuelavalenti.com. If you register an account I'll approve you right away. I just have it private for now as I'm working on it, and don't want to display the "we're working" page.
Question, if I decide to go the javascript route, would that entire dropdown be affected by say someone who has disabled java? Would it still be functional and perhaps instead display a "sold" text in place of a red dot?
Good, that's the developer mindset to consider the effects of the change desired. The goal would be yes, present the desired information to support those that don't allow javascript and how it would look if it was supported. As of I think ZC 1.5.4 maybe 1.5.3, the attributes.php file included an html tag to encompass the entirety of the attribute option being displayed. This allows javascript to "takeover" that option name which allows the attribute to be displayed as desired.
Now as to the latest question, first one back... is this product truly available without selecting either of the two checkboxes? If it is not possible for the product to "exist" without selecting a checkbox, then a checkbox is not likely the correct method of making a selection. Further, could the product ever exist if two or all checkboxes are marked? Again, if the answer to that is a no, then checkboxes are likely also not the type of selection to offer.
My recommendation in those two cases would be to use a radio button option. Further, based on the information presented in the image of two options being provided with no default preselected would recommend adding a third option value that is marked as default and display only. Having this configuration would require the customer to actively make a selection to support giving notification to the customer when attempting to add the product to the cart that they... well, make a selection.
Whether that default selection be shown on screen or not is up to css control.
Now, to the topic of the OCD of display "style", what about what is presented is desired to be changed? If it is for the two (or more) options to be displayed more in a list than a horizontal grouping, that is controlled by css more than it is through the file referenced, but more information is needed to be able to advise. Some of that additional information may include the settings for dynamic dropdowns (admin->configuration->dynamic dropdowns) as those settings could have an effect that I am not expecting.
-
2 Attachment(s)
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mc12345678
Good, that's the developer mindset to consider the effects of the change desired. The goal would be yes, present the desired information to support those that don't allow javascript and how it would look if it was supported. As of I think ZC 1.5.4 maybe 1.5.3, the attributes.php file included an html tag to encompass the entirety of the attribute option being displayed. This allows javascript to "takeover" that option name which allows the attribute to be displayed as desired.
Now as to the latest question, first one back... is this product truly available without selecting either of the two checkboxes? If it is not possible for the product to "exist" without selecting a checkbox, then a checkbox is not likely the correct method of making a selection. Further, could the product ever exist if two or all checkboxes are marked? Again, if the answer to that is a no, then checkboxes are likely also not the type of selection to offer.
My recommendation in those two cases would be to use a radio button option. Further, based on the information presented in the image of two options being provided with no default preselected would recommend adding a third option value that is marked as default and display only. Having this configuration would require the customer to actively make a selection to support giving notification to the customer when attempting to add the product to the cart that they... well, make a selection.
Whether that default selection be shown on screen or not is up to css control.
Now, to the topic of the OCD of display "style", what about what is presented is desired to be changed? If it is for the two (or more) options to be displayed more in a list than a horizontal grouping, that is controlled by css more than it is through the file referenced, but more information is needed to be able to advise. Some of that additional information may include the settings for dynamic dropdowns (admin->configuration->dynamic dropdowns) as those settings could have an effect that I am not expecting.
Thank you much for the reply!
Good questions!
The product in question is just a sample and I forgot to add the preselected option when I created the attributes. But the final products will have the "original painting" option as pre-selected as the first option (if available) or the limited edition prints pre-selected in those instances where the original painting is sold.
In short, yes the product, which will be offered as original painting (1 unit) and limited edition print (several units typical 25-50 or more), can be purchased together in one go, if the customer desires, the reason why I decided to go for checkboxes instead of radio buttons. If I choose dropdown menus or radio buttons, customers wanting to add both options to the cart, would need to add them as two separate items in the cart, which isn't that big of a deal, but I thought checkboxes might give some flexibility. Perhaps I'm seeing this with the wrong pair of glasses? I have the tendency to use tools differently than the way they were intended to be used.
What I'm trying to accomplish in this case of the checkboxes, assuming I picked the right option, is move the "red dot" which marks the piece as sold, to the end or the right side of the price, as shown in the picture below.
Attachment 19246
I was able to pinpoint the line of code that displays the "sold" message which is controlled by the define PWA_OUT_OF_STOCK located on includes/classes/observers/class.products_with_attributes_stock.php at around line 368
PHP Code:
if (empty($products_options_DISPLAYONLY->fields['attributes_display_only'])) {
$products_options_fields['products_options_values_name'] = $products_options_fields['products_options_values_name'] . PWA_OUT_OF_STOCK;
However I was unsuccessful at moving elements around to position the "sold" message, now displayed as a red dot, to the end. Again, I'm not good with php at all, I just play it by ear and through trial an error, tons of them. I'm only good at the design part and somehow manage for the most part to make things work the way I want them to.
These are the setting for the dynamic dropdowns as requested:
Attachment 19247
Thanks again for taking the time =)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mvstudio
Thank you much for the reply!
Good questions!
The product in question is just a sample and I forgot to add the preselected option when I created the attributes. But the final products will have the "original painting" option as pre-selected as the first option (if available) or the limited edition prints pre-selected in those instances where the original painting is sold.
In short, yes the product, which will be offered as original painting (1 unit) and limited edition print (several units typical 25-50 or more), can be purchased together in one go, if the customer desires, the reason why I decided to go for checkboxes instead of radio buttons. If I choose dropdown menus or radio buttons, customers wanting to add both options to the cart, would need to add them as two separate items in the cart, which isn't that big of a deal, but I thought checkboxes might give some flexibility. Perhaps I'm seeing this with the wrong pair of glasses? I have the tendency to use tools differently than the way they were intended to be used.
What I'm trying to accomplish in this case of the checkboxes, assuming I picked the right option, is move the "red dot" which marks the piece as sold, to the end or the right side of the price, as shown in the picture below.
Attachment 19246
I was able to pinpoint the line of code that displays the "sold" message which is controlled by the define PWA_OUT_OF_STOCK located on includes/classes/observers/class.products_with_attributes_stock.php at around line 368
PHP Code:
if (empty($products_options_DISPLAYONLY->fields['attributes_display_only'])) {
$products_options_fields['products_options_values_name'] = $products_options_fields['products_options_values_name'] . PWA_OUT_OF_STOCK;
However I was unsuccessful at moving elements around to position the "sold" message, now displayed as a red dot, to the end. Again, I'm not good with php at all, I just play it by ear and through trial an error, tons of them. I'm only good at the design part and somehow manage for the most part to make things work the way I want them to.
These are the setting for the dynamic dropdowns as requested:
Attachment 19247
Thanks again for taking the time =)
I believe that after I posted my response I took a closer look at the original picture and realized that the change desired was as also just described above: text about option, price of option and then "marker"...
So, the content of each of the attribute text listings is built "in time" with a standard everyday product's attribute with the additional text being applied to the option value "description" later on in the attributes.php file where the "price" is added. It is now after this addition that the SBA additional text is desired.
So, in chasing down the sequence of addition within the ZC 1.5.7 version of the attributes.php (note as discussed above, SBA no longer needs to modify the attributes.php file in a template override directory, the default version works great!), the price is "added on" at/around the notifier: NOTIFY_ATTRIBUTES_MODULE_ORIGINAL_PRICE. Additionally, in the above referenced file (includes/classes/observers/class.products_with_attributes_stock.php) there is a define that is used to "position" the customid. That define is PWA_DISPLAY_CUSTOMID. Where you see its "use" is well, where content revision could be done to position your "dot". The explanation of the "positioning" associated with that constant is provided near the beginning of the file and should help with templating the content location.
Hmmm. Getting me thinking about the use of replaceable text instead of specific detailed information to increase sequence capability and such... I have other things to work on, but will see about making a note of it so that future changes can be made "smartly".
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mc12345678
I believe that after I posted my response I took a closer look at the original picture and realized that the change desired was as also just described above: text about option, price of option and then "marker"...
So, the content of each of the attribute text listings is built "in time" with a standard everyday product's attribute with the additional text being applied to the option value "description" later on in the attributes.php file where the "price" is added. It is now after this addition that the SBA additional text is desired.
So, in chasing down the sequence of addition within the ZC 1.5.7 version of the attributes.php (note as discussed above, SBA no longer needs to modify the attributes.php file in a template override directory, the default version works great!), the price is "added on" at/around the notifier: NOTIFY_ATTRIBUTES_MODULE_ORIGINAL_PRICE. Additionally, in the above referenced file (includes/classes/observers/class.products_with_attributes_stock.php) there is a define that is used to "position" the customid. That define is PWA_DISPLAY_CUSTOMID. Where you see its "use" is well, where content revision could be done to position your "dot". The explanation of the "positioning" associated with that constant is provided near the beginning of the file and should help with templating the content location.
Hmmm. Getting me thinking about the use of replaceable text instead of specific detailed information to increase sequence capability and such... I have other things to work on, but will see about making a note of it so that future changes can be made "smartly".
After spending quite a few minutes looking for the define PWA_DISPLAY_CUSTOMID you mentioned, I realized I don't have installed ZC157 but ZC156c :(
I picked up where I left before the pandemic hit, and somehow completely missed updating to ZC1.5.7! :wacko::frusty::oops::cry:
Back to the beginning :shocking:
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mvstudio
After spending quite a few minutes looking for the define PWA_DISPLAY_CUSTOMID you mentioned, I realized I don't have installed ZC157 but ZC156c :(
I picked up where I left before the pandemic hit, and somehow completely missed updating to ZC1.5.7! :wacko::frusty::oops::cry:
Back to the beginning :shocking:
Well, while I commend you on ensuring that the store is up-to-date, the features I described are within the current github distribution and apply and/or are available without the ZC upgrade... Further, the ZC upgrade itself will not add the described additional code. That would still require download of the latest version from github...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mc12345678
Well, while I commend you on ensuring that the store is up-to-date, the features I described are within the current github distribution and apply and/or are available without the ZC upgrade... Further, the ZC upgrade itself will not add the described additional code. That would still require download of the latest version from github...
I had thought about updating just the plugin to the latest version, but wasn't sure if it would work. Since I'm too close to the holiday season and need to have this up and running, I didn't want to risk making a bigger mess. On my way to install the latest version and implement the changes! Thank you! =)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mvstudio
I had thought about updating just the plugin to the latest version, but wasn't sure if it would work. Since I'm too close to the holiday season and need to have this up and running, I didn't want to risk making a bigger mess. On my way to install the latest version and implement the changes! Thank you! =)
I'd make attempts to "fix" it if there were trouble at lowere ZC versions. :) Don't know "it's broke" sometimes though without someone throwing it out there...
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
Quote:
Originally Posted by
mc12345678
I'd make attempts to "fix" it if there were trouble at lowere ZC versions. :) Don't know "it's broke" sometimes though without someone throwing it out there...
I tried and boy did I try to reposition that little "red dot" within the file, and I just couldn't figure out what should have been placed where.
So I cheated.
I added a class to the image, and with CSS I made it float at the end.
It works, at least for now.
I will however when I have more time, figure out what needs to be edited, how and where, as I'm determined to learn and do things the right way.
Thank you for the help! =)
-
Re: Stock by Attribute v4.0 for Zen Cart 1.3.5
In ZC v1.57a (compared to v1.57) there are changes to
admin/packingslip.php
admin/invoice.php
that make it difficult for me to incorporate the SBA edits - bit of a guessing game. Would it be possible to update the Github code at some point?