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,384

Results 3,501 to 3,520 of 3,609
7 Mar 2023, 2:01 PM
#3501
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

zamzom:

So far so good.
Thank you mc12345678 for your quick attention and neat corrections.
I will keep reporting other issues when I come accross.

Few more things I recently encountered:
Now, the search functions in the admin/products_with_attributes_stock page. However, if the search results are more than one page, next page button does not work. It takes you to the full list of products' second page. I coudn't go into the reason of that because I have more important issues I have to fix first, but I am suspecting that it is due to POSTed values again.

Another thing I have noticed; SBA makes modifications in functions_lookups.php file in two functions:
zen_get_products_stock
zen_check_stock

/**

  • functions_lookups.php
  • Lookup Functions for various core activities related to countries, prices, products, product types, etc
  • @package functions
  • @copyright Copyright 2003-2016 Zen Cart Development Team
  • @copyright Portions Copyright 2003 osCommerce
  • @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  • @version $Id: Author: mc12345678 Tue Feb 2 16:23:08 2016 -0500 Modified in v1.5.5 $
  • Stock by Attributes 1.5.4 15-12-21 mc12345678
    */
> 
> Nevertheless, it seems in ZC 1.5.8 these functions are moved into functions_products.php and a notifier mechanism is incorporated.
> I wonder if these modifications can be carried there as is?

Regarding the logs of display of items meeting the search criteria when navigating to another page: 
I was able to duplicate the issue using the Zen Cart default product and found a solution. I tested by searching for product with the letter e. I was presented more than one page of product when using the sba default of 25 items per screen. 
Navigating to another page using either the dropdown or next page resulted in going to the selected page but included product that didn't have the letter e.
The cause is that the call to display the links does not include the parameters associated with filtering, sorting or the like. 
That information should be included/added to the fourth parameter of the displaylinks method of the splitPageResults class object in a way to respect the page change and omission of any other parameter that should not apply in a page change. 

An update is to follow along with the previous changes being more discreet.

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

11 Apr 2023, 8:53 PM
#3502
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

is image swap still working in this new version from github with zen 1.5.6c
installed but no swapping
have 1 product 1 attribute field 2 options sba tracked and sba simple dropdown

12 Apr 2023, 8:21 AM
#3503
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:

is image swap still working in this new version from github with zen 1.5.6c
installed but no swapping
have 1 product 1 attribute field 2 options sba tracked and sba simple dropdown

It wasn't purposefully removed if that's of any consolation. There are a number of reasons why it may not be operational on the specific site or even just the one page. It involves javascript so aspects of the page must be evaluated to ensure all things align sufficiently.

Considerations:
Is the javascript option value trigger sent to the browser.
Is there javascript code associated with doing the swap in the html code?
Does the page pass html validation?
Are there javascript errors when loading the page?
Is there other javascript/jQuery code successfully executing on page load? If so, what is it doing that might be interfering?

Again, no the functionality was not purposefully removed, might even be a configuration switch not being set to support image swap.

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

13 Apr 2023, 10:03 PM
#3504
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

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

I've come across an issue where attempting to update a custom id via admin causes an Error 500 result when attempting to save the update.
Site is running ZC 1.5.8 with SBA version 1.5.4 taken from GitHub in the last 4 weeks.

Can you replicate this issue?

Zen Cart developer since 2009 — Zen Cart Solutions
Ecommerce development, integrations & automation — Junction Solutions

13 Apr 2023, 11:33 PM
#3505
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

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

strelitzia:

I've come across an issue where attempting to update a custom id via admin causes an Error 500 result when attempting to save the update.
Site is running ZC 1.5.8 with SBA version 1.5.4 taken from GitHub in the last 4 weeks.

Can you replicate this issue?

The logged error is

[14-Apr-2023 01:31:00 Europe/Paris] Request URI: /admintest/index.php?cmd=products_with_attributes_stock_ajax&save=1&pid=12863, IP address: ::1
--> PHP Fatal error: Uncaught Error: Call to protected method queryFactory::getBindVarValue() from context 'products_with_attributes_stock' in /Users/dev/Sites/localhost/trose/admintest/includes/classes/products_with_attributes_stock.php:918
Stack trace:
#0 /Users/dev/Sites/localhost/trose/admintest/products_with_attributes_stock_ajax.php(30): products_with_attributes_stock->saveAttrib()
#1 /Users/dev/Sites/localhost/trose/admintest/index.php(11): require('/Users/steph/Si...')
#2 {main}
thrown in /Users/dev/Sites/localhost/trose/admintest/includes/classes/products_with_attributes_stock.php on line 918.

Zen Cart developer since 2009 — Zen Cart Solutions
Ecommerce development, integrations & automation — Junction Solutions

14 Apr 2023, 12:31 AM
#3506
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

strelitzia:

The logged error is

[14-Apr-2023 01:31:00 Europe/Paris] Request URI: /admintest/index.php?cmd=products_with_attributes_stock_ajax&save=1&pid=12863, IP address: ::1
--> PHP Fatal error: Uncaught Error: Call to protected method queryFactory::getBindVarValue() from context 'products_with_attributes_stock' in /Users/dev/Sites/localhost/trose/admintest/includes/classes/products_with_attributes_stock.php:918
Stack trace:
#0 /Users/dev/Sites/localhost/trose/admintest/products_with_attributes_stock_ajax.php(30): products_with_attributes_stock->saveAttrib()
#1 /Users/dev/Sites/localhost/trose/admintest/index.php(11): require('/Users/steph/Si...')
#2 {main}
thrown in /Users/dev/Sites/localhost/trose/admintest/includes/classes/products_with_attributes_stock.php on line 918.

That was an issue discussed a few posts back. Resolved in the github repo currently available. I pushed updates a few days ago to address all of the recently identified issues.

That log btw is alerting to the fact that a method within the class has become a little more "hidden" (protected) from being accessed by just anything.

See this post and the one quoted in it for the discussion: https://www.zen-cart.com/showthread.php?47180-Stock-by-Attribute-v4-0-addon-for-v1-3-5-1-3-9&p=1393538#post1393538

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

14 Apr 2023, 12:43 AM
#3507
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

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

mc12345678:

That was an issue discussed a few posts back. Resolved in the github repo currently available. I pushed updates a few days ago to address all of the recently identified issues.

Thanks McNumbers. I'll update the site with the latest GitHub repo files and retest. If I get any further issues I'll let you know.

Zen Cart developer since 2009 — Zen Cart Solutions
Ecommerce development, integrations & automation — Junction Solutions

14 Apr 2023, 9:36 AM
#3508
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

strelitzia:

Thanks McNumbers. I'll update the site with the latest GitHub repo files and retest. If I get any further issues I'll let you know.

Much appreciated.

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

27 May 2023, 1:42 PM
#3509
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

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

I tried to install SBA on my test installation, and get this error message:

[27-May-2023 09:38:40 America/New_York] PHP Fatal error: Cannot redeclare zen_output_string() (previously declared in C:\wamp64\www\newnaturals\ADMIN\includes\functions\general.php:39) in C:\wamp64\www\newnaturals\includes\functions\functions_general_shared.php on line 40
[27-May-2023 09:38:40 America/New_York] PHP Stack trace:
[27-May-2023 09:38:40 America/New_York] PHP 1. {main}() C:\wamp64\www\newnaturals\ADMIN\index.php:0
[27-May-2023 09:38:40 America/New_York] PHP 2. require() C:\wamp64\www\newnaturals\ADMIN\index.php:11
[27-May-2023 09:38:40 America/New_York] PHP 3. require() C:\wamp64\www\newnaturals\ADMIN\orders.php:12
[27-May-2023 09:38:40 America/New_York] PHP 4. require() C:\wamp64\www\newnaturals\ADMIN\includes\application_top.php:37
[27-May-2023 09:38:40 America/New_York] PHP 5. require_once() C:\wamp64\www\newnaturals\includes\autoload_func.php:37

[27-May-2023 09:38:40 America/New_York] Request URI: /newnaturals/ADMIN/index.php?cmd=orders, IP address: 127.0.0.1
--> PHP Fatal error: Cannot redeclare zen_output_string() (previously declared in C:\wamp64\www\newnaturals\ADMIN\includes\functions\general.php:39) in C:\wamp64\www\newnaturals\includes\functions\functions_general_shared.php on line 40.

I'm running PHP 7.4.3 on the test installation, and can't downgrade without going back to an earlier version of wamp, which I'm reluctant to do. Are you aware of any issues with the plugin and this version of PHP?

27 May 2023, 2:30 PM
#3510
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

HeleneWallis:

I tried to install SBA on my test installation, and get this error message:

[27-May-2023 09:38:40 America/New_York] PHP Fatal error: Cannot redeclare zen_output_string() (previously declared in C:\wamp64\www\newnaturals\ADMIN\includes\functions\general.php:39) in C:\wamp64\www\newnaturals\includes\functions\functions_general_shared.php on line 40
[27-May-2023 09:38:40 America/New_York] PHP Stack trace:
[27-May-2023 09:38:40 America/New_York] PHP 1. {main}() C:\wamp64\www\newnaturals\ADMIN\index.php:0
[27-May-2023 09:38:40 America/New_York] PHP 2. require() C:\wamp64\www\newnaturals\ADMIN\index.php:11
[27-May-2023 09:38:40 America/New_York] PHP 3. require() C:\wamp64\www\newnaturals\ADMIN\orders.php:12
[27-May-2023 09:38:40 America/New_York] PHP 4. require() C:\wamp64\www\newnaturals\ADMIN\includes\application_top.php:37
[27-May-2023 09:38:40 America/New_York] PHP 5. require_once() C:\wamp64\www\newnaturals\includes\autoload_func.php:37

[27-May-2023 09:38:40 America/New_York] Request URI: /newnaturals/ADMIN/index.php?cmd=orders, IP address: 127.0.0.1
--> PHP Fatal error: Cannot redeclare zen_output_string() (previously declared in C:\wamp64\www\newnaturals\ADMIN\includes\functions\general.php:39) in C:\wamp64\www\newnaturals\includes\functions\functions_general_shared.php on line 40.

> I'm running PHP 7.4.3 on the test installation, and can't downgrade without going back to an earlier version of wamp, which I'm reluctant to do. Are you aware of any issues with the plugin and this version of PHP?

What is the origin of the installed version? That obtained from github doesn't cause this issue when only the software for the plug in and the associated Zen Cart version are installed.

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

27 May 2023, 3:04 PM
#3511
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

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

HeleneWallis:

I tried to install SBA on my test installation, and get this error message:

[27-May-2023 09:38:40 America/New_York] PHP Fatal error: Cannot redeclare zen_output_string() (previously declared in C:\wamp64\www\newnaturals\ADMIN\includes\functions\general.php:39) in C:\wamp64\www\newnaturals\includes\functions\functions_general_shared.php on line 40
[27-May-2023 09:38:40 America/New_York] PHP Stack trace:
[27-May-2023 09:38:40 America/New_York] PHP 1. {main}() C:\wamp64\www\newnaturals\ADMIN\index.php:0
[27-May-2023 09:38:40 America/New_York] PHP 2. require() C:\wamp64\www\newnaturals\ADMIN\index.php:11
[27-May-2023 09:38:40 America/New_York] PHP 3. require() C:\wamp64\www\newnaturals\ADMIN\orders.php:12
[27-May-2023 09:38:40 America/New_York] PHP 4. require() C:\wamp64\www\newnaturals\ADMIN\includes\application_top.php:37
[27-May-2023 09:38:40 America/New_York] PHP 5. require_once() C:\wamp64\www\newnaturals\includes\autoload_func.php:37

[27-May-2023 09:38:40 America/New_York] Request URI: /newnaturals/ADMIN/index.php?cmd=orders, IP address: 127.0.0.1
--> PHP Fatal error: Cannot redeclare zen_output_string() (previously declared in C:\wamp64\www\newnaturals\ADMIN\includes\functions\general.php:39) in C:\wamp64\www\newnaturals\includes\functions\functions_general_shared.php on line 40.

I'm running PHP 7.4.3 on the test installation, and can't downgrade without going back to an earlier version of wamp, which I'm reluctant to do. Are you aware of any issues with the plugin and this version of PHP?

I believe I've located the problem, and it's not related to the PHP version. The version of \ADMIN\includes\functions\general.php that's in the current SBA download does contain the zen_output_string declaration at line 39, plus several others that are duplicated, and which turn up if you comment out the first one. I restored the original general.php file from the 1.5.7d download and the SBA installation appears to be installing and working correctly.

27 May 2023, 3:05 PM
#3512
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

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

mc12345678:

What is the origin of the installed version? That obtained from github doesn't cause this issue when only the software for the plug in and the associated Zen Cart version are installed.

I installed the version that's currently in the plugin section of this site.

27 May 2023, 3:27 PM
#3513
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

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

The other thing I've encountered is that not all the configuration options are showing up. Mine stops at "Show Notice of Combining Cart on Login." So I can't get to where you edit attribute quantities. No errors on this.

Attachment 20304

27 May 2023, 4:48 PM
#3514
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

HeleneWallis:

The other thing I've encountered is that not all the configuration options are showing up. Mine stops at "Show Notice of Combining Cart on Login." So I can't get to where you edit attribute quantities. No errors on this.

Attachment 20304

That among other things would be related to using that very outdated version. The github version, depending on the Zen Cart version has little to no file touches and even then only dependent on the need of additional features offered by SBA.

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

27 May 2023, 5:13 PM
#3515
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

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

mc12345678:

That among other things would be related to using that very outdated version. The github version, depending on the Zen Cart version has little to no file touches and even then only dependent on the need of additional features offered by SBA.

I used the button labeled 'Download Latest' simply for convenience. But I suspect many people don't have any idea how to pick things up from Github, since there doesn't appear to be a complete package available there. Please correct me if I'm wrong about that.

I'll uninstall what I have now and reinstall the latest, but is there any reason the latest can't be available direct from the plugin page? Is it because of the differences in files between Zencart versions?

27 May 2023, 5:53 PM
#3516
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

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

HeleneWallis:

I used the button labeled 'Download Latest' simply for convenience. But I suspect many people don't have any idea how to pick things up from Github, since there doesn't appear to be a complete package available there. Please correct me if I'm wrong about that.

I'll uninstall what I have now and reinstall the latest, but is there any reason the latest can't be available direct from the plugin page? Is it because of the differences in files between Zencart versions?

Never mind the above, I'm brain dead today. I had already downloaded the zip file for the latest from Github, got interrupted and forgot that I'd done it.

27 May 2023, 6:07 PM
#3517
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

HeleneWallis:

I used the button labeled 'Download Latest' simply for convenience. But I suspect many people don't have any idea how to pick things up from Github, since there doesn't appear to be a complete package available there. Please correct me if I'm wrong about that.

I'll uninstall what I have now and reinstall the latest, but is there any reason the latest can't be available direct from the plugin page? Is it because of the differences in files between Zencart versions?

Nope, it's because I haven't devoted the time necessary to create instructions that fully describe the capability, usage, installation, and removal. The package on github is complete (sans the same instruction), the difference is that Zen Cart has been further developed to not require file changes previously considered necessary.

The plug-in from that zip file is functional for all Zen Cart 1.5.x versions for which there is a version sub directory. Installation is by the use of the base includes and the base ADMIN directories followed by the files of the Zen Cart version subdirectory of the servers version. In all cars if a file in the zip exists on the server, then should merge in the sba related modifications.

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

8 Jun 2023, 6:06 PM
#3518
chuckrey avatar

chuckrey

Zen Follower

Join Date:
Aug 2020
Location:
Richarson
Posts:
160
Plugin Contributions:
0

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

I am curious to know if anyone has been able to use this plugin with the checkbox option yet for the 1.5.? Thank you!

8 Jun 2023, 8:54 PM
#3519
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

chuckrey:

I am curious to know if anyone has been able to use this plugin with the checkbox option yet for the 1.5.? Thank you!

And I'm curious if the question is asked because tried and failed or if to determine whether to try or not?

There are/were cases implemented, but use of check boxes may/may not be the optimum option. Would suggest describing your use case, if you don't mind.

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

9 Jun 2023, 12:59 PM
#3520
chuckrey avatar

chuckrey

Zen Follower

Join Date:
Aug 2020
Location:
Richarson
Posts:
160
Plugin Contributions:
0

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

mc12345678:

And I'm curious if the question is asked because tried and failed or if to determine whether to try or not?

There are/were cases implemented, but use of check boxes may/may not be the optimum option. Would suggest describing your use case, if you don't mind.

Products are furniture and more often then not multiple options must be chosen and check boxes would give a quick glance of all products to see what is in stock. Drop downs as I understand it will require them having to click each box to see the inventory count. So someone may want a 5 piece bedroom set and they may select 4 items then find the 5th item is out of stock which would then cause them to search for another item. As to the question of whether I have attempted to do myself.. I looked at the files and code and it is beyond my level of knowledge to make it happen. I will give it another look, but thought if someone made it work already, they could give me some direction as to where to look.