Stock by Attributes Issues
I am running v1.5.5e on a home server to try and build my store without wasting money by hosting somewhere. I have been trying to install Stock By Attributes plugin (v1.5.3) without any success. I have tried all three that are in the download section and they all do the same thing. Here's what I did.
1st Attempt: I copied and merged the admin and includes files into my zencart installation. When I refresh my admin or try to run stock_by_attr_install.php, I get a blank screen that will sit there and do nothing.
2nd Attempt: I restored my zencart to original by copying the admin and includes file from the orginal files, which fixed getting back admin. It also left stock_by_attr_install.php. When I go to my admin/stock_by_attr_install.php, I get a special screen which looks like I can install it by running a script. However, it too makes it so all I get is a blank screen again that will sit there.
3rd Attempt: I restore Zencart again, and then decided to try path the SQL database manually. I got a few commands to work, but most error out. I'm not sure what to do from here.
All this effort and I'm not even sure if it will solve the problem I'm trying to get done. I am building a model train store and I need attributes for scale, paint details, individual stock for each item, and a few more attributes that need to be linked to each other. I've tried doing this out of the box and cannot get it to function properly. It let me add the attributes to the product, but when it comes to selecting a product, it gets really screwy and lets me add the wrong scale to the wrong paint detail and it doesn't catch it. I've been trying to get this built since 2003 and have tried several e-commerce engines, and none of them lets me do it the way I want. I have kept coming back to Zencart hoping things have changed with the new versions. It would be so much easier if Stock By Attributes was already in the core install. Hopefully someone can help me figure it out. Thanks ahead of time.
Re: Stock by Attributes Issues
If you take a look at the support thread, there is an updated location at which to obtain SBA for use on ZC versions 1.5.1 and above (link: https://github.com/mc12345678/Stock_...butes_Combined). This has not been loaded to the ZC forum because the existing instruction shows/expresses limitations that do not exist and are not correct to gain the most from the plugin.
For further discussion including an action needed at this time as described at the end of the below described thread, please continue in the thread identified at the plugin's download page: https://www.zen-cart.com/downloads.php?do=file&id=202
Re: Stock by Attributes Issues
If you have been attempting for 14 years it may be time to either hire some programming help or reconsider what you are trying to do.
Why not just create a separate product page for every item? I know that seems like overkill (I use SBA on one site and regular on another), but most websites are set up that way - including Amazon (they do it both ways.)
Re: Stock by Attributes Issues
Quote:
Originally Posted by
lindasdd
If you have been attempting for 14 years it may be time to either hire some programming help or reconsider what you are trying to do.
Why not just create a separate product page for every item? I know that seems like overkill (I use SBA on one site and regular on another), but most websites are set up that way - including Amazon (they do it both ways.)
One reason is one of the manufacturers uses Zencart and this is how they set up their site. I find it absolutely annoying to look through their shop as it is the most inefficient way of setting it up. They have several products that are exactly the same with different size, color, etc. and a separate page for each one. While I'm not really a programmer, I have tinkered with it. I haven't been in too much of a hurry as I am struggling to even find suppliers that will sell to you without having a brick and mortar shop. I just want to be prepared once I'm ready to take that step and knowing it will function the way I want it to. Hiring a programmer isn't out of the question, but as it is on my home server and not accessible through the internet as I tinker with it, they would have to be local to be able to come program it. I don't know if there are any programmers anywhere located close enough to me to make this possible. It is also the issue of spending money on something that I feel I should be able to get working on my own. I'm just surprised that the functionality of the attributes has pretty much remained the same over so many years. Even the few that tried to improve it by a variants plugin (which seems to do exactly the same thing) haven't figured out a better way to fix an issue like this.
Re: Stock by Attributes Issues
Quote:
Originally Posted by
imagineeratheart
One reason is one of the manufacturers uses Zencart and this is how they set up their site. I find it absolutely annoying to look through their shop as it is the most inefficient way of setting it up. They have several products that are exactly the same with different size, color, etc. and a separate page for each one. While I'm not really a programmer, I have tinkered with it. I haven't been in too much of a hurry as I am struggling to even find suppliers that will sell to you without having a brick and mortar shop. I just want to be prepared once I'm ready to take that step and knowing it will function the way I want it to. Hiring a programmer isn't out of the question, but as it is on my home server and not accessible through the internet as I tinker with it, they would have to be local to be able to come program it. I don't know if there are any programmers anywhere located close enough to me to make this possible. It is also the issue of spending money on something that I feel I should be able to get working on my own. I'm just surprised that the functionality of the attributes has pretty much remained the same over so many years. Even the few that tried to improve it by a variants plugin (which seems to do exactly the same thing) haven't figured out a better way to fix an issue like this.
As said in post #2, the version that will be submitted to ZC as Stock By Attributes upon completion of the instruction which currently identifies unnecessary limitations is available at https://github.com/mc12345678/Stock_...butes_Combined. It is expected to work on ZC versions 1.5.1 and up. If there is an issue with it, please post at the thread associated in the readme file.
Re: Stock by Attributes Issues
New Install ZC 1.5.7c. Using old install instructions (do not see upgraded instructions). There is no includes/modules in the download I have (guess it is an undocumented change). Ran install, used Full DB, and did not get "Sucess message". Returned to Admin Home. Menu did not have stock by attributes. This is a virgin install, no modifications using "Responsive Classic" template that comes with 1.5.7c. Did I miss something???
Re: Stock by Attributes Issues
Quote:
Originally Posted by
tedjmaines
New Install ZC 1.5.7c. Using old install instructions (do not see upgraded instructions). There is no includes/modules in the download I have (guess it is an undocumented change). Ran install, used Full DB, and did not get "Sucess message". Returned to Admin Home. Menu did not have stock by attributes. This is a virgin install, no modifications using "Responsive Classic" template that comes with 1.5.7c. Did I miss something???
Not much about the process has changed. Latest files are still on github. There's no 1_5_7/includes/modules directory, because there's no longer a need to override the attributes.php file. All operations are capable through the ZC 1.5.7 version of the file.
So, ran the full install and didn't get a success... That means there should have been some other message and information about what the problem is/was...
Re: Stock by Attributes Issues
I reloaded with a virgin 1.5.7c and Ran install, used Full DB, and did not get "Success message". Returned to Admin Home. Menu did not have stock by attributes. This is a virgin install, no modifications using "Responsive Classic" template that comes with 1.5.7c. I check log and it showed that stock by attributes install file was called but warning nor errors. THis is with a Chrome browser. Ran with Firefox and it works great.... Lucky me... Thanks for the help.
Re: Stock by Attributes Issues
Quote:
Originally Posted by
tedjmaines
I reloaded with a virgin 1.5.7c and Ran install, used Full DB, and did not get "Success message". Returned to Admin Home. Menu did not have stock by attributes. This is a virgin install, no modifications using "Responsive Classic" template that comes with 1.5.7c. I check log and it showed that stock by attributes install file was called but warning nor errors. THis is with a Chrome browser. Ran with Firefox and it works great.... Lucky me... Thanks for the help.
Again, an opportunity to identify the potential issue was lost. When the first install did not provide a success response, scrolling down on the screen would show what was unsuccessful. There is nothing about the code that is browser dependent (at least nothing that would change a potentially successful install into a failing one). Based on what has been provided, I would say that the second attempt (even though using a different browser) was needed to complete successfully.
It would be nice to know what needs to be corrected if willing to try that process again. I thought I had done it several times already and worked out anything that might have been an issue.
Re: Stock by Attributes Issues
Quote:
Originally Posted by
mc12345678
Again, an opportunity to identify the potential issue was lost. When the first install did not provide a success response, scrolling down on the screen would show what was unsuccessful. There is nothing about the code that is browser dependent (at least nothing that would change a potentially successful install into a failing one). Based on what has been provided, I would say that the second attempt (even though using a different browser) was needed to complete successfully.
I repeated this again with Chrome browser and zc157c. Ran install script. Displayed Admin page. NO MESSAGE ON SCROLL DOWN. No menu items. No error in log. Switched to FireFox and ran Full install. No Errors and works fine.
Re: Stock by Attributes Issues
Quote:
Originally Posted by
tedjmaines
I repeated this again with Chrome browser and zc157c. Ran install script. Displayed Admin page. NO MESSAGE ON SCROLL DOWN. No menu items. No error in log. Switched to FireFox and ran Full install. No Errors and works fine.
Appears I did not provide proper instruction. If able/willing to try further, I would appreciate it as I haven't been able to reproduce the issue yet and I still don't think it is a browser issue. I do have in mind though a couple of different tests where the system is restored back to before running the install.
1) with "bare" system, files in place. Use a non chrome browser, execute install, what is the last content related to SBA on the screen when scrolling down the page.
2) check for the menu items.
3) if the menu items are not there (not sure which one(s) are sought), then execute the install again in this same browser. What is the last content related to SBA on the screen when scrolling down the page.
4) check for the menus again.
Test two:
1) with "bare" system, files in place. Use chrome browser, execute install, what is the last content related to SBA on the screen when scrolling down the page.
2) check for the menu items.
3) if the menu items are not there (not sure which one(s) are sought), then execute the install again in this same browser. What is the last content related to SBA on the screen when scrolling down the page.
4) check for the menus again.
Test Three:
1) with "bare" system, files in place. Use a non-chrome browser, execute install, what is the last content related to SBA on the screen when scrolling down the page.
2) check for the menu items.
3) if the menu items are not there (not sure which one(s) are sought), then execute the install again using chrome browser. What is the last content related to SBA on the screen when scrolling down the page.
4) check for the menus again.
Test Four:
1) with "bare" system, files in place. Use chrome browser, execute install, what is the last content related to SBA on the screen when scrolling down the page.
2) execute the install again in this same browser. What is the last content related to SBA on the screen when scrolling down the page.
3) check for the menus.
Test Five:
1) with "bare" system, files in place. Use a non-chrome browser, execute install, what is the last content related to SBA on the screen when scrolling down the page.
2) execute the install again in this same browser. What is the last content related to SBA on the screen when scrolling down the page.
3) check for the menus.
Re: Stock by Attributes Issues
Quote:
Originally Posted by
mc12345678
Appears I did not provide proper instruction. If able/willing to try further, I would appreciate it as I haven't been able to reproduce the issue yet and I still don't think it is a browser issue. I do have in mind though a couple of different tests where the system is restored back to before running the install.
This is busy weekend for me but I will take the time next week and run the tests you suggest and post results.
Re: Stock by Attributes Issues
Quote:
Originally Posted by
tedjmaines
This is busy weekend for me but I will take the time next week and run the tests you suggest and post results.
Thank you. I did try similar while using the version at: https://github.com/mc12345678/Stock_...butes_Combined and was not able to reproduce the problem described most recently in this thread. I generated the above based on review of the described process/actions and that if there was an issue to be addressed that the above testing should be fruitful. I stated only the "last line", but any/all information associated would likely provide the best assistance to resolution. Again, thank you.
Re: Stock by Attributes Issues
I have just tried to install from the Stock by Attribute Combined Master files from the GitHub into ZC1.5.7c and nothing happened. I am using Westminster new template and have copied files from the 1.5.7 folder in the zip file into that template. Running on a localhost apache server with php 7.4.9. Only other mod applied so far is OnePage checkout.
No menus, no link to an install file or anything visible. From reading this thread I then ran the stock_by_attr_install.php file directly by typing into the URL bar and tried to install the database as I could see my database did not have the products_with_attributes_stock table. No message to say success or failure, but it did not install the table.
I have tried different browsers (Edge and Firefox).
Is there an SQL file I could run to install the table?
Do I need to install the pages using the Admin Page registration? Not used that before so not sure where to start?
Look forward to some pointers. Thank you for your help.
Re: Stock by Attributes Issues
Quote:
Originally Posted by
MikeyG
I have just tried to install from the Stock by Attribute Combined Master files from the GitHub into ZC1.5.7c and nothing happened. I am using Westminster new template and have copied files from the 1.5.7 folder in the zip file into that template. Running on a localhost apache server with php 7.4.9. Only other mod applied so far is OnePage checkout.
No menus, no link to an install file or anything visible. From reading this thread I then ran the stock_by_attr_install.php file directly by typing into the URL bar and tried to install the database as I could see my database did not have the products_with_attributes_stock table. No message to say success or failure, but it did not install the table.
I have tried different browsers (Edge and Firefox).
Is there an SQL file I could run to install the table?
Do I need to install the pages using the Admin Page registration? Not used that before so not sure where to start?
Look forward to some pointers. Thank you for your help.
There appear to be several gaps in the above making it difficult to provide any "simple" instruction. I mean even the direction given on github wasn't followed as this thread is not referenced from it. At any rate, so when you "ran stock_by_attr_install.php", did you see a screen that had a dropdown window, or were you presented with a page not found, or possibly the base admin screen of the admin? I ask, because nothing above talks about copying over the base includes/ and/or admin folder, only the "1.5.7 folder". Again it is not browser dependent, the issue has been tracked down to a design of ZC 1.5.7 and the fact that I used/continued to use a particular style of obtaining/retrieving information from the page. An improvement has been developed by the dev team even though I have implemented a "work around" in the github distribution which has been in place for a few weeks now at least...
The sql is within the stock_by_attr_install.php file in pieces and parts and is intended to auto install based on the command line. In actuality, in ZC 1.5.7, the expectation would be to run:
admin/index.php?cmd=stock_by_attr_install
Doing that will resolve the issue that is otherwise worked around.
Sorry for the delay in responding, please in the future comment in this forum thread: https://www.zen-cart.com/showthread....r-v1-3-5-1-3-9 as stated in the github repo: GitHub - mc12345678/Stock_By_Attributes_Combined: This combines the Files from SBA 1.5.3 and SBA 1.5.4 to provide a single distribution for updating applicable to ZC 1.5.1, 1.5.3, 1.5.4, 1.5.5, 1.5.6 and 1.5.7.
Re: Stock by Attributes Issues
mc12345678 thank you for your reply. Yes copied over the other base folder - includes and admin and then copied the 1.5.7 folder and renamed /copied into my template folders. The way I ran the stock_by_attr_install.php file was to add that to the URL from the admin home page. Yes this did give me a page with drop downs and I then selected from the drop down the script for install the full DB.
It was at this point that nothing happened other than it returned to the main admin home page. Tried this several time going through all of the options in the drop down and each time nothing happened.
However I have now copied over all files again and this time noted that there was a small link in the "other actions" to the attribute controller which took me to the install file and now it seems to have installed the database.
Thank you for your help and for the link to the github. Best regards.
Re: Stock by Attributes Issues
As placed in the github for admin/invoice.php in the 1_5_7/admin folder.
Quote:
The current file in this github is dated 2020-07-03 and the file in the latest distribution is dated 2020-10-28 with a change done for 1.5.7a on line 182. In merging the files, I left the change by DrByte and focused only on the Change 1 of 2 and 2 of 2.When accessing any invoice from the admin, we get the following error:
`[13-Apr-2021 08:51:05 US/Central] PHP Parse error: syntax error, unexpected '}' in /********/invoice.php on line 213
[13-Apr-2021 08:51:05 US/Central] Request URI: //index.php?cmd=invoice&oID=65846, IP address: 67.253.65.245
--> PHP Parse error: syntax error, unexpected '}' in //invoice.php on line 213.`
Also, getting foreach() warning for line 1696 of /includes/classes/observers/class.products_with_attributes_stock.php
Re: Stock by Attributes Issues
Quote:
Originally Posted by
dbltoe
As placed in the github for admin/invoice.php in the 1_5_7/admin folder.
Also, getting foreach() warning for line 1696 of /includes/classes/observers/class.products_with_attributes_stock.php
Line 1690 should follow what the text above it says by changing:
Code:
if (empty($order->products[$i]) && empty($order->products[$i]['attributes'])) return;
to:
Code:
if (empty($order->products[$i]) || empty($order->products[$i]['attributes'])) return;
I think I tried to do some sort of refactoring and missed a step. (An alternate solution would be to not the entire first evaluation, but I think the proposed solution here is more readable. Now, to copy this over to the forum referenced for the plugin... Thanks for doubling the efforts.
Re: Stock by Attributes Issues
Quote:
Originally Posted by
tedjmaines
New Install ZC 1.5.7c. Using old install instructions (do not see upgraded instructions). There is no includes/modules in the download I have (guess it is an undocumented change). Ran install, used Full DB, and did not get "Sucess message". Returned to Admin Home. Menu did not have stock by attributes. This is a virgin install, no modifications using "Responsive Classic" template that comes with 1.5.7c. Did I miss something???
Quote:
Originally Posted by
mc12345678
There appear to be several gaps in the above making it difficult to provide any "simple" instruction. I mean even the direction given on github wasn't followed as this thread is not referenced from it. At any rate, so when you "ran stock_by_attr_install.php", did you see a screen that had a dropdown window, or were you presented with a page not found, or possibly the base admin screen of the admin? I ask, because nothing above talks about copying over the base includes/ and/or admin folder, only the "1.5.7 folder". Again it is not browser dependent, the issue has been tracked down to a design of ZC 1.5.7 and the fact that I used/continued to use a particular style of obtaining/retrieving information from the page. An improvement has been developed by the dev team even though I have implemented a "work around" in the github distribution which has been in place for a few weeks now at least...
The sql is within the stock_by_attr_install.php file in pieces and parts and is intended to auto install based on the command line. In actuality, in ZC 1.5.7, the expectation would be to run:
admin/index.php?cmd=stock_by_attr_install
Doing that will resolve the issue that is otherwise worked around.
Sorry for the delay in responding, please in the future comment in this forum thread:
https://www.zen-cart.com/showthread....r-v1-3-5-1-3-9 as stated in the github repo:
GitHub - mc12345678/Stock_By_Attributes_Combined: This combines the Files from SBA 1.5.3 and SBA 1.5.4 to provide a single distribution for updating applicable to ZC 1.5.1, 1.5.3, 1.5.4, 1.5.5, 1.5.6 and 1.5.7.
Quote:
Originally Posted by
MikeyG
mc12345678 thank you for your reply. Yes copied over the other base folder - includes and admin and then copied the 1.5.7 folder and renamed /copied into my template folders. The way I ran the stock_by_attr_install.php file was to add that to the URL from the admin home page. Yes this did give me a page with drop downs and I then selected from the drop down the script for install the full DB.
It was at this point that nothing happened other than it returned to the main admin home page. Tried this several time going through all of the options in the drop down and each time nothing happened.
However I have now copied over all files again and this time noted that there was a small link in the "other actions" to the attribute controller which took me to the install file and now it seems to have installed the database.
Thank you for your help and for the link to the github. Best regards.
By the way, I have updated the install code to address this issue which was the way that get style forms were being put together such that in a way there was an expectation that the cmd parameter would already be defined and defined such that it would represent the page to which the browser was to go. There has been a proposed solution that I think is good and supports the desired action(s); however, I do not believe that I have seen it incorporated into the ZC software (yet).