Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

AJAX Attribute Manager support


Guest

Recommended Posts

Sorry that I left the sort option on ON....

 

The sort option now works. Although that there are still problems in this module. I'm working on an update....

 

version 2.5

sort option does not work for me now when i activate it i get this failure:

1054 - Unknown column 'products_options_sort_order' in 'order clause'
select * from products_options where language_id='1' order by products_options_sort_order
[TEP STOP]

 

products_options_sortorder table is also here...

sortorder.jpg

 

***********************

contributions already inside

ultrapics

gift voucher

Link to comment
Share on other sites

ok, i gave it a secound try installed everything again but -same failure -_-

so i think it is about the ultrapics contribution because this contribution also changes something in admin/categories.php

 

anyone installed ultrapics and gets the ajax sort running?

 

i installed v2.5beta this way:

run through install.htm -> categories.php

checked:

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

Link to comment
Share on other sites

huh, good to know i am not alone ;-)

 

can anyone make a version what is compatible with ultrapix please?

ultrapix is one of the most installed contributions these days...

 

i deaktivated the sort option in the meantime

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

 

about the script itself:

it is real a good one, well designed and saves a lot of time.

the save settings/template for the attributes is a good idea.

+ - prices are not working if you use save template in this version

so you have to go on by hand.

 

i also found out you can make a sortorder if you give in the last item at

first it is sorted upside down.

 

anyone knows where i can change a sortorder by hand when i go into myphpadmin?

Link to comment
Share on other sites

Heya!

 

I see that the QT Pro is on the horizon. In the mean time, one can add a quick 'Stock' button by editing attributeManager/attributeManager.php around line 118.

 

From:

		if(false !== AM_USE_TEMPLATES) {
		?>

			<?php echo tep_draw_pull_down_menu('template_drop',$attributeManager->buildAllTemplatesDropDown(),(0 == $selectedTemplate) ? '0' : $selectedTemplate,'id="template_drop" style="margin-bottom:3px"');	?>

			<input type="image" src="attributeManager/images/icon_load.png" onclick="return customTemplatePrompt('loadTemplate');" border="0" title="Loads the selected template" />

			<input type="image" src="attributeManager/images/icon_save.png" onclick="return customPrompt('saveTemplate');" border="0" title="Saves the current attributes as a new template" />

			<input type="image" src="attributeManager/images/icon_rename.png" onclick="return customTemplatePrompt('renameTemplate');" border="0" title="Renames the selected template" />

			<input type="image" src="attributeManager/images/icon_delete.png" onclick="return customTemplatePrompt('deleteTemplate');" border="0" title="Deletes the selected template" />


		<?php
	}
	?>
	</div>
	</td>
</tr>
</table>

 

to: (the only change is just past that php statement)

		if(false !== AM_USE_TEMPLATES) {
		?>

			<?php echo tep_draw_pull_down_menu('template_drop',$attributeManager->buildAllTemplatesDropDown(),(0 == $selectedTemplate) ? '0' : $selectedTemplate,'id="template_drop" style="margin-bottom:3px"');	?>

			<input type="image" src="attributeManager/images/icon_load.png" onclick="return customTemplatePrompt('loadTemplate');" border="0" title="Loads the selected template" />

			<input type="image" src="attributeManager/images/icon_save.png" onclick="return customPrompt('saveTemplate');" border="0" title="Saves the current attributes as a new template" />

			<input type="image" src="attributeManager/images/icon_rename.png" onclick="return customTemplatePrompt('renameTemplate');" border="0" title="Renames the selected template" />

			<input type="image" src="attributeManager/images/icon_delete.png" onclick="return customTemplatePrompt('deleteTemplate');" border="0" title="Deletes the selected template" />


		<?php
	}
	?>
	<!-- whodah mod -- include button to link to QT Pro stock.php -->
	<a href="stock.php?<?php echo "cPath=&product_id=$products_id"; ?>"><img border="0" src="includes/languages/english/images/buttons/button_stock.gif"></a>
	</div>
	</td>
</tr>
</table>

 

Does anyone know how to access the cPath from within this file? These do not work:

$cPath
$_GET['cPath']
$VARS['cPath']

 

Thanks!

-Who Dah?

Link to comment
Share on other sites

  • 2 weeks later...

After installing this contribution, I tried to add some

more attributes, but it kept giving me an error.

 

 

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

 

insert into products_attributes values ('', '61', '9', '226', '', '+')

 

please help me.

Link to comment
Share on other sites

Hi

I have installed the "Product attribute sort order support" version, and found a way to get the fields to update when changed.

 

open attributeManager/javascript/attributeManager

 

find:

function amUpdate(optionId, optionValueId) {

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

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

 

after add:

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

 

Save and upload.

 

Hope this helps.

 

I was just working with v2.5 and had the cursor stuck problem where when you mess with the order fields things freeze up in IE (firefox works fine). I added this bit of code suggested by melhaa. seems to do the job :thumbsup:

Link to comment
Share on other sites

Just a note: This contribution is not compatible with the register_globals = off fix. Also, there seems to be a bug in 2.5 that deleting individual attribute causes the form to submit and the product to save, but clears all of the data. The onclick events look like this:

 

onclick="return customPrompt('amRemoveOptionValueFromProduct','option_id:2|option_value_id:2|option_value_name:2 1/2\" )=""

 

I'm going through the code now trying to track down a fix. This code has a tremendous amount of unnecessary redundancy by wrapping base osCommerce functions with classes. It's code for the sake of code. We could strip out all of that redundancy and reduce this contribution's size by at least half, making it far easier to maintain.

 

What's the concensus from the code maintainers?

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Link to comment
Share on other sites

Here's the fix for the above problem. In attributeManager.php, change this line:

 

<input type="image" border="0" onClick="return customPrompt('amRemoveOptionValueFromProduct','<?php echo addslashes("option_id:$optionId|option_value_id:$optionValueId|option_value_name:{$optionValueInfo['name']}")?>');" src="attributeManager/images/icon_delete.png" title="<?php echo "Removes {$optionValueInfo['name']} from {$optionInfo['name']}"?>, from this product" />

 

to this:

<input type="image" border="0" onClick="return customPrompt('amRemoveOptionValueFromProduct','<?php echo addslashes("option_id:$optionId|option_value_id:$optionValueId|option_value_name:{" . htmlspecialchars($optionValueInfo['name']) . "}")?>');" src="attributeManager/images/icon_delete.png" title="<?php echo "Removes {$optionValueInfo['name']} from {$optionInfo['name']}"?>, from this product" />

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Link to comment
Share on other sites

Thanks for a really useful looking contribution. I also have the problem of price and prefix not being saved (same problem Bill79 reported in the quote below). Does anyone know a fix for this?

 

 

I suspect it may be something to do with register_globals setting...

I installed this contribution eary this week, did some brief tests and it seemed to work and remember price and prefix that I entered and also in the templates. Yesterday my host upgraded PHP and set register_globals off. I have over ridden that by including a php.ini file in my www root directory setting register_globals = On. Whilst that fixed some other problems with my OSC admin panel, I still have the problem of price and prefix not being saved by this contribution.

 

I don't know javascript at all so am struggling to figure this out. I would really appreciate some help !

 

Kind regards

Peter

 

First off I want to compliment you on what appears to be a fabulous looking contribution :)

 

That being said, I feel like a bit of a moron as I cannot get it to work.

 

I have it all isntalled just fine, it displays fine with no errors, and at first glance appears to function.

 

However I have set up an attribute with three different options, I add their prices:

+ 0.00

+ 25.00

+ 75.00

+475.00

 

To the base price, I save my object and it enters the attributes fine but it does not save the price changes. Do I need to save something or hit a button after entering this data? I had saved the template, but even when I recall that the fact is it recalls the attributes with no value attached to them.

 

Thanks for your help, I do appreciate it.

 

Regards,

Billy

Link to comment
Share on other sites

This is such an awesome contribution, the template part makes it so easy to add alot of similar products!

 

Having problems though... Seems to be the same as above.

 

I cant add the +/- from the add product page. I really hope someone can rescue us!

Link to comment
Share on other sites

Pretty much got this working with help from post 330 so that the sort order works also.

Only one small problem is that when templates are enabled I get the following error when saving...

 

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 ('6', '12', '130', '0')

 

[TEP STOP]

 

I don't really understand why I am getting this error as I have 'products_options_sort_order' columns in mysql under "products_attributes" and "products_options" tables.

 

Any help would be great.

 

Thanks.

Link to comment
Share on other sites

Just installed AJAX-AttributeManager-V2.5-beta_1 and I get the following errors on the bottom of the page

 

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

 

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

 

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

 

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

1060 - Duplicate column name 'products_options_sort_order'

 

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

 

I do have Register Globals v1.5 patch files installed and it looks like that is where is error is occurring but I don't have a clue.

 

BTW this is the code around where the error is located.

 

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

}

Link to comment
Share on other sites

Pretty much got this working with help from post 330 so that the sort order works also.

Only one small problem is that when templates are enabled I get the following error when saving...

 

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 ('6', '12', '130', '0')

 

[TEP STOP]

 

I don't really understand why I am getting this error as I have 'products_options_sort_order' columns in mysql under "products_attributes" and "products_options" tables.

 

Any help would be great.

 

Thanks.

 

Got this working in the end.

Was looking at the wrong table doh

 

;-)

Link to comment
Share on other sites

Thanks for a really useful looking contribution. I also have the problem of price and prefix not being saved (same problem Bill79 reported in the quote below). Does anyone know a fix for this?

I suspect it may be something to do with register_globals setting...

I installed this contribution eary this week, did some brief tests and it seemed to work and remember price and prefix that I entered and also in the templates. Yesterday my host upgraded PHP and set register_globals off. I have over ridden that by including a php.ini file in my www root directory setting register_globals = On. Whilst that fixed some other problems with my OSC admin panel, I still have the problem of price and prefix not being saved by this contribution.

 

I don't know javascript at all so am struggling to figure this out. I would really appreciate some help !

 

Kind regards

Peter

 

Damn, I am having the same problem.

Save the template but does not save the +/- prices.

Wicked contrib and if this was working in the latest contribution it would the best.

 

Hope someone can help.

Cheers

Link to comment
Share on other sites

I'm hoping someone can help me with this since i'm not sure what is going on. When viewing a product to edit I get this error; FATAL ERROR: register_globals is disabled in php.ini, please enable it!

 

I've checked both the php.ini under the OSC directory and the Admin directory and both are set to On. So i'm not sure where this is coming from. I have the Ajax 2.5 installed along with FCKeditor. The Fckeditor shows up fine but i get that error line right above it.

 

Thanks for any help you can give.

Link to comment
Share on other sites

Damn, I am having the same problem.

Save the template but does not save the +/- prices.

Wicked contrib and if this was working in the latest contribution it would the best.

 

Hope someone can help.

Cheers

 

I notice that AJAX Attribute Manager v2.5.2 has been updated with a typo as mention.

However is the typo in the code theirfor it will fix the templates not saving ?

 

Thanks.

Link to comment
Share on other sites

Update still doesn't fix the template saving bug.

 

Might use Attribute Sorter and Copier instead, although this solution is more graceful. Whoever fixes it will be a life saver to many people :¬)

Edited by b0se
Link to comment
Share on other sites

Damn, I am having the same problem.

Save the template but does not save the +/- prices.

Wicked contrib and if this was working in the latest contribution it would the best.

 

Hope someone can help.

Cheers

 

Hello I´m also having the same problem on saving prices and prefixes.

Anyone found a solution to this?

thanks!

Link to comment
Share on other sites

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? Should i just retry and copy the error(s) here?

Link to comment
Share on other sites

From what I'm reading over the last couple of pages it seems this contribution is not in a fit state for installation on a production system. Can anyone confirm this?

 

Is it worth installing to try and fix the problems? Does anyone fancy collaborating on this?

Link to comment
Share on other sites

From what I'm reading over the last couple of pages it seems this contribution is not in a fit state for installation on a production system. Can anyone confirm this?

 

Is it worth installing to try and fix the problems? Does anyone fancy collaborating on this?

 

I would say it is still a great contribution. The ONLY thing that is not working is the saving of a template which does not save the prices.

Not so much a problem for some but it would be very handy for me as I would like to use a price config for options which would be the same for about 30 products. Very hard to keep consistant.

 

I would love to help and collaborate but I am not guru master on this. The only thing I can say is that you get no error when saving templates and they get greated what ever the name. Looks like the tables are correct in the database. But the prices are just not getting passed over in the code. That is all I can say from a logical point of view.

 

Who ever fixes it will be master guru Jedi, not that I am a Star Wars freak. No offence Jedi nutters.

 

muhahaha

Link to comment
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!

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