Zen Cart Logo
Forums / All Other Contributions/Addons / Stock by Attribute v4.0 addon for v1.3.5-1.3.9

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

Views: 658,369

Results 2,801 to 2,820 of 3,609
15 Sep 2017, 3:00 PM
#2801
zoloworld avatar

zoloworld

New Zenner

Join Date:
Jul 2011
Posts:
35
Plugin Contributions:
0

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

I figured it out. Sorry, It was that I had two files. One thing to note is that you should not keep the same file names next to each other like Order.php and lets say Order1.php<-- using the (1) as something of a backup file. It works sometimes, but can confuse the system other times.

15 Sep 2017, 3:03 PM
#2802
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

Zoloworld:

I figured it out. Sorry, It was that I had two files. One thing to note is that you should not keep the same file names next to each other like Order.php and lets say Order1.php<-- using the (1) as something of a backup file. It works sometimes, but can confuse the system other times.
Actually, generally speaking, the extension (.php) should be modified in such a case of trying to take a file out of the process. Ie. .php~ or some other final extension.

15 Sep 2017, 5:13 PM
#2803
zoloworld avatar

zoloworld

New Zenner

Join Date:
Jul 2011
Posts:
35
Plugin Contributions:
0

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

mc12345678:

Actually, generally speaking, the extension (.php) should be modified in such a case of trying to take a file out of the process. Ie. .php~ or some other final extension.

Something that I did not even think about. I will switch that in the future when experimenting. When I uploaded the picture swap mod, it had some weird language on the pages where there were attributes. I will revisit this sometime next week and play with it a bit.

15 Sep 2017, 6:44 PM
#2804
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

Zoloworld:

Something that I did not even think about. I will switch that in the future when experimenting. When I uploaded the picture swap mod, it had some weird language on the pages where there were attributes. I will revisit this sometime next week and play with it a bit.
Considering the method(s) of incorporation that I've been seeing (file renaming), I want to be sure you understand how software like either of these is provided. (there are other ways as well).

The provided files ought to be the version that one would obtain if downloading a new copy of ZC, but where a file is modified, it would include code that "activates" the necessary actions for the plugin. It is possible that other software (template related or as provided by another existing installed program) may have already modified the file. Therefore replacing the file (even if by renaming an existing one) could/would remove the changes made by the other program. This is generally not desired. Instead, the goal is to add to what already exists. This is made easier by the use of comparison software such as WinMerge, Beyond Compare, etc...

Although the above message relates to software unrelated to SBA, I have the concern regardless. That said, when you get back to it, I would suggest that issues with the attribute image swap be addressed in the forum thread for that software. :)

1 Oct 2017, 2:05 PM
#2805
basil3legs avatar

basil3legs

New Zenner

Join Date:
Oct 2017
Location:
UK
Posts:
4
Plugin Contributions:
0

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

Hi mc12345678,

Thanks for maintaining this add-on.

I am about to upgrade my site from ZC 1.5.1 to ZC 1.5.5e and am after a little advice on this add-on. I have 2 other add-ons installed but they are both pretty simple ones (e.g. US to UK English one which alters all of one file) so are easy enough to re-implement so can be done last once everything else is running fine. I did a file compare a bit ago so have a list of the files that were altered by the 3 add-ons but am waiting for a decent amount of un-interrupted time to actually do the upgrade. This is looking like next weekend.

I have downloaded your Git with all the files in it but was wondering if there are any instructions? I have set up a test version of my site which currently has a vanilla install of ZC 1.5.5e and the database copy has the original extra tables/fields from Stock by Attributes (I have a feeling an extra field was added to one of the tables at some point so that will need adding but I can add that in manually if necessary). So, now to where I am after some advice (and your README.md says to ask here :wink:)...

Do I just copy the files from the 1_5_5 directory from the Git (after renaming the template and admin folders) or is this more an incremental upgrade and needs files copying from previous version folders (and/or the root) as there appears to be some files missing from just the 1_5_5 folder? I have looked back through pages of this thread and can't find an answer but if it is there and you know roughly when (or the post number) please point me in that direction.

Thanks in advance.

1 Oct 2017, 5:07 PM
#2806
basil3legs avatar

basil3legs

New Zenner

Join Date:
Oct 2017
Location:
UK
Posts:
4
Plugin Contributions:
0

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

Hi mc12345678,

Thanks for keeping this add-on alive and updated.

I am after some quick advice before upgrading.

I am currently running ZC 1.5.1 with 3 add-ons, one being Stock By Attributes. The other 2 are very basic add-ons so I will worry about re-implementing them once the rest is working. I am looking to upgrade this to ZC 1.5.5e probably next weekend when I will hopefully have some uninterrupted time.

I have compared my current ZC files with the vanilla 1.5.1 files so have a list of what files were changed by each add-on. I have also downloaded your Git. I have installed 1.5.5e on top of a backup copy of my site but have yet to put the add-ons back in but the extra tables/fields for SBA are in the backup database (although I believe an extra field was added to one of the tables in a more recent update which will need adding to one of the tables - but this can be easily added manually if that is the case).

What I would like to know is what will need copying into the new ZC version to get SBA back up and running? I have renamed the template folders to the correct template names and will do the same for the admin folder but it looks like it is more than just copying the files from the 1_5_5 folder of the Git. Do I need to copy all the version files across in order or just the ones from the root folder + the 1_5_5 folder?

Sorry if this has been asked before but I have looked back through pages of posts in this thread and can find nothing about this. Also, apologies if this appears as a duplicate post but I tried to post similar to this earlier and it disappeared.

Thanks in advance.

2 Oct 2017, 12:08 AM
#2807
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

Been a long day for me and I can't say I understand the history of the two posts, but they seem to contain the same basic content. While it doesn't prevent me from providing an answer, I just wish to say that posting more than once doesn't necessarily make things go faster. If they were posted elsewhere in the forum, it's actually good that they are now here.

Anyways, the instructions remain in modification as the instructions that potteryhouse generated while accurate to the extent that he revamped the program, they identify only a limited amount of the capacity.

So. Installation is best as such (for now) install the base includes and admin folders (there are a few YOUR_TEMPLATE related files in the includes folder). Where a template file exists already in your system, installation means to merge the changes made to support SBA with the existing template file. The includes/modules/YOUR_TEMPLATE/attributes.php file is generally the ZC 1.5.5 version with a few extra features to support some display features rather than duplicating the internal content.

Then merge the changes made to the files associated with your version of ZC for both store and admin (includes and admin).

You can then run the install/upgrade by logging into your admin and accessing stock_by_attr_install.php

As far as your "extra field" in a table. Since you are upgrading the database, that field is not deleted or anything and will remain present. The question becomes if there is software that uses that field in your new install...

2 Oct 2017, 2:31 AM
#2808
basil3legs avatar

basil3legs

New Zenner

Join Date:
Oct 2017
Location:
UK
Posts:
4
Plugin Contributions:
0

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

Thanks for getting back to me.

The history of the 2 posts is that 3 hours after I posted the first post it was still not showing and my profile was still saying I hadn't posted anything. This may have been some admin thing as it was my first post but I thought maybe I hit the wrong button and cancelled it rather than posting it (been a long day here too!). Hence also the apology in the second if it showed up twice. I assume the edit/delete function disappears after a while or I would have deleted one of them. I did edit the second one slightly when first posted but there was still no sign of the first one at that time.

I read through loads of posts by potteryhouse about 120 pages back but saw nothing about actual installation but I think you have answered most of my queries and pretty much confirmed my thoughts.

I had another look into the missing fields (these are ones missing from my version of SBA that are now in) and there are quite a few (my main SBA table only has 5 fields whereas the install mentions 8). Looking through the install code, there appears to be code to add these in so they shouldn't be an issue.

2 Oct 2017, 5:21 AM
#2809
ivopivo avatar

ivopivo

New Zenner

Join Date:
Apr 2016
Posts:
18
Plugin Contributions:
0

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

I was wondering if the "gift wrapping" scenario in the original release 12+ years ago was ever addressed? Adding a an attribute/option that isn't linked to other attributes offered for the product? Or are there any separate mods that achieve this? (not gift wrapping per say but an attribute for a product that isn't quantity tracked)

2 Oct 2017, 1:09 PM
#2810
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

ivopivo:

I was wondering if the "gift wrapping" scenario in the original release 12+ years ago was ever addressed? Adding a an attribute/option that isn't linked to other attributes offered for the product? Or are there any separate mods that achieve this? (not gift wrapping per say but an attribute for a product that isn't quantity tracked)

So, I'm not sure your method of viewing this forum "thread" but yes in the last couple of pages it has been posted how to assign data information to apply data to get a non-stock tracked attribute "portion" assigned. I thought that the stock_by_attr_install screen was also updated to reflect some of the information related. I'm still waiting for other to provide feedback on its use/success before I dig into the user interface to improve its accesibility.

Ie. Right now a sql script has to be applied manually. There are a few ways and places I think it would be beneficial to allow applying such feature, but don't want to spend too much time on a feature if there are already major issues with it.

2 Oct 2017, 4:57 PM
#2811
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

mc12345678:

So, I'm not sure your method of viewing this forum "thread" but yes in the last couple of pages it has been posted how to assign data information to apply data to get a non-stock tracked attribute "portion" assigned. I thought that the stock_by_attr_install screen was also updated to reflect some of the information related. I'm still waiting for other to provide feedback on its use/success before I dig into the user interface to improve its accesibility.

Ie. Right now a sql script has to be applied manually. There are a few ways and places I think it would be beneficial to allow applying such feature, but don't want to spend too much time on a feature if there are already major issues with it.

Post 2725 has instructions on how to apply the "gift wrap" option and also is some additional information before that.

3 Oct 2017, 3:46 AM
#2812
ivopivo avatar

ivopivo

New Zenner

Join Date:
Apr 2016
Posts:
18
Plugin Contributions:
0

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

mc12345678:

Post 2725 has instructions on how to apply the "gift wrap" option and also is some additional information before that.

Thanks. I'm running SBA Version 1.5.4 / Zen Cart Version 1.5.4.

I don't have the "products_with_attributes_stock_attributes_non_stock" table, should I create it?

Or is this for another version of SBA?

I'm happy to give this a good test as I have many products that this feature would apply to.

3 Oct 2017, 9:11 AM
#2813
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

ivopivo:

Thanks. I'm running SBA Version 1.5.4 / Zen Cart Version 1.5.4.

I don't have the "products_with_attributes_stock_attributes_non_stock" table, should I create it?

Or is this for another version of SBA?

I'm happy to give this a good test as I have many products that this feature would apply to.
Use of the table takes more than just creating it. Unfortunately, version control is more so by date than version number. The date is related to when the software was downloaded from github at the following link: https://github.com/mc12345678/Stock_By_Attributes_Combined which has been observed/reported as operational for ZC 1.5.0 through 1.5.5e. I have also incorporated ZC 1.5.6 files as they were on the date of incorporation.

Be glad to get some feedback other than need instructions. :) that part I know, but there is a lot of instruction covered in these later pages of the thread.

4 Oct 2017, 1:54 AM
#2814
basil3legs avatar

basil3legs

New Zenner

Join Date:
Oct 2017
Location:
UK
Posts:
4
Plugin Contributions:
0

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

Hi mc12345678,

I decided to start my upgrade but ran into a couple of problems...

Firstly one of the files just would not load onto my server despite trying 2 different ftp programs - I haven't a clue why as it said it was copying fine but wasn't appearing server side. I managed to get around that by logging onto the server back end and pulling the file in from there! I hope there are no other files missing but I guess time will tell. This isn't an issue with what you have written so don't worry, just REALLY annoying! When I get around to updating the real site I might have to pull in all the files to be on the safe side.

Secondly I had a couple of problems with the Install program.

There are 2 typos in there
Line 1321 is missing the $ in !$field_exists
Line 1335 has "options" spelt wrong - this didn't effect me, I just happened to notice it.

Having corrected these it appeared to run through fine (just telling me to delete some old files) although it didn't add the idx_products_id_stock_attributes unique key to the products_with_attributes_stock table. I'm not sure how important that is but added it in manually anyway.

It is late now so I haven't even tried anything on the site itself but looking good so far.

4 Oct 2017, 4:27 AM
#2815
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

The two items identified by line number have been updated in the install file.

Don't know what to say about the files not wanting to upload... :) as to the index key, well it is intended to help find data. Supposedly it would end up in there on its own, but better to start off with a good index all the same. Will see if there is something off about the script in that area.

8 Oct 2017, 2:30 PM
#2816
ivopivo avatar

ivopivo

New Zenner

Join Date:
Apr 2016
Posts:
18
Plugin Contributions:
0

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

mc12345678:

Use of the table takes more than just creating it. Unfortunately, version control is more so by date than version number. The date is related to when the software was downloaded from github at the following link: https://github.com/mc12345678/Stock_By_Attributes_Combined which has been observed/reported as operational for ZC 1.5.0 through 1.5.5e. I have also incorporated ZC 1.5.6 files as they were on the date of incorporation.

Be glad to get some feedback other than need instructions. :) that part I know, but there is a lot of instruction covered in these later pages of the thread.

I am using the method now. I haven't had issues, its been flawless. I have numerous products and have received orders with no issues to report in the SBA functionality. Everything working as it should.

9 Oct 2017, 6:37 PM
#2817
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

ivopivo:

I am using the method now. I haven't had issues, its been flawless. I have numerous products and have received orders with no issues to report in the SBA functionality. Everything working as it should.
Glad to hear and thank you for reporting back. :)

Hard to fix something that isn't known nor expressed to be a problem.

11 Oct 2017, 1:13 AM
#2818
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

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

Hi,
just a question about SBA and Edit Orders. I installed both modules on a fresh 1.55e install. It seem all fine untill You try edit an order, in wich case i got this error:

[11-Oct-2017 00:16:09 UTC] Request URI: /../edit_orders.php?origin=index&page=1&oID=3&action=update_order, IP address: ::1
#1  products_with_attributes_stock_admin->updateEditOrdersAddProduct() called at [C:\..\includes\classes\class.base.php:103]
#2  base->notify() called at [C:\..\..min\includes\functions\extra_functions\edit_orders_functions.php:971]
#3  eo_add_product_to_order() called at [C:\w..\..admin\edit_orders.php:381]


[11-Oct-2017 00:16:09 UTC] PHP Warning:  Invalid argument supplied for foreach() in C:\..\...min\includes\classes\observers\class.products_with_attributes_stock.php on line 576

[11-Oct-2017 00:16:09 UTC] PHP Stack trace:

[11-Oct-2017 00:16:09 UTC] PHP   1. {main}() C:\...\..min\edit_orders.php:0

[11-Oct-2017 00:16:09 UTC] PHP   2. eo_add_product_to_order() C:\...\..min\edit_orders.php:381

[11-Oct-2017 00:16:09 UTC] PHP   3. base->notify() C:\..\..min\includes\functions\extra_functions\edit_orders_functions.php:971

[11-Oct-2017 00:16:09 UTC] PHP   4. products_with_attributes_stock_admin->updateEditOrdersAddProduct() C:\..\includes\classes\class.base.php:103

What i noticed is that this error show if an article in the order has no SBA variant, infact it also show in the upper part the warning :
" Product 2 in the list below, named 'xxxxx', with a quantity of 1 did not exist. Attribute(s) selected:
Quantity: 50grams
Its attribute(s) were not updated.

Reading around i found quite nothing on how to integrate the 2 contributions or solve this, any help would be really appreciated.

Zencart 1.55e
Edit Orders 4.3.0 (last version from github)
SBA 1.5.4 (github last version)
PHP 5.6.31

11 Oct 2017, 1:27 AM
#2819
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

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

An update...

The error shown before will be generate always when updating an order, no matter if the order has articles with SBA variants or not.
If you put an article with no SBA variant in the order it will not update and show the Warning:
" Product 2 in the list below, named 'xxxxx', with a quantity of 1 did not exist. Attribute(s) selected:
Quantity: 50grams
Its attribute(s) were not updated."

Sorry for the double post

11 Oct 2017, 4:27 AM
#2820
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

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

izar74:

Hi,
just a question about SBA and Edit Orders. I installed both modules on a fresh 1.55e install. It seem all fine untill You try edit an order, in wich case i got this error:

[11-Oct-2017 00:16:09 UTC] Request URI: /../edit_orders.php?origin=index&page=1&oID=3&action=update_order, IP address: ::1
#1 products_with_attributes_stock_admin->updateEditOrdersAddProduct() called at [C:..\includes\classes\class.base.php:103]
#2 base->notify() called at [C:....min\includes\functions\extra_functions\edit_orders_functions.php:971]
#3 eo_add_product_to_order() called at [C:\w....admin\edit_orders.php:381]

[11-Oct-2017 00:16:09 UTC] PHP Warning: Invalid argument supplied for foreach() in C:.....min\includes\classes\observers\class.products_with_attributes_stock.php on line 576

[11-Oct-2017 00:16:09 UTC] PHP Stack trace:

[11-Oct-2017 00:16:09 UTC] PHP 1. {main}() C:.....min\edit_orders.php:0

[11-Oct-2017 00:16:09 UTC] PHP 2. eo_add_product_to_order() C:.....min\edit_orders.php:381

[11-Oct-2017 00:16:09 UTC] PHP 3. base->notify() C:....min\includes\functions\extra_functions\edit_orders_functions.php:971

[11-Oct-2017 00:16:09 UTC] PHP 4. products_with_attributes_stock_admin->updateEditOrdersAddProduct() C:..\includes\classes\class.base.php:103

> 
> What i noticed is that this error show if an article in the order has no SBA variant, infact it also show in the upper part the warning :
> " Product 2 in the list below, named 'xxxxx', with a quantity of 1 did not exist. Attribute(s) selected: 
> Quantity: 50grams
> Its attribute(s) were not updated.
> 
> Reading around i found quite nothing on how to integrate the 2 contributions or solve this, any help would be really appreciated.
> 
> Zencart 1.55e
> Edit Orders 4.3.0 (last version from github)
> SBA 1.5.4 (github last version)
> PHP 5.6.31

> **izar74:**
>
> An update...
> 
> The error shown before will be generate always when updating an order, no matter if the order has articles with SBA variants or not.
> If you put an article with no SBA variant in the order it will not update and show the Warning:
> " Product 2 in the list below, named 'xxxxx', with a quantity of 1 did not exist. Attribute(s) selected: 
> Quantity: 50grams
> Its attribute(s) were not updated."
> 
> Sorry for the double post

Yeah, you're the first one to report anything about it.  Issues confirmed to exist and have been corrected through the following "comparison" commit (though this was discovered through use of EO 4.1.7 on ZC 1.5.5 that was slightly modified to work with SBA).

<https://github.com/mc12345678/Stock_By_Attributes_Combined/compare/fa00792d8da3ca96da05aa62f6e221e299a2f0ae...02ef626fd13bdc37207af5e9633d1a60cda91485>

These exist on the master branch of the plugin.