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

Results 2,541 to 2,560 of 3,609
31 May 2016, 5:04 AM
#2541
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

You are though missing at least one define definition: WARNING_PRODUCT_QUANTITY_ADJUSTED

31 May 2016, 4:41 PM
#2542
jsmoke222000 avatar

jsmoke222000

New Zenner

Join Date:
May 2016
Location:
LA
Posts:
17
Plugin Contributions:
0

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

Where do I need to add that definition?

31 May 2016, 4:53 PM
#2543
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

jsmoke222000:

Where do I need to add that definition?
In ZC 1.5.5 it is found in: includes/languages/english.php (or in your template override of the english.php language)

The define is: ```
define('WARNING_PRODUCT_QUANTITY_ADJUSTED',##'Quantity##has##been##adjusted##to##what##is##in##stock.##');

31 May 2016, 4:56 PM
#2544
jsmoke222000 avatar

jsmoke222000

New Zenner

Join Date:
May 2016
Location:
LA
Posts:
17
Plugin Contributions:
0

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

Thanks. I sent u another PM...

31 May 2016, 6:07 PM
#2545
jsmoke222000 avatar

jsmoke222000

New Zenner

Join Date:
May 2016
Location:
LA
Posts:
17
Plugin Contributions:
0

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

mc12345678:

In ZC 1.5.5 it is found in: includes/languages/english.php (or in your template override of the english.php language)

The define is: ```
define('WARNING_PRODUCT_QUANTITY_ADJUSTED',##'Quantity##has##been##adjusted##to##what##is##in##stock.##');


I added this before i sent u the zip file.  FYI, I tried to send u another PM but it's telling me that your mailbox is full.
31 May 2016, 6:09 PM
#2546
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

jsmoke222000:

Thanks. I sent u another PM...

FYI, came across that when I tried to add product to the cart in excess of what was available. Seeing as this store is likely new enough to fall in the ZC 1.5.5 fileset, the absence of that definition further implies that the template provided an english.php file that is from an older version and was not merged with the existing fileset or some other change has been made to remove it. Default operation would load the template override language and then come back and load the default language file of the same language. Thus if the define applicable to a standard ZC store was not provided in the template, the default language would "catch" it. Another reason to indicate that a template install/plugin modified that file which may be missing other items as well in that file or elsewhere.

31 May 2016, 6:23 PM
#2547
jsmoke222000 avatar

jsmoke222000

New Zenner

Join Date:
May 2016
Location:
LA
Posts:
17
Plugin Contributions:
0

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

I have the original template files if u need me to send them to you. Just let me know.

31 May 2016, 6:57 PM
#2548
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

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

zc 1.5.5a, Responsive Sheffield Blue 2.0, IH4, SbyA github downloaded Apr 12 2016 (and now looking at v as of May 31 2016 github)

I didn't realize SbyA was capable of swapping out main image according to single attribute. I was unsuccessful doing a test product so looking to see what I've missed.

In the changelog of github recent files there is this bit:

Example (using zen_lightbox mod)
document.write('<?php echo '<a href="' . zen_lightbox($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT) . '" rel="' . $rel . '" title="' . addslashes($products_name) . '">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT,'id="SBA_ProductImage"') . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');

And I can see in my /custom template/templates/tpl_mod_prod_main_img where this would go and I presume I would not inclue the document.write( and ending )

Responsive Sheffield Blue uses zen_colorbox, not lightbox. Can I substitute the former for the latter?

If I can, then I'll next ask about inc/classes/order with which I had a nerve racking merge experience ;o) If I can't maybe I'll just leave well enough alone.

My SbyA is working perfectly as near as I can tell - been using it since zc 1.3.7 but if I can do the attribute image swapper it would be very appealing to me - I would switch dual attribute products to single attribute (colour) and handle the other attribute (size) by category placement.

31 May 2016, 11:09 PM
#2549
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

@Soxophoneplayer, sorry for the delay in responding. So the only thing added to that file that specifically relates to SBA is the addition of the id for the primary image. The two listings of the document.write and without offer javascript based image "handling" for the first and standard html for the second. Perhaps a leap of logic, but if the first is not supported by the browser then the second doesn't need to have the id because if it doesn't support javascript then the that data will not provide any benefit. :) think about that one a second.

As to the use of lightbox/colorbox. The code as provided on this site using the colorbox name is no longer supported. That is not to say that it is the same code provided in the template. Use whatever works for you, the important part is that for the image swap to work the image needs to have an id that matches whatever is in the code or perhaps an alternate javascript function could be applied/used.

As to includes/classes/order.php, well, a large majority of the code has been removed from that file with it loaded/addressed using notifiers. In fact so much so that in ZC 1.5.5, there are no changes made to the file at all. In Zc 1.5.3/1.5.4 only needed one small change to capture an autocreated number during checkout to support logging attributes in a separate table. Yes, the older version(s) had a lot of code inserted that was relatively easily moved out to minimize the file mods... now if something else has modified the file, then there might be something with which to contend.

3 Jun 2016, 12:34 PM
#2550
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

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

zc 1.5.5a

Updating my test site from SbyA github I downloaded Mar 3 2016, to new version May 31 2016. Should I run uninstall script before running install script? Or do I need to run the install script at all re the new file set?

3 Jun 2016, 1:08 PM
#2551
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

soxophoneplayer:

zc 1.5.5a

Updating my test site from SbyA github I downloaded Mar 3 2016, to new version May 31 2016. Should I run uninstall script before running install script? Or do I need to run the install script at all re the new file set?

In review of the commit history based on that date range and the changes made, the suggestion would be to 1) download the current (updated today) version, 2) run the install again, 3) not remove the plugin (without backup of the products_with_attributes_stock table) if desired to continue using the variants previously created.

Rerunning the install will reset the SBA associated admin configuration options applied, but will also update the database to contain changes incorporated between those dates that have a potential to affect the option name type added by SBA to provide javascript related information when product have a single option name.

3 Jun 2016, 4:20 PM
#2552
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

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

mc12345678:

...Rerunning the install will reset the SBA associated admin configuration options applied, but will also update the database to contain changes incorporated between those dates that have a potential to affect the option name type added by SBA to provide javascript related information when product have a single option name.

Files updated. On clicking install script I get an 'error, please refresh and try again'. The only two files different since my last update were admin/SbyA_install, and admin/incl/classes/observers/class.products_with_attributes_stock

Is there a chance there was nothing new the installer needed to do, generating the error? Or is there something I can look for to see if the update happened? The mod seems to be functioning but unsure if there is something I should look at to double check.

(It's also not a big deal for me to uninstall then re-install if that's safest bet - I've only got half a dozen products on this mod so far and I'm just trying to establish best update procedure on the test so my ducks are lined up for live update.)

3 Jun 2016, 4:23 PM
#2553
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

soxophoneplayer:

Files updated. On clicking install script I get an 'error, please refresh and try again'. The only two files different since my last update were admin/SbyA_install, and admin/incl/classes/observers/class.products_with_attributes_stock

Is there a chance there was nothing new the installer needed to do, generating the error? Or is there something I can look for to see if the update happened? The mod seems to be functioning but unsure if there is something I should look at to double check.

(It's also not a big deal for me to uninstall then re-install if that's safest bet - I've only got half a dozen products on this mod so far and I'm just trying to establish best update procedure on the test so my ducks are lined up for live update.)

Can you provide the log data for the error generated? Omit the admin directory please. Next, which "version" was used for this test? The one from today or the one from 31 Mar?

3 Jun 2016, 4:49 PM
#2554
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

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

mc12345678:

Can you provide the log data for the error generated? Omit the admin directory please. Next, which "version" was used for this test? The one from today or the one from 31 Mar?

This was on version from today, but hit same error message yesterday with March version - log same. (The curl error shos all the time on my wamp test site.)

[03-Jun-2016 16:11:18 UTC] Request URI: /xxxxxxxxx/options_name_manager.php, IP address: ::1
#1 trigger_error() called at [C:\wamp\www\includes\functions\plugin_support.php:68]
#2 plugin_version_check_for_updates() called at [C:\wamp\www\xxxxxxxx\includes\init_includes\init_responsive_sheffield_blue.php:89]
#3 require(C:\wamp\www\xxxxxxxxx\includes\init_includes\init_responsive_sheffield_blue.php) called at [C:\wamp\www\includes\autoload_func.php:48]
#4 require(C:\wamp\www\includes\autoload_func.php) called at [C:\wamp\www\xxxxxxxxx\includes\application_top.php:171]
#5 require(C:\wamp\www\xxxxxxxxx\includes\application_top.php) called at [C:\wamp\www\xxxxxxx\options_name_manager.php:12]

[03-Jun-2016 16:11:18 UTC] PHP Notice: CURL error checking plugin versions: 60:SSL certificate problem: self signed certificate in certificate chain
Trying file_get_contents() instead. in C:\wamp\www\includes\functions\plugin_support.php on line 68

[03-Jun-2016 16:11:18 UTC] PHP Stack trace:

[03-Jun-2016 16:11:18 UTC] PHP 1. {main}() C:\wamp\www\xxxxxxx\options_name_manager.php:0

[03-Jun-2016 16:11:18 UTC] PHP 2. require() C:\wamp\www\xxxxxx\options_name_manager.php:12

[03-Jun-2016 16:11:18 UTC] PHP 3. require() C:\wamp\www\xxxxxxx\includes\application_top.php:171

[03-Jun-2016 16:11:18 UTC] PHP 4. require() C:\wamp\www\includes\autoload_func.php:48

[03-Jun-2016 16:11:18 UTC] PHP 5. plugin_version_check_for_updates() C:\wamp\www\xxxxxxxxx\includes\init_includes\init_responsive_sheffield_blue.php:89

[03-Jun-2016 16:11:18 UTC] PHP 6. trigger_error() C:\wamp\www\includes\functions\plugin_support.php:68

3 Jun 2016, 5:06 PM
#2555
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:

Can you provide the log data for the error generated? Omit the admin directory please. Next, which "version" was used for this test? The one from today or the one from 31 Mar?

Nevermind. Apparently in the last couple of days, an errant \ got added at the first character of line 644 of the install code (admin/stock_by_attr_install.php)...

shaking head... Sheesh...

It is removed from the files in github.

Yes, those were the only two files updated since the 31st of Mar...

I guess I could put it another way. At the moment and for a while, I do not expect that any changes will occur to the existing SBA database tables, so therefore I don't see why one would need/want to fully remove the plugin. I am trying to ensure that "reinstalls" do not break the cart (thank you for identifying that there was an issue though), but instead allow forward movement/operation. Later, some things could probably be pulled out of the code.

3 Jun 2016, 5:13 PM
#2556
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

soxophoneplayer:

This was on version from today, but hit same error message yesterday with March version - log same. (The curl error shos all the time on my wamp test site.)

[03-Jun-2016 16:11:18 UTC] Request URI: /xxxxxxxxx/options_name_manager.php, IP address: ::1
#1 trigger_error() called at [C:\wamp\www\includes\functions\plugin_support.php:68]
#2 plugin_version_check_for_updates() called at [C:\wamp\www\xxxxxxxx\includes\init_includes\init_responsive_sheffield_blue.php:89]
#3 require(C:\wamp\www\xxxxxxxxx\includes\init_includes\init_responsive_sheffield_blue.php) called at [C:\wamp\www\includes\autoload_func.php:48]
#4 require(C:\wamp\www\includes\autoload_func.php) called at [C:\wamp\www\xxxxxxxxx\includes\application_top.php:171]
#5 require(C:\wamp\www\xxxxxxxxx\includes\application_top.php) called at [C:\wamp\www\xxxxxxx\options_name_manager.php:12]

[03-Jun-2016 16:11:18 UTC] PHP Notice: CURL error checking plugin versions: 60:SSL certificate problem: self signed certificate in certificate chain
Trying file_get_contents() instead. in C:\wamp\www\includes\functions\plugin_support.php on line 68

[03-Jun-2016 16:11:18 UTC] PHP Stack trace:

[03-Jun-2016 16:11:18 UTC] PHP 1. {main}() C:\wamp\www\xxxxxxx\options_name_manager.php:0

[03-Jun-2016 16:11:18 UTC] PHP 2. require() C:\wamp\www\xxxxxx\options_name_manager.php:12

[03-Jun-2016 16:11:18 UTC] PHP 3. require() C:\wamp\www\xxxxxxx\includes\application_top.php:171

[03-Jun-2016 16:11:18 UTC] PHP 4. require() C:\wamp\www\includes\autoload_func.php:48

[03-Jun-2016 16:11:18 UTC] PHP 5. plugin_version_check_for_updates() C:\wamp\www\xxxxxxxxx\includes\init_includes\init_responsive_sheffield_blue.php:89

[03-Jun-2016 16:11:18 UTC] PHP 6. trigger_error() C:\wamp\www\includes\functions\plugin_support.php:68

Umm... Only error I found while reviewing the changes made from back in March to now was the extra \ as described above... It was introduced yesterday into the repo, but I'm surprised if that did/could cause the list of log entries provided... Seems unrelated, but if removal of the \ fixes it, then somehow it is/was...

3 Jun 2016, 5:25 PM
#2557
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

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

mc12345678:

Nevermind. Apparently in the last couple of days, an errant \ got added at the first character of line 644 of the install code (admin/stock_by_attr_install.php)...

shaking head... Sheesh...

It is removed from the files in github.

Yes, those were the only two files updated since the 31st of Mar...

I guess I could put it another way. At the moment and for a while, I do not expect that any changes will occur to the existing SBA database tables, so therefore I don't see why one would need/want to fully remove the plugin. I am trying to ensure that "reinstalls" do not break the cart (thank you for identifying that there was an issue though), but instead allow forward movement/operation. Later, some things could probably be pulled out of the code.

I was checking my logs - thought all the logs were same, but the one I sent earlier was the one I was getting after failed update. I found the log from actual update attempt:
[03-Jun-2016 15:50:27 UTC] Request URI: /xxx/stock_by_attr_install.php, IP address: ::1
#1 trigger_error() called at [C:\wamp\www\includes\functions\plugin_support.php:68]
#2 plugin_version_check_for_updates() called at [C:\wamp\www\xxxx\includes\init_includes\init_responsive_sheffield_blue.php:89]
#3 require(C:\wamp\www\xxx\includes\init_includes\init_responsive_sheffield_blue.php) called at [C:\wamp\www\includes\autoload_func.php:48]
#4 require(C:\wamp\www\includes\autoload_func.php) called at [C:\wamp\www\xxxx\includes\application_top.php:171]
#5 require(C:\wamp\www\xxxx\includes\application_top.php) called at [C:\wamp\www\xxxxx\stock_by_attr_install.php:16]

[03-Jun-2016 15:50:27 UTC] PHP Notice: CURL error checking plugin versions: 60:SSL certificate problem: self signed certificate in certificate chain
Trying file_get_contents() instead. in C:\wamp\www\includes\functions\plugin_support.php on line 68

[03-Jun-2016 15:50:27 UTC] PHP Stack trace:

[03-Jun-2016 15:50:27 UTC] PHP 1. {main}() C:\wamp\www\xxxx\stock_by_attr_install.php:0

[03-Jun-2016 15:50:27 UTC] PHP 2. require() C:\wamp\www\xxxxx\stock_by_attr_install.php:16

[03-Jun-2016 15:50:27 UTC] PHP 3. require() C:\wamp\www\xxxxx\includes\application_top.php:171

[03-Jun-2016 15:50:27 UTC] PHP 4. require() C:\wamp\www\includes\autoload_func.php:48

[03-Jun-2016 15:50:27 UTC] PHP 5. plugin_version_check_for_updates() C:\wamp\www\xxxx\includes\init_includes\init_responsive_sheffield_blue.php:89

[03-Jun-2016 15:50:27 UTC] PHP 6. trigger_error() C:\wamp\www\includes\functions\plugin_support.php:68

I'll update that file. I also note the much of the error messages seem related to issue of Responsive Sheffield Blue 2.0 trying to check for a new version when there is none - as reported in that forum.

3 Jun 2016, 5:31 PM
#2558
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

Yeah, looks like in a way every admin action is being logged. :) what a "feature" :P. What version of ZC are you running? I thought I recalled something in the forum about an "earlier" version of the plugin check code that often would through that error because of something to do with the options setup on the server and the methods used by the plugin version check code.

3 Jun 2016, 6:17 PM
#2559
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

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

I'm on zc 1.5.5a

I tried doing the SbyA upgrade on classic green template with same error. But my Responsive Sheffield Blue 2.0 has core modifcations which must still be in play. I also tried substituting SbyA install file from last two versions - about 4 code changes in all I think - I tried with and without each line of change - all same result.

Also tried commenting out the call to version check the template, which did nothing but I may have commented out too much or not enough - I'm like a blind man running with scissors when I snip code ;o)

I did try doing a uninstall SbyA and then install. No errors. (That was with the version of files I was using yesterday, so without the install file and classes/observers fileupdate - but I will try that again with those. As you suggested, I lost my attribute stock numbers but its only a handful of products and its my test store so that's ok.

So unless its something to do with SbyA update vs SbyA install, its looking more and more like a template issue. I'll report back when I try today's SbyA updates as a fresh install.

3 Jun 2016, 6:32 PM
#2560
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

I did a search of the code earlier, SBA doesn't have a version check on it. The version checking software wasn't added until ZC 1.5.3. SBA has been trying to not only keep up with the changes in ZC but also with adding functionality. Version checking is not even on the radar yet, though because potteryhouse had updated ZC with a version functional in ZC 1.5.1, such a check could be incorporated.

As to a fresh install/update, the version check errors you are seeing are unrelated, but if you were able to run the update and not get a blank screen then an install ought to do the same especially now that the tables have been wiped/deleted because of the remove.

To address the version check issue I suggest searching the forum either from within or from outside, but it's not SBA related and I'm drawing a blank about why other than copying the same version check code from a more recent version of ZC.