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: 660,388

Results 3,241 to 3,260 of 3,609
25 May 2020, 12:46 PM
#3241
mc12345678 avatar

mc12345678

Totally Zenned

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

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

snakes7575:

I also find that if the dropdown set is on 1 or 3 I get an error
Attachment 19007
Attachment 19008
Attachment 19009
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...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

26 May 2020, 11:07 AM
#3242
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

snakes7575:

I also find that if the dropdown set is on 1 or 3 I get an error
Attachment 19007
Attachment 19008
Attachment 19009
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...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

26 May 2020, 2:39 PM
#3243
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

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:

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:

        $products_options_display_price .= $originalpricedisplaytext . $PWA_STOCK_QTY;

to:

        $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_By_Attributes_Combined/pull/79/files

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

27 May 2020, 12:01 AM
#3244
snakes7575 avatar

snakes7575

New Zenner

Join Date:
Apr 2020
Location:
italia
Posts:
19
Plugin Contributions:
0

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

55/5000
Thanks a lot, this is ok I just tried it and it works

27 May 2020, 12:10 AM
#3245
snakes7575 avatar

snakes7575

New Zenner

Join Date:
Apr 2020
Location:
italia
Posts:
19
Plugin Contributions:
0

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

this works eliminates double quantities if I copy what you posted here.

 $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

27 May 2020, 12:26 AM
#3246
snakes7575 avatar

snakes7575

New Zenner

Join Date:
Apr 2020
Location:
italia
Posts:
19
Plugin Contributions:
0

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_model, 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...

27 May 2020, 3:10 AM
#3247
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

snakes7575:

this works eliminates double quantities if I copy what you posted here.

$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. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

27 May 2020, 10:46 AM
#3248
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

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_model, 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...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

28 May 2020, 11:03 PM
#3249
snakes7575 avatar

snakes7575

New Zenner

Join Date:
Apr 2020
Location:
italia
Posts:
19
Plugin Contributions:
0

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

28 May 2020, 11:27 PM
#3250
snakes7575 avatar

snakes7575

New Zenner

Join Date:
Apr 2020
Location:
italia
Posts:
19
Plugin Contributions:
0

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

29 May 2020, 4:38 AM
#3251
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

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).

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

29 May 2020, 8:06 PM
#3252
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

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.

3 Jun 2020, 1:19 AM
#3253
snakes7575 avatar

snakes7575

New Zenner

Join Date:
Apr 2020
Location:
italia
Posts:
19
Plugin Contributions:
0

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

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.

4 Jun 2020, 12:14 AM
#3254
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

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..

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

4 Jun 2020, 11:05 PM
#3255
snakes7575 avatar

snakes7575

New Zenner

Join Date:
Apr 2020
Location:
italia
Posts:
19
Plugin Contributions:
0

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

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.

6 Jun 2020, 6:59 AM
#3256
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

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.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

8 Jun 2020, 4:40 AM
#3257
sungmo avatar

sungmo

New Zenner

Join Date:
Jan 2010
Posts:
79
Plugin Contributions:
0

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.

8 Jun 2020, 9:32 AM
#3258
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

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)?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

9 Jun 2020, 6:32 AM
#3259
sungmo avatar

sungmo

New Zenner

Join Date:
Jan 2010
Posts:
79
Plugin Contributions:
0

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

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.

12 Jun 2020, 12:11 AM
#3260
gohealth avatar

gohealth

New Zenner

Join Date:
Nov 2011
Location:
Brisbane, Australia
Posts:
35
Plugin Contributions:
0

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

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