Jump to content
Nimmit

AJAX Attribute Manager support

Recommended Posts

Hello,

I updated the attribute manager for PHP7 and latest 2.3.4BS. There is also new support for @Tsimi 's Option Image add-on included.

- class constructor names updated to __construct

- empty class constructor added to attributeManager.class.php

- mysql_get_server_info updated to mysqli_get_server_info

- database table names, filenames and pats hardcoded

- included modified files are updated to latest 2.3.4BS EDGE

- support added for Options Images BS (latest version 1.5)

- old PHP4 versions removed

NOTE:

- Instructions are NOT yet updated

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

 

It would be great if users of both (ajax attribute Manager and Options Images) would give it a try for beta testing.

Also a PHP7 hardcore test, @BrockleyJohn ? would be perfect.

 

Thanks a lot in advance

Rainer

screen_admin_01.jpg

ajax-attribute-manager-2.3.4-BS.zip

Edited by raiwa

Share this post


Link to post
Share on other sites

Hi Rainer

I installed it into 2 different local test shops, one Edge and one Gold.
The first thing I found is when installing this into an Edge shop you'll have to change this
 

if ((basename($_SERVER["SCRIPT_NAME"]) == FILENAME_CATEGORIES)) {

into this

if ((basename($_SERVER["SCRIPT_NAME"]) == 'categories.php')) {

 

I had already a few color options setup but I cannot see the same result as you show in your screenshot and I don't get the images thumbnails and the "edit/remove" icons. This happens in both test shops, Edge and Gold.
Also trying to add new options won't give me any image upload feature.

Edited by Tsimi

Share this post


Link to post
Share on other sites

@Tsimi,

you are right, I included the wrong version (original old files)

This should be the good one:

 

ajax-attribute-manager-2.3.4-BS.zip

Edited by raiwa

Share this post


Link to post
Share on other sites

@raiwa

Thanks.
Now I can see the images listed when I edit a product.
I cannot edit, remove or add any images.

For example I want to edit the yellow image I click on the edit icon and I can see "yellow.jpg" now I change that to red.jpg and click the update button.
The moment I click on the button the page refreshes and kicks me out to the categories.php and it doesn't change the image.
Same happens with the remove icon.

How to add images? Just type the image file name? like blue.jpg?

 

Edited by Tsimi

Share this post


Link to post
Share on other sites

I will check again, under which php and osc version does this happen?

Did you apply the changes to template_top.php or replaced it with the provided file?

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

Edited by raiwa

Share this post


Link to post
Share on other sites

I tested this with latest Edge and Gold.
First I tested in Edge and I thought it might have to do something with a FILENAME_ that needs to be replaced but it happens with Gold too so it isn't the problem.
I double checked all the changes to template_top.php, categories.php and product_info.php

The option sort option also doesn't appear.

Share this post


Link to post
Share on other sites

Sort option is set to "false" in the config class file. If you wish to use it, edit:

        /**
         * Options Sort Order
         */
         $this->add('AM_USE_SORT_ORDER' , false);

Which PHP version, please

Edited by raiwa

Share this post


Link to post
Share on other sites

I just checked again under PHP 5.6, copied all files from the uploaded package and, yes in the provided template top FILENAME_CATEGORIES is still there and needs to be changed to hardcoded 'categories.php'.

Otherwise everything works for me. The same under PHP 7.1.

I'll continue checking.

Share this post


Link to post
Share on other sites

Just to be sure: javascript enabled? and which browser?

Share this post


Link to post
Share on other sites

Yup, javascript enabled.

Browser: Firefox 54

When I add or remove new options the ajax feature works just fine. No page refresh.
Only when I start to edit the image stuff it kicks me out to the categories page.

UPDATE:

It seems to work in Chrome though. :unsure: (Chrome Version 58.0.3029.110 (64-bit))

UPDATE OF UPDATE:

I have no idea what the (censored) just happened but now it does work in Firefox.
I hit ctrl+F5 once just to make sure and it works now. I did clear the cache before but it didn't change anything.

Oh well, I guess problem solved? Whatever it was.
Sorry for letting you chase a ghost bug.

Edited by Tsimi

Share this post


Link to post
Share on other sites

No problem, we found at least some issues, that's the sense of testing, thank you

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Because in Gold I get this now after I change an image from lets say black.jpg to red.jpg

Quote

1054 - Unknown column 'products_options_values_image' in 'field list'

select products_options_values_image from products_options_values where products_options_values_id = '18' AND language_id=1

[TEP STOP]

 

Edited by Tsimi

Share this post


Link to post
Share on other sites

You have your options images add-on installed there?

Latest version?

Edited by raiwa

Share this post


Link to post
Share on other sites

It's an old version but yes.

Let me quickly update to the latest 1.5 just to be sure.

 

Share this post


Link to post
Share on other sites

@raiwa

Updated to 1.5 and all is good.
Sorry Rainer but today I don't have my best day. I guess I should call it a night and go grab a couple of beers. I am not much of a help today, sorry. :sad:

Share this post


Link to post
Share on other sites

You are a big help, Thank You!!:wink::smile:

Edited by raiwa

Share this post


Link to post
Share on other sites

Hello

I've a quick question, I work with 2.8.14 because I've no BS Version. If I save a template I see in the  datebase all values like options_id, option_values_id, price_prefix, options_values_price, code_suffix, suffix_sort_order and so on, so far so fine. But if I load a saved template in another product I only get options_id, option_values_id and no other data. So I'm wondering if this behavior is normal.

Thanks!

Share this post


Link to post
Share on other sites

Hello Chris, @seechiller

I checked this and found an issue with code addition (code_suffix, suffix_sort_order). These fields get not auto installed in the am_attributes_to_templates table.

However if you have them there it should be all ok.

Do you use the additional code fields? If not switch the setting in the config class to false.

Then I tried without the code add on ( both settings for code and code sort order to false) and all works correct for me.

When you say " if I load a saved template in another product I only get options_id, option_values_id and no other data ", where exact do you check this? In the database? in which table(s)?

Does the template attributes get correct added to the product? Do you get any error message there?

 

rgds

Rainer

Share this post


Link to post
Share on other sites

Hi Rainer

Thanks for your answer.
 
I use the code addon, this is my main problem at the moment, I've entrys in `am_attributes_to_templates` for the fields 'code_suffix' and 'suffix_sort_order', so AM_USE_ATTRIBUTE_CODE and AM_USE_ATTRIBUTE_CODE_SORT are both true in the config. I also noticed that a ID field (with unique value) is missing, so editing with phpmyadmin or mysql console is not possible. I'm not sure what happens if i just add a id field with auto increment id.

My main problem is if i load a saved template into an product the fields 'code_suffix' and 'suffix_sort_order' are not populated with the values from the db (from table `am_attributes_to_templates`). I mean the fields are just empty in the product editing page (categories.php). The template attributes are correct added to the product but just without the values from 'code_suffix' and 'suffix_sort_order', I've to update each by hand on each product to which I add saved attribute templates. I got no visible errors, I've tried to debug this, but I'm not a programmer, just doing this as a helper for a friend.


Thanks
 

Chris

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

×