Jump to content
Nimmit

AJAX Attribute Manager support

Recommended Posts

I run this on 2 'basic install' OSC's works great for me, but i installed it on a 3rd OSC cart which has a template installed to make it look not like the basic OSC, and i followed the instructions to a T, but it gives me a list of errors then when I login to admin....i got scared and quickly put back the backupfile before i copyed the error lol

 

Will this work on one that has a custom template installed?

 

BUMP - anyone had success with this? Even with the added text in the files to edit since it was a template, i still placed them on the correct line they're supposed ot be on (not just the line number the instructions say)

Edited by shellyky

Share this post


Link to post
Share on other sites

Hi Everyone.

 

Has any body solved the problem that i seem to be getting? I can add an attribute, then a + Price and it works fine for the first attribute.

I can then add another attribute, but as soon as i try and click to add another + Price i get this error:

 

Line: 18

Char: 2

Error: Object Required

Code: 0

URL: blah blah blah categories.php?

Share this post


Link to post
Share on other sites
Hi Everyone.

 

Has any body solved the problem that i seem to be getting? I can add an attribute, then a + Price and it works fine for the first attribute.

I can then add another attribute, but as soon as i try and click to add another + Price i get this error:

 

Line: 18

Char: 2

Error: Object Required

Code: 0

URL: blah blah blah categories.php?

I am using this contribution on a modified copy of Oscommerce that uses STS TEmplate and overall it works fine other then the bugs that seem to have been reported by everyone. For example I can not add pricing to any of the attributes thru the system and if I try and save a template the sort order module seems to be interfering iget an error of 1054 - Unknown column 'products_options_sort_order' in 'field list'

 

insert into am_attributes_to_templates (template_id, options_id, option_values_id, products_options_sort_order) values ('1', '10', '9', '')

 

[TEP STOP]

 

So as far as I can tell the template is not going to be a problem but their seem to be several other bugs that need to be adressed. I would be willing to pay the developer to fix them if he was willing. I think this contribution is worht doign that. I have all the other attribute managers installed and nothing is even close to being as easy to use as this thing. Also the template thing if working would be extremely handy. So if anyoen is willing to fix it PM me and give me a price.

Share this post


Link to post
Share on other sites

LOL, we should all get a pool going to give to the first person to fix the adding price adjustments to attributes. Whos with me? :lol:

Share this post


Link to post
Share on other sites

I´m with you!

Too much time without a silution.

Just let me know.

it cant take so long.

Share this post


Link to post
Share on other sites
I´m with you!

Too much time without a silution.

Just let me know.

it cant take so long.

I am on board also I figured out the problem with the templates an attribute sort if anyone is having that issue. I just checked and the latest version has an updated install that has a sql query that is executed. I ran it and it fixed my template issue but the issue with adding an additional price for an attribute is still there. Here is the sql query if anyone needs it

 

ALTER TABLE am_attributes_to_templates ADD COLUMN products_options_sort_order INT UNSIGNED NOT NULL DEFAULT '0';

 

and I had to run this one also for mine to work at all because I also have the attributes copier modle installed

 

ALTER TABLE products_options ADD COLUMN products_options_sort_order INT UNSIGNED NOT NULL DEFAULT '0';

 

Well going digging to see if I can find anything on the price issue. If that were fixed and it all works when you make a template this contribution would solve all my problems when it comes to an attribute manager. I cant praise the contribution enough. SO if you guys want to put a money pool together to pay someone to get this fixed let me know I am on board. Preferably it would be Nimit and we give him the money since he did the work on this thing originally and this is a really awesome attribute manager. Did I mention that earlier :P

Share this post


Link to post
Share on other sites
I would say the fact it doesn't save the templates is crippling. The entire point of plugins are to increase functionality. Yes, it still makes the backend LOOK nicer, but with big attribute sets you have to manually enter a considerable amount of data (thus defeating the object).

 

Until this is fixed, it's time to try the Attribute Copier and Sorter!

 

Are you guys able to enter the price at all? I am not so worried about it being in the template. I cant get it to take a price add on an attribute period. I would be happy with just that working.

Share this post


Link to post
Share on other sites
Are you guys able to enter the price at all? I am not so worried about it being in the template. I cant get it to take a price add on an attribute period. I would be happy with just that working.

 

I have the same problem as you. I have decided to give up on this contribution for now and instead am using the Attribute Manager contribution. This works well (definitely a lot quicker than stock OSC attribute setting) and was easy to install.

Share this post


Link to post
Share on other sites

I just wanted to share some pretty simple info for those who have problems with adding new Attributes:

:-"

I added:

 

 

if(empty($price)){$price=0;}
if(empty($sortOrder)){$sortOrder=0;}

 

in attributeManagerInstant.class.php after:

 

 

		
$this->getAndPrepare('option_id', $get, $optionId);
$this->getAndPrepare('option_value_id', $get, $optionValueId);
$this->getAndPrepare('price', $get, $price);
$this->getAndPrepare('prefix', $get, $prefix);
$this->getAndPrepare('sortOrder', $get, $sortOrder);

 

:huh:

 

btw. I wonder what exactly is the difference between:

attributeManagerInstant.class.php and attributeManagerAtomic.class.php ?

I haven't figured out this yet...:/

 

and is there any progress with works on Qty Pro add on? would be really useful to have it in one place...

I wish that the complete version of AM was released already... :rolleyes:

Share this post


Link to post
Share on other sites
I just wanted to share some pretty simple info for those who have problems with adding new Attributes:

:-"

I added:

 

 

if(empty($price)){$price=0;}
if(empty($sortOrder)){$sortOrder=0;}

 

in attributeManagerInstant.class.php after:

		
$this->getAndPrepare('option_id', $get, $optionId);
$this->getAndPrepare('option_value_id', $get, $optionValueId);
$this->getAndPrepare('price', $get, $price);
$this->getAndPrepare('prefix', $get, $prefix);
$this->getAndPrepare('sortOrder', $get, $sortOrder);

 

:huh:

 

btw. I wonder what exactly is the difference between:

attributeManagerInstant.class.php and attributeManagerAtomic.class.php ?

I haven't figured out this yet...:/

 

and is there any progress with works on Qty Pro add on? would be really useful to have it in one place...

I wish that the complete version of AM was released already... :rolleyes:

 

 

What exactly does this code fix?

Share this post


Link to post
Share on other sites
What exactly does this code fix?

:)

While trying to add a new attribute I was getting this error:

 

1366 - Incorrect decimal value: '' for column 'options_values_price' at row 1

 

insert into products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order) values ('10', '1', '12', '', '', '')

 

btw. I also added '+' for Prefix, '0' for price and '0' for sortorder

.. in order to have default values written inside (just find and replace appropriate place in attributeManager/attributeManager.php):

 

 

			<td valign="top">
			Prefix: <?php 
			echo drawDropDownPrefix('id="prefix_0"', '+')?>
		</td>
		<td valign="top">
			Price: <?php 
			echo tep_draw_input_field('newPrice','0','size="4" id="newPrice"'); ?>
		</td>
		<?php
		if(AM_USE_SORT_ORDER) {
		?>
		<td valign="top">
			Sort: <?php 
			echo tep_draw_input_field('newSort','0','size="4" id="newSort"'); ?>
		</td>
		<?php
		} else {
		?>
		<td valign="top">
			<?php 
			echo tep_draw_hidden_field('newSort','0','size="4" id="newSort"'); ?>
		</td>

 

ahh..

I like the template system! :rolleyes: but it needs a small fix for 'am_attributes_to_templates' table. there was no 'products_options_sort_order' column, as when I tried to save the template I was getting some 1054 error (I hope that's the one) saying the column was missing or so... (to add it I simply used phpMyAdmin, and copied the structure to make it the same as other columns.)

 

you could also run a query:

 

DROP TABLE IF EXISTS `am_attributes_to_templates`;
CREATE TABLE IF NOT EXISTS `am_attributes_to_templates` (
 `template_id` int(5) unsigned NOT NULL,
 `options_id` int(5) unsigned NOT NULL,
 `option_values_id` int(5) unsigned NOT NULL,
 `products_options_sort_order` int(5) unsigned NOT NULL,
 KEY `template_id` (`template_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin2;

Share this post


Link to post
Share on other sites

Hello,

 

I tried installing this contribution but encountered some problems so I decided to uninstall it.

 

Besides I've found that duplicating the product then changing the main info and adjusting the attributes (basically using a product as an attribute template) was good enough for me.

 

The problem is that before deciding to uninstall it I went and tried to edit a product's page in the admin panel and I do believe that triggered a modification in the DBs. I now get the following error when I try to add an attribute to a product:

 

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

insert into products_attributes values ('', '68', '9', '107', '', '+', '')

[TEP STOP]

 

And I can also see 2 new tables:

 

am_attributes_to_templates

am_templates

 

So I deleted the attributeManager folder and restored my categories.php to what it was before trying to install this mod.

 

How do I undo the changes to the DBs so as to completely uninstall this contrib and so that I can add attributes again ?

 

I figure I can safely delete the 2 new tables but it seems (judging by the error message) the products_attributes table has been modified and that's what the main problem is. How do I undo those changes ?

 

I'm using phpMyAdmin.

 

Thank you very much for the help.

Share this post


Link to post
Share on other sites

UPDATE:

 

I seem to have properly repaired all my problems by deleting am_attributes_to_templates and am_templates and by removing the extra field in products_attributes: products_options_sort_order.

 

I stopped getting the error while adding product attributes anyway.

 

Thought it might help someone else.

Share this post


Link to post
Share on other sites

ahh..I finally decided to give up with this contribution until it's bugs free...

I have Registered Globals off contribution installed, and it's causing a problem, which I don't know how to repair.

 

After I transfered my files from Windows to Unix-based Server I got this error:

 

...

Warning: array_key_exists(): The first argument should be either a string or an integer in /home/xxxx/xxxxx/html/catalog/admin/includes/functions/sessions.php on line 99

...

(and on line 138)

...

Session not registered - You cant access this page directly

 

 

I tried to fix the function (in admin/includes/functions/sessions.php):

 

function tep_session_is_registered($variable) {

// >>> BEGIN REGISTER_GLOBALS

// return session_is_registered($variable);

return (isset($_SESSION) && array_key_exists($variable,$_SESSION));

// <<< END REGISTER_GLOBALS

}

 

with replacing:

return (isset($_SESSION) && array_key_exists($variable,$_SESSION));

with

return (isset($_SESSION[$variable]));

 

and also:

if (array_key_exists($var_name,$GLOBALS)) {

to

if (isset($GLOBALS[$var_name])) {

 

which should do the trick...

However - it does not :( as I'm left with:

 

Session not registered - You cant access this page directly

 

and the contribution does not load :(

 

It's a problem of array_key_exists function and it's probably PHP version fault (I found some information on the web, that it depends on Zend something version), so I guess I can't do much about it... However some argue it's not: http://bugs.php.net/bug.php?id=34419&edit=1.

 

So for now, I changed to attributes copier and sorter. Maybe it does not look as good as AJAX AM, and is not that flexible, but does pretty much the same... :)

Share this post


Link to post
Share on other sites

Does anyone have a solution for this problem? THis error appears after I installed the contrib:

 

1054 - Unknown column 'products_options_sort_order' in 'order clause'

select * from products_options where language_id='1' order by products_options_sort_order

 

Please help me sort this out, thanks.

Share this post


Link to post
Share on other sites

NVM - Got it to work! Here is the solution for anyone else with this problem:

 

In file attributeManagerConfig.class.php just find line

CODE

$this->add('AM_USE_SORT_ORDER'

- that is around line 59

 

In 2.5 it reads as

CODE

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

,

and in 2.4 by default it is set to false, so just change it in 2.5 to

CODE

$this->add('AM_USE_SORT_ORDER' , false);

 

and there won't be any errors regarding Unknown column 'products_options_sort_order' in 'order clause'

Share this post


Link to post
Share on other sites

This is a known problem with the contribution, if you read back a few pages it talks about it, the code you put in turned the sort order to false to its not using sort order.

Share this post


Link to post
Share on other sites

I personally have not gotten the sort order to work at all. I am more concerned with the +/- option working and saving them into the templates that no one has been able to fix. I really would use this contribution alot if it worked correctly because it is such a great idea. Has anyone had any luck?

Share this post


Link to post
Share on other sites

the template part doesn't save pricing and sort order isn't respected when you load it for other products...

 

this needs to be resolved, until then you're pretty much stuck with the same workload as with the regular attributes manager... :(

Share this post


Link to post
Share on other sites

first i must say what a great Contribution will save time putting in inventory

 

I have now added add-weight-to-product-attributes v0.2 and i am trying to add weight attribute to AJAX Attribute Manager.

I have tried follow instructions in install

 

- Instructions to add Extra Field

There is loads of contribution available for the attribute functionality. Each add different columns to the database and have different way of managing their update. If you want to add extra field to the Ajax Attribute Manager, to handle database values contained in the product_attributes tables, it is quiet easy to do. File to be changed are as follow:

attributeManager.php for the display of the new field and the insert and update action trigger (around line 196 & 271)

attributeManager.class.php (around line 457)

attributeManagerAtomic.class.php (around line 70, 150, 170)

attributeManagerInstant.class.php (around line 70, 133, 173)

attributeManagerUpdateAtomic.inc.php (around line 30)

attributeManager.js (around line 85, 106, 110)

Search for the "price" string and simply mimic the mechanism used for this field, you can also check the way sort order was added

 

 

when i search for price string I find a lot more that stated above on some nowhere near line quoted Is there and new updated instructions to add extra fields

when i have added all details i get an error as below

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /attributeManager/classes/attributeManager.class.php on line 493

Share this post


Link to post
Share on other sites

I've been having trouble trying to add a new attribute myself. Has anyone else added file upload for an image per attribute to the attribute manager?

 

I couldn't even find where to make the change in attributeManager.class.php (around line 457) - there is no line 457

 

And where are the insert and update action triggers in attributeManager.php

 

Does anyone have any more documentation on adding a new field?


Joseph McMurry
Web Developer
PHP/MySQL

http://www.mcmwebsite.com
 

Share this post


Link to post
Share on other sites

Hello

 

For a few days, it has been impossible for me to indicate the amount of the atributs. The zone remains hopelessly empty.

 

I have just seen me that there was a change of version of PHP. The old one was the 4.4.2 and the news is the 4.4.7

 

The first time that I installed this contribution, I encountered the problem and I corrected it by modifying the file Javascript/attributeManager.js :

 

function amUpdate(optionId, optionValueId) {

amSendRequest('amAction=update&option_id='+optionId+'&option_value_id='+optionValueId+'&price='+getDropDownValue('price_'+optionValueId)+'&prefix='+getDropDownValue('prefix_'+optionValueId)+'&sortOrder=0','',false);

getElement('price_'+optionValueId).blur();

getElement('sortOrder_'+optionValueId).blur();

return false;

}

 

I do not understand anything any more.

 

Thank you for your assistance

Share this post


Link to post
Share on other sites

Hi, first of all, this is one of the best contribs out there. I can't even describe how much time does this save me (about 3000 items and 80% of them have 1 or more option). Absolutely loving it. I do have a question - I am having a problem saving templates - something about

 

1054 - Unknown column 'products_options_sort_order' in 'field list' when trying to save. Can you give me an idea as to where to edit this?

 

Thanks in advance

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

×