Jump to content
Nimmit

AJAX Attribute Manager support

Recommended Posts

@John W,

 I do not get this error and never saw it.

This var (constant) is defined in the atrtributeManagerConfig.class.php line 109:

		$this->add('AM_SESSION_VAR_NAME','am_session_var'); // main var for atomic

When I apply your suggested fix I get this error:

Parse error: syntax error, unexpected '' (T_STRING), expecting ',' or ')' in C:\xampp_php_7_2\htdocs\2341-Frozen-QTPro\admin\attributeManager\includes\attributeManagerUpdateAtomic.inc.php on line 27

EDIT: Checked again and now it works flawless. Must have copied uncomplete or whatever. The fix looks good.

I'll await if you find more issues and the update.

best regards

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Yes, I traced it back to that.  That's weird you get a parse error, because I'm using your version 2.9.4.  I'm assuming you pasted it just as I posted it. 


I'm not really a dog.

Share this post


Link to post
Share on other sites

Using 2.9.4, options that have prices attached are not permantly changing when a new price is entered, but revert back to previous price.  If I change the price, it changes for a second then goes back to price before. 


I'm not really a dog.

Share this post


Link to post
Share on other sites

Using 2.9.3 the price change works for me, so it's something changed in 2.9.4.  Seems to be one of the class files. 


I'm not really a dog.

Share this post


Link to post
Share on other sites

There is an undefined var warning if a product doesn't have options, so here's another isset fix. I try to get everything running clear with E_ALL.

In file attributeManager2.9.4\attributeManager.php on line 484 find

			<td align="right" colspan="<?php echo (sizeof($options)+2); ?>">

changed to

      <td align="right" colspan="<?php if (isset($options)) { echo (sizeof($options)+2);} ?>">

 


I'm not really a dog.

Share this post


Link to post
Share on other sites
On 12/7/2018 at 4:36 PM, John W said:

Using 2.9.4, options that have prices attached are not permantly changing when a new price is entered, but revert back to previous price.  If I change the price, it changes for a second then goes back to price before. 

 

On 12/7/2018 at 5:08 PM, John W said:

Using 2.9.3 the price change works for me, so it's something changed in 2.9.4.  Seems to be one of the class files. 

@John W,

I had a look on this and it seems to me it's not an Attribute manager version issue. It's an issue with PHP 7.2.

I checked all versions from 2.9 to 2.9.4 on PHP 7.1 and the price change works correct with all of them.

Then I checked the same under PHP 7.2 and the price change doesn't work with none of the attribute manager versions.

Can you confirm this, please. I'll have a deeper look to search a fix.

Share this post


Link to post
Share on other sites

I should have mentioned, I'm using 7.0 right now on my test site where this problem showed up.  2.9.3 is working fine on my test site running 7.0.  

I'm a little behind on getting some updgrades done.  My live site is using 5.6, so I'm preparing to move it to 7.0, then onward.  December is a good month for me to work on this. I've been a little burned out on this for a while.  Have some mods in my Admin I've been putting off dealing with, thus sticking with 5.6.


I'm not really a dog.

Share this post


Link to post
Share on other sites

Now it  is getting interesting:

Checked on PHP 7.0 and the price update doesn't work with none of the am versions from 2.9 to 2.9.4.

PHP 7.1 all versions are working, PHP 7.2 none is working.

Can you please check your am config file if you have the same add-on support settings used in both versions and post them. I have all support switched off.

Share this post


Link to post
Share on other sites

I am using an older version of 7.0 on my test site, so I'll upgrade that and see if it changes.  I doubt that's it, but maybe another setting I have.  I have Apache, php, and mysql all separately installed.  The AM_USE_TEMPLATES was set to true, but I have changed it to false and it still works.  The only  setting to true is

        $this->add('AM_USE_QT_PRO', true);

But, I tried changing it to false and prices still update correctly.

All the settings were the same on 2.9.4.  I figured it had something to do with "Product Attribute Code".

Let me see if have time to update my php version of 7.0


I'm not really a dog.

Share this post


Link to post
Share on other sites

Okay, I updated to 7.0.33 and it still works with 2.9.3.  This is on my Win 7 x64 running php 7.0.33 NTS 32 bit. 


I'm not really a dog.

Share this post


Link to post
Share on other sites

It's a cache issue.

Under PHP 7.2:

1. installed new fresh Frozen CE

2. Added AM 2.9.3 => works

3. Updated to AM 2.9.4 => doesn't work

4. Downgraded to AM 2.9.3 => doesn't work

5. Deleted session and browser cache => 2.9.3 works again

6. Updated to 2.9.4 and deleted cache and session => doesn't work

=> now I can recreate your scenario and try to find the error

Share this post


Link to post
Share on other sites

I think you're on to it.  I went to 7.1.25 and it didn't work on either.  Went back down to 7.0.33 and neither worked again.  Restarted my browser and 2.93 works now.  My head was starting to hurt.

Unfortunately, I have to go cut the grass.  Fortunately, it's 77 degrees outside, so that's not too bad. 


I'm not really a dog.

Share this post


Link to post
Share on other sites

@John W,

I finally went through all changes step by step and could localize the error.

In javascript/attributeManager.js within the amUpdate function I had accidentally removed these lines when removing the attributes code support:

	amSendRequest('amAction=update&option_id='+optionId+'&option_value_id='+optionValueId+'&price='+getDropDownValue('price_'+optionValueId)+'&prefix='+getDropDownValue('prefix_'+optionValueId)+'&sortOrder='+getDropDownValue('sortOrder_'+optionValueId)+'&image='+getDropDownValue('image_'+optionValueId)+'&weight='+getDropDownValue('weight_'+optionValueId)+'&weight_prefix='+getDropDownValue('weight_prefix_'+optionValueId)+'&code_suffix='+getDropDownValue('code_suffix_'+optionValueId)+'&suffix_sort_order='+getDropDownValue('suffix_sort_order_'+optionValueId),'',false);
	getElement('price_'+optionValueId).blur();
    if ((weight != null) && (weight_prefix != null)) getElement('weight_'+optionValueId).blur();
    var el = getElement('sortOrder_'+optionValueId);
	if(el != null) el.blur();
	return false;

I found some other minor glitches.

Tested with: PHP 7.0, 7.1 and 7.2, QTPro support and sort order support.

Here the new package version 2.9.5. Please replace all files.

Please try and let me know.

Thanks for all your help and support.

AJAX-AttributeManager-V2.9.5 BS.zip

Edited by raiwa

Share this post


Link to post
Share on other sites

@raiwa

Seems to work with 2.9.5 with a quick test.  I'll let you know if I find anything else. 

Thanks for all your work on this.

Edited by John W

I'm not really a dog.

Share this post


Link to post
Share on other sites

Update uploaded with the above fixes:

AJAX Attribute Manager BS 2.9.5

+ Fixed accidentally removed code which broke the price update. Thanks to @John W
+ Fixed some other minor glitches and code cleanup.

Share this post


Link to post
Share on other sites

Hello Rainer,

Sorry to bother you. Working on FROZEN BS3 with php 7.2 and AJAX-AttributeManager-V2.9.5 BS I just noticed that trying to add the attribute image on the categories page there is no way to upload it as there is on the products attribute page. On the categories page when clicking on the add image icon I get the following which does not have any upload available, so what do you think could be done ?

Thank you.

Barbie

 

Screenshot (31).png

Share this post


Link to post
Share on other sites

Hello @artfulweb,

Sorry, image upload via Attribute Manager is not supported.

Please see Instructions:

NOTE:
- Options images are displayed both, Products Options Images and Options Value Images
- Only Products Options Images can be added, edited or deleted in Ajax Attribute Manager
- No image file uploads, images need to be uploaded apart (via ftp or the core attributes page) and image filenames need to be introduced like for download files.

Images must be uploaded to the directory: images/options/

 

Kind regards

Rainer

 

Share this post


Link to post
Share on other sites

Sorry Rainer,  I missed that. Otherwise it works great and is really a must have!

Have a Happy New Year

Barbie

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×