Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

AJAX Attribute Manager support


Guest

Recommended Posts

Hello world <_<

 

I have, without problems, tested AJAX attribute manager with "Options as Images for MS2".

 

Now, I would like to incorporate it into the attribute manager. This would give the nice and

much needed capability to have options as images direct on the product level, saving tons

of hours of editing for a reasonable large store.

 

What is needed is a new field in the AJAX attribute manager, but how!?

 

I am not a coder... so I need help, please.

 

Sara

Link to comment
Share on other sites

I'am having a problem:

 

I have AttributeManager 2.8.4

 

I have tried to work with attribut_sort and it's works, but I have one problem with it:

When I save an attribute set with sort_order as a template and I load this template I get the following error:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/.../.../.../public_html/catalog/admin/includes/functions/database.php on line 55

 

Warning: Variable passed to each() is not an array or object in /home/.../.../.../public_html/catalog/admin/includes/functions/database.php on line 79

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where products_attributes_id =' at line 1

 

update products_attributes se where products_attributes_id =

 

[TEP STOP]

 

I have search for a whole day for a solutions but I can not find a solution.

Link to comment
Share on other sites

Hi there

 

the problom seems to be clear to me, reading your error message,

 

There seem to be an empty array passed to the update function ( as you can see on the SQL Statement thats missing the ID ...

 

This happens while saving a Set as a template???

 

will look into that

 

 

I'am having a problem:

 

I have AttributeManager 2.8.4

 

I have tried to work with attribut_sort and it's works, but I have one problem with it:

When I save an attribute set with sort_order as a template and I load this template I get the following error:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/.../.../.../public_html/catalog/admin/includes/functions/database.php on line 55

 

Warning: Variable passed to each() is not an array or object in /home/.../.../.../public_html/catalog/admin/includes/functions/database.php on line 79

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where products_attributes_id =' at line 1

 

update products_attributes se where products_attributes_id =

 

[TEP STOP]

 

I have search for a whole day for a solutions but I can not find a solution.

Link to comment
Share on other sites

ok

 

found the error, it happens if you load the template... its been fixed and i will upload as soon as i straigthend out other issues

 

Thanks!

 

I have two more questions:

1. Is it normal that I can't sort the attributes like example blue, red, black,.... until I save it first when creating a new product?

2. I can sort the attribute description like color, size,... in admin, but it's not sorted on product_info?

I think there is something missing in this code:

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");

 

Is this correct?

 

Many thanks for the support!

Link to comment
Share on other sites

Thanks!

 

I have two more questions:

1. Is it normal that I can't sort the attributes like example blue, red, black,.... until I save it first when creating a new product?

2. I can sort the attribute description like color, size,... in admin, but it's not sorted on product_info?

I think there is something missing in this code:

 

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");

 

Is this correct?

 

Many thanks for the support!

 

 

So just uploaded Version 2.8.5.

 

And I have to admit, that I never testet the sort order functionalityon a new product page. So while it would be basically working now (still not perfect), the download option would not work at all on a NON-Saved Product. So I disabled this alltogether for now.

 

This means.. add a product, set all the fields you need, save the product. Then go back in there again, and you have all the possibilities. This is not perfect, but it works...

I might look more into the issues, since the nonsaved Product functionalities are all done in an other class and everything is saved in the session.

 

And yes, you are right, of course, you have to change the products_options_query to order by the sortfield we're using in the attributeManagerConfig.class, actually both, also the one before your mentioned one... where it gets the product_attributes Distinct

Link to comment
Share on other sites

So just uploaded Version 2.8.5.

 

And I have to admit, that I never testet the sort order functionalityon a new product page. So while it would be basically working now (still not perfect), the download option would not work at all on a NON-Saved Product. So I disabled this alltogether for now.

 

This means.. add a product, set all the fields you need, save the product. Then go back in there again, and you have all the possibilities. This is not perfect, but it works...

I might look more into the issues, since the nonsaved Product functionalities are all done in an other class and everything is saved in the session.

 

And yes, you are right, of course, you have to change the products_options_query to order by the sortfield we're using in the attributeManagerConfig.class, actually both, also the one before your mentioned one... where it gets the product_attributes Distinct

 

 

Sorry I am very very confused here. I installed the Sort Order addon first as I was advised to do so:

http://www.oscommerce.com/community/contributions,1822

 

I did exactly as it said it checked to make sure the sort order box was now there. My problem is I go to do the Ajax Attribute Manager and I get to these instructions:

________________________________

Find (Around line 65)

 

$this->add('AM_FIELD_OPTION_SORT_ORDER','products_options_sort_order'); // Sort column on Products_options table

$this->add('AM_FIELD_OPTION_VALUE_SORT_ORDER','products_options_sort_order'); // Sort column on product_attributes table

 

Change the column name to whatever your sort column is called on each of your database tables

 

 

now add the fields you just changed in attributeMangagerConfig.class.php (products_options_sort_order)... change catalog/product_info.php:

___________________________

 

and I have no clue what to change or what to change it to exactly.

 

If anyone can help me out that would be great thank you alot.

 

Travis

Link to comment
Share on other sites

Not to shoot a dead horse but this is the error I get, but keep in mind I didn't do the confusing part on my above post right above this one, so I'm hoping its related:

 

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

Info Save Product before a

Link to comment
Share on other sites

Not to shoot a dead horse but this is the error I get, but keep in mind I didn't do the confusing part on my above post right above this one, so I'm hoping its related:

 

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

Info Save Product before a

 

What are you doing when that error shows up? But You need to seach for this, this seems to be a general session problem....

Link to comment
Share on other sites

Not to shoot a dead horse but this is the error I get, but keep in mind I didn't do the confusing part on my above post right above this one, so I'm hoping its related:

 

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/earga0/public_html/2nd/catalog/admin/includes/functions/sessions.php on line 123

Info Save Product before a

 

OK, well, I have actually come up the same thing once, but found that there *maybe* a bug for some instances, as it seems that others are working fine without this issue.

 

To correct this, just do the following:

 

1. Open the "catalog\admin\attributeManager\classes\attributeManagerConfig.class.php"

2. Look for:

 

/**

* Install templates if not already done so

*/

$this->installTemplates();

 

3. Remove it!

 

4. Look for:

/**

* Install the sort order tables if they dont already exist

*/

$this->installSortOrder();

 

5. Remove it!!

 

6. Look for:

$this->add('AM_SESSION_SORT_ORDER_INSTALL_CHECKED','am_sort_order_checked');

$this->add('AM_SESSION_TEMPLATES_INSTALL_CHECKED','am_templates_checked');

$this->add('AM_ACTION_GET_VARIABLE', 'amAction'); // attribute manager get variable name

$this->add('AM_PAGE_ACTION_NAME','pageAction'); // attribute manager parent page action e.g. new_product

 

7. ADD AFTER:

/**

* Install templates if not already done so

*/

$this->installTemplates();

/**

* Install the sort order tables if they dont already exist

*/

$this->installSortOrder();

 

8. Should be done!

 

The main issue here is that the attribute manager is trying to initialize the templates and sort order without getting the parameters fully loaded. The above changes will ensure that the parameters are added to the instance before the initialization happens.

 

Hope this help.

 

BTW: Attribute Manager is GREAT!

Link to comment
Share on other sites

Sorry I am very very confused here. I installed the Sort Order addon first as I was advised to do so:

http://www.oscommerce.com/community/contributions,1822

 

I did exactly as it said it checked to make sure the sort order box was now there. My problem is I go to do the Ajax Attribute Manager and I get to these instructions:

________________________________

Find (Around line 65)

 

$this->add('AM_FIELD_OPTION_SORT_ORDER','products_options_sort_order'); // Sort column on Products_options table

$this->add('AM_FIELD_OPTION_VALUE_SORT_ORDER','products_options_sort_order'); // Sort column on product_attributes table

 

Change the column name to whatever your sort column is called on each of your database tables

 

 

now add the fields you just changed in attributeMangagerConfig.class.php (products_options_sort_order)... change catalog/product_info.php:

___________________________

 

and I have no clue what to change or what to change it to exactly, what is my sort column name from each database?

 

If anyone can help me out that would be great thank you alot.

 

Travis

 

I'm not sure I should change anything until I figure out and complete the directions of what they said, as of right now I have not done the confusing part so doing the attribute manager with sort order is not completed.

 

Anyone have any idea what those directions are actually telling me to do above? Sorry I am just very confused.

 

Thank you for your replies by the way.

Edited by traviscar7
Link to comment
Share on other sites

Just wanted to say: GREAT CONTRIBUTION! I installed it on heavily modified osCommerce RC2a, and with only a minor fix suggested in the form, works great! I have only one request, that possibly in the future it be possible to have the actual price in the drop down menu. I tried to do integrate this with other actual price in drop down menu mods and failed miserably, as I am not a php programmer. Anyways, just a thought. And again, thanks for sharing the mod! :) :)

Link to comment
Share on other sites

I'm not sure I should change anything until I figure out and complete the directions of what they said, as of right now I have not done the confusing part so doing the attribute manager with sort order is not completed.

 

Anyone have any idea what those directions are actually telling me to do above? Sorry I am just very confused.

 

Thank you for your replies by the way.

 

Hey

 

its whats writen in this line:

 

$this->add('AM_FIELD_OPTION_SORT_ORDER','products_options_sort_order');

 

The first Word inside the paranthesis ist the key, the second the value. That means, if you would like to have the sort order Field another name, just rename the second value, wich now is 'products_options_sort_order'. This Field gets automatically added to the database tables.

 

To get the sort order to work on the front end, the SQL for the Options-Dropdowns has to be changed as well. So of course you have to change the ORDER BY clause in product_info.php to that field you just set (or use 'products_options_sort_order', if you didn't change that value)... i can't tell you where this is if you have changed code in there, on a fresh install its on Line 131:

 

      $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . 
TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and 
patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

 

thats the first SQL ... you see its ordered by popt.products_options_name, but this has to be sorted by the products_options_sort_order which is inside the Product_attributes Table, so ORDER BY patrib.products_options_sort_order would be correct

 

now the second SQL on line 134:

 
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, 
pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . 
(int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = 
pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

 

contains no order by. So you have to change this to:

 
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, 
pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . 
(int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = 
pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' ORDER BY pa.products_options_sort_order");

 

Maybe this also gets done if you install the first Sort Order addon, i dont know because i've never done this.

Link to comment
Share on other sites

Hi !

 

This is an awesome contribution.

 

Is there a way to include a quantity field though ? I did not find anything that would talk about it.

 

I'm using "Quantity for Product Attributes Mod" and I wish I could directly type quantity for each attribute.

 

Thanx !

-= K8L =-

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I am haveing a wierd error.

 

I have installed attributeManager in a new page separate from the product which is linked to from a button in the product listings. (Like the stock button in QT Pro). I edited the header.inc file to get it to come up but it will not update the prices in internet explorer. It works fine in firefox. All it says is:

 

Error: 0, Line: 108, "Object does nolt support this property or method". The error appears only onblur so it has to be in the javascript somewhere but I am more of a php guy.

 

I am going to have a crack at getting qt pro to work but I need to sort this. I can let someone know the url if they are interested.

 

Thanks,

 

Martin

Link to comment
Share on other sites

Hi,

 

I am haveing a wierd error.

 

I have installed attributeManager in a new page separate from the product which is linked to from a button in the product listings. (Like the stock button in QT Pro). I edited the header.inc file to get it to come up but it will not update the prices in internet explorer. It works fine in firefox. All it says is:

 

Error: 0, Line: 108, "Object does nolt support this property or method". The error appears only onblur so it has to be in the javascript somewhere but I am more of a php guy.

 

I am going to have a crack at getting qt pro to work but I need to sort this. I can let someone know the url if they are interested.

 

Thanks,

 

Martin

 

 

No worries, I sorted it. There were two var's missing in attributeManager.js before the price and prefix variables.

 

I sorted out QT pro as well, it basically came down to the

$this->registerPageAction('addStockToProduct','addStockToProduct');

at around line 42 being capitalised but not in the function. To fix just paste the code above over the relevent line and unpick the code a bit more. Once I got the function running it was all just tidying really. I was using the beta but I can post the code if desired.

 

Martin

Link to comment
Share on other sites

Tried to load Ajax Attribute Manager Beta, didn't work, tried to use the admin attribute side, and I now get this

 

1136 - Column count doesn't match value count at row 1

 

insert into products_attributes values (null, '34', '1', '1', '0', '+')

 

[TEP STOP]

 

Tried to go back to categories.php before changes, but to no avail.

 

help please

Link to comment
Share on other sites

I sorted out QT pro as well, it basically came down to the
$this->registerPageAction('addStockToProduct','addStockToProduct');

at around line 42 being capitalised but not in the function. To fix just paste the code above over the relevent line and unpick the code a bit more. Once I got the function running it was all just tidying really. I was using the beta but I can post the code if desired.

 

Martin

Yes please post the code to integrate QTPro with AJAX Attribute Manager.

Thank you,

EricK

Link to comment
Share on other sites

Thanks Chris Haar ...

To people who tried to fix this problem by changing the sessions.php file as discussed earlier in this thread, I'd advise you to back that change out ie. go back to the original sessions.php, and fix the problem properly the way Chris describes. Forcing tep_register_session to return the value that way is unsafe.

 

 

Re the QTPro - keen to see the mods made above. In my installation, I see QTPro units to enter, but putting them in just flicks the screen to the 'confirm product update' (this is after fixing the addStockToProduct name as recommended).

 

 

Great contribution though! My customer has 100s of products, and sizes/colours/fabrics etc for nearly all of them ... the default attributes manager was getting very unwieldy.

OSC User Definitions

"I can add modules to OSC" = I can search, cut and paste. But not well, or I wouldn't be here.

"I start my posting with 'works like a charm' = I'm letting you down gently, nothing works and I have no idea why

"I finish postings with "plzzzz....hlp" = My installation is buggered and I know I'm going to have to pay someone, but I really, really don't want to.

Link to comment
Share on other sites

AJAX Attribute Manager - v1 beta

 

 

What is this contribution??

The idea of this contribution is to make the administration of product options, option values and attributes much quicker and easier.

 

http://www.oscommerce.com/community/contributions,4063

 

mainScreen.gif

 

http://www.oscommerce.com/community/contributions,4041

 

It uses a technology known as AJAX (Asynchronous JavaScript And XML). This enables us to do is make page sub-reqests without refreshing a page.

In this case, it enables us to make a attribute manager that sits on the product addition page. From which, you can do everything (ish - see notes) that the product attributes page does but in a much more convenient and tidy way.

  • Installation takes 5 mins
  • Full Documentation in the package
  • Any future upgrades will require no editing

***** IMPORTANT *****

As this is a beta release. There will be updates to this contribution.

Please don't change anything and re-upload it the contribution section (even if it just a typo) untill it has been officialy released.

Please let us know of any bugs in the oscommerce forums - Thank you!

 

Any Comments welcomed

 

Nimmit :thumbsup:

Edited by acoyne
Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

Great contribution! I installed this on a client's store, and it looks great, but I'm having a weird problem with it. When I open up a product to edit, the Attribute Manager shows up properly, but when I expand an attribute, most of the names of options are blank. The prefixes and prices are still correct, but there's no way to tell which option you're actually looking at for the ones that are blank. I made a list of some of the options that were being displayed correctly and checked the "products_options_value" table in my database. Here's the strange part: Only options with a products_options_values_id of ~600 or higher are being displayed correctly in AJAX Attribute Manager.

 

I've tried v2.8.2 and v.2.8.5 of the contribution with the same problem. I am using osCommerce MS2 (not RC1 or RC2 or anything, this is the one from like July '03).

 

I'd really like to roll this mod out to the live site for the client to use, but I need to figure out this problem first. Any ideas?

Link to comment
Share on other sites

I install the contribution but when I go to edit a product apears this message:

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/yadis/public_html/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/yadis/public_html/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/yadis/public_html/admin/includes/functions/sessions.php on line 123

 

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/yadis/public_html/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/yadis/public_html/admin/includes/functions/sessions.php on line 123

 

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /home/yadis/public_html/admin/includes/functions/sessions.php on line 123

Session not registered - You cant access this page directly

 

 

Can somebody help me with this error?

I have install this version:

AJAX Attribute Manager 2.8.5 beta

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...