Jump to content



Latest News: (loading..)

* * * * * 13 votes

AJAX Attribute Manager support


  • Please log in to reply
1250 replies to this topic

#1221   OSC-Sevilla

OSC-Sevilla
  • Members
  • 391 posts
  • Real Name:George
  • Gender:Male
  • Location:Sevilla, Spain

Posted 22 May 2012 - 11:56 AM

View Postgfasal, on 16 May 2012 - 07:54 AM, said:

When adding attributes: lets say we have three options, each with three options.

How can we force the option box to read "Select Option" instead of having the first option in that tree displayed as default????

http://forums.oscommerce.com/topic/357940-qtpro-multiple-dropdowns-please-select-option/
OSC 2.3.1
INSTALLED:Document Manager / Monthly Sales and Tax Returns / Batch Print Invoices / Ultimate HTML EMAILs / AJAX Attribute Manager / OSC PDF Catalog / Move Bookmarks / Sort Order / Easy Populate / Sales Reports / Low Stock Report / Admin: Model # on Category / Product Administration Screen / Mini images in admin / SLiCK reCaptcha / Google + / Beautiful Breadcrumbs / 2.3.1 - Banner Language Mod / ADD New Page / EASY MAP (google) v.3.0 / Who's Online Enhancement for 2.3.1 / Admin Notes / scrambled order number / remove_unused_images / Quantity Select / Unit Weight / Product Specifions (filter results) / AJAX Product Attributes/ Attribute Codes/ Date & Order No. to Invoice/ O.P.I. 2.0 / Attribute Images / Manual Order Editor / Attributes Clone / Order Editor / Create Order / Company VAT No. / Add customer/  CKEditor 2.3.1 / Page Manager / Default images via admin / Percentage Shipping Price / QTPro / Scroll to Top / PDF Invoice / Featured Products / Product Listing Enhancements / AutoBackups /  Ultimate SEO URLS 5 Pro / Kiss Tags/ ..Custom Admin Mods /

#1222   mpalasis

mpalasis
  • Members
  • 24 posts
  • Real Name:Makis Palasis

Posted 26 May 2012 - 08:46 AM

to fix utf-8 characters in attributes this worked for me:

in attributeManager.js change:

returnArray.push(allValues[i].id+':'+escape((getElement(allValues[i].id).value)));
to:
returnArray.push(allValues[i].id+':'+encodeURIComponent((getElement(allValues[i].id).value)));

I only use one language on the store and it has a CHARSET value set to "UTF-8" in the config, dunno if there would be more changesd needed for multiple languages that do not use UTF-8 as their charset (... in which case why are you not using UTF-8 in the first place?).

cheers

#1223   mpalasis

mpalasis
  • Members
  • 24 posts
  • Real Name:Makis Palasis

Posted 27 May 2012 - 04:59 PM

anyone happen to know why this doesn't allow ':' in the attribute names/ attribute values?
for instance if you try to add an Option named '1234:5678' you get an Option named '1234', the rest of it is dropped.same for values.

I've been trying to identify in which part of the code the ':' gets dropped but it's all one big jumble, no coherence :( :(

there always seems to be an extra '4:' in the submitted value ... /attributeManager/attributeManager.php?amAction=addOption&options=4:123%20%3A%204566&optionSort=1 <--- I think this refers to the id="4" in the popup dialogue, but still why does that get put in there? and how can I stop it from interfeering with the intended value.

cheers

Edited by mpalasis, 27 May 2012 - 05:01 PM.


#1224   mpalasis

mpalasis
  • Members
  • 24 posts
  • Real Name:Makis Palasis

Posted 29 May 2012 - 11:13 AM

Found it!...

Fix to allow colons ( ' : ' )  in option names and option values:

edit attributeManager\classes\attributeManager.class.php

look for ( this one is inside function addOption($get) { ...} )
list($langId,$name) = explode(':',$option);
change it to:
list($langId,$name) = explode(':',$option, 2);

and

look for ( this one is inside function addOptionValue($get) { ...} )
list($langId,$name) = explode(':',$optionValue);
change it to:
list($langId,$name) = explode(':',$optionValue, 2);

Done!

if you want to be able to add ':' in template names , look for explode(':',$templateName); and change it to explode(':',$templateName,2);

I've given this a quick test and looks ok, lemme know if I missed anything ;)

enjoy

#1225   mpalasis

mpalasis
  • Members
  • 24 posts
  • Real Name:Makis Palasis

Posted 31 May 2012 - 12:24 PM

Problem:
Before installing attribute manager:
In categories.php you could hit enter to submit the form; when the cursor was in a regular text field (<input type="text"...>).

After installing attribute manager:
Hitting Enter no longer submits the form when the cursor is in regular text fields!

Anyone happen to know what the culprit is and how to fix this?

ta

#1226   Chrison

Chrison
  • Members
  • 40 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Nanaimo, BC, Canada

Posted 11 June 2012 - 05:25 AM

Hi, all!

I installed AJAX Attribute Manager awhile ago, and up until now it has worked flawlessly.  (WONDERFUL add-in, btw!)  But, suddenly it's stopped working.  I have deleted and re-installed the admin/attributesmanager directory, triple-checked the coding in admin/categories.php and admin/includes/template-top.php and I just can't seem to figure out why it's not working.

Attached is my current admin/categories.php and admin/includes/template-top files.  Can anyone spot where I've gone wrong?  It's probably something really dumb and I'm missing it because I've been staring at this code for hours.

Thanks for any help or tips provided!

Regards,

Chris

Attached Files


Edited by Chrison, 11 June 2012 - 05:28 AM.


#1227   Chrison

Chrison
  • Members
  • 40 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Nanaimo, BC, Canada

Posted 12 June 2012 - 07:05 PM

View PostChrison, on 11 June 2012 - 05:25 AM, said:

Hi, all!

I installed AJAX Attribute Manager awhile ago, and up until now it has worked flawlessly.  (WONDERFUL add-in, btw!)  But, suddenly it's stopped working....

UPDATE:

I have found the section of code that's breaking AJAX Attribute Manager, but for the life of me I can't figure out why?!?!  :unsure:   Here's the code in catalog/admin/includes/template_top that's causing a problem:

<!-- AJAX Attribute Manager  -->
<?php
	if ((basename($_SERVER["SCRIPT_NAME"]) == FILENAME_CATEGORIES)) {
		require('attributeManager/includes/attributeManagerHeader.inc.php');
	}
?>
<!-- AJAX Attribute Manager  end -->

</head>

<?php
  // Discount Code 3.1.1 - start

  if (basename($PHP_SELF) == FILENAME_DISCOUNT_CODES && isset($action) && $action == 'new') {
	echo '<body onload="onload();">';
  } else {
	echo '<body onload="goonload();">';
  }
  // Discount Code 3.1.1 - end
?>


If I take out the if/else statement for Discount Code and replace it with <body onload="goonload();"> then AJAX Attribute Manager works fine.  (I haven't checked to see if that breaks Discount Code, though.)  But, if I leave that code in for Discount Code then AJAX Attribute Manager does not work even though the code is still outputting <body onload="goonload();"> (I checked the page source)!

To my non-programmer eyes the output that's going to the browser is exactly the same so shouldn't AJAX Attribute Manager work with the Discount Code if/else statement in there?!?!?

Could someone please give me a hand with this as it's starting to drive me nuts!  :(

Thanks for any help/suggestions provided!

Regards,

Chris

Edited by Chrison, 12 June 2012 - 07:09 PM.


#1228   RJMA

RJMA
  • Members
  • 5 posts
  • Real Name:Ricardo Amaro

Posted 19 June 2012 - 03:55 PM

Hello, I'm using the Minsparx Admin in my store. Can I use the AJAX Manager in it too? Or this may make errors or "blow up" my store?

#1229   ce7

ce7
  • Members
  • 202 posts
  • Real Name:lyn

Posted 10 July 2012 - 02:26 PM

Hi,

I had installed this addon, checked three times with my installation steps, and it seems I had follow the steps in the right way.
Somehow I did not have the AJAX Attribute comes up after click on Admin / Catalog / Categories & Products

And when I test to save a product, I got error message as below:


1054 - Unknown column 'products_cost_price' in 'field list'
insert into products (products_quantity, products_model, products_price, products_cost_price, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_date_added) values ('0', '', '', '', null, '0', '1', '0', '0', now())

according to the thread "AJAX Attribute Manager" to v2.3.1?
I have to install QTPro, I did but the errors still the same. (SQL error and AJAX not appear)

Can anyone please help? Im newbie just started edit oscommerce a while ago, don't know much about PHP and SQL.
It will be very much appreciated if could point me out which file and what part of code I should look into.

Lyn

#1230   ce7

ce7
  • Members
  • 202 posts
  • Real Name:lyn

Posted 11 July 2012 - 12:39 PM

there is no AJAX appear when i add new catalog or new product, but when I modify the products in the sample list, the AJAX show up, however it doesn't works at all. When I save it and open the edit product page, it goes back to the original setting.

Can anyone please help this issue?

thanks

Lyn

#1231   ErikMM

ErikMM
  • Members
  • 314 posts
  • Real Name:Erik M
  • Gender:Male

Posted 15 August 2012 - 05:51 AM

1. any idea how to allow OPTION titles to be colored?

I tried adding css plus a span in the option box, but its does not work

.pink {color:#FF00AA;}
<span class="pink">option title</span>

all options turn pink, then the title gets kicked out and all that's left is <span class=


2. last upload was 2.8.7 Jan 27 2010... alot has changed, any suggestions on an upgrade...hate to "fix" what isn't broke, but maybe I'm missing something

Edited by ErikMM, 15 August 2012 - 05:52 AM.


#1232   ErikMM

ErikMM
  • Members
  • 314 posts
  • Real Name:Erik M
  • Gender:Male

Posted 15 August 2012 - 06:02 AM

View Postmpalasis, on 29 May 2012 - 11:13 AM, said:

Found it!...

Fix to allow colons ( ' : ' )  in option names and option values:

edit attributeManager\classes\attributeManager.class.php

look for ( this one is inside function addOption($get) { ...} )
list($langId,$name) = explode(':',$option);
change it to:
list($langId,$name) = explode(':',$option, 2);

and

look for ( this one is inside function addOptionValue($get) { ...} )
list($langId,$name) = explode(':',$optionValue);
change it to:
list($langId,$name) = explode(':',$optionValue, 2);

Done!

if you want to be able to add ':' in template names , look for explode(':',$templateName); and change it to explode(':',$templateName,2);

I've given this a quick test and looks ok, lemme know if I missed anything ;)

enjoy
perhaps this can be used to allow quotation marks " as well? so I can manipulate colors as mentioned in my post above^?...don't know how to add this though

#1233   High Sports

High Sports
  • Members
  • 89 posts
  • Real Name:Sam
  • Location:UK

Posted 03 October 2012 - 02:44 PM

View PostCrusher79, on 18 May 2011 - 10:30 AM, said:

Hi,

well i installed the contrib and see the "Save Product before adding options" message, when i try to add an article.

But when i try to edit an already saved article, nothing happens. Atrribute manager is missing. No errors, nothing. PHP error reporting is enabled.

However, in my local xampp installation, i see the attribute bar - everything works fine. But i am getting the

Deprecated: Assigning the return value of new by reference is deprecated 

error message. Well this message doesn't apper on my product server, too.


Well i tried to fix it and changed line 55 from:
		$attributeManager =& new attributeManagerAtomic(amGetSessionVariable(AM_SESSION_VAR_NAME));
to
		$clone = attributeManagerAtomic(amGetSessionVariable(AM_SESSION_VAR_NAME));
		$attributeManager = clone $clone;

I don't know, if that is the correct way! I tried to replace "=& new" with the "clone-function". It seems to work with line 55. But line
		$attributeManager =& new attributeManagerInstant($_GET['products_id']);

isn't so simple?!? "$test = attributeManagerInstant($_GET['products_id']);" for example does not work. I am not really a coder. But i think to disable error reporting isn't even a correct way...


But at the moment my problem is, that the ajax attribute manager section is blank!

greetz Crusher

Same issue, Anyone got a fix?

#1234   deemarie

deemarie
  • Members
  • 2 posts
  • Real Name:Diane

Posted 04 October 2012 - 05:41 AM

Hello.  I have been searching and searching and cannot find this simple answer.  I have installed and reinstalled this great contribution ( currently running with ver 2.8.10)  I have various attributes per product and simply want the price to adjust accordingly with each chosen option.  It adds the correct price to the cart but does not update the product info page with each choice the customer makes.

Example

attribute one - flavor

increase flavor +.25
original recipe  +.00
decrease flavor -.25

attribute two - bottle size

3 mls +.95
10 mls +.1.37
30 mls + 4.25


any help would be appreciated.

Thanks

#1235   deemarie

deemarie
  • Members
  • 2 posts
  • Real Name:Diane

Posted 05 October 2012 - 11:55 PM

View Postdeemarie, on 04 October 2012 - 05:41 AM, said:

Hello.  I have been searching and searching and cannot find this simple answer.  I have installed and reinstalled this great contribution ( currently running with ver 2.8.10)  I have various attributes per product and simply want the price to adjust accordingly with each chosen option.  It adds the correct price to the cart but does not update the product info page with each choice the customer makes.

Example

attribute one - flavor

increase flavor +.25
original recipe  +.00
decrease flavor -.25

attribute two - bottle size

3 mls +.95
10 mls +.1.37
30 mls + 4.25


any help would be appreciated.

Thanks

OK how about this question LOL Does anyones price change on the product info page after an attribute is selected ( meaning a bug) or it is just mine.  Please let me know time is flying and I need to get this up and running   Thanks

Edited by deemarie, 05 October 2012 - 11:56 PM.


#1236   iTea

iTea
  • Members
  • 11 posts
  • Real Name:Johan Lange

Posted 25 October 2012 - 11:23 PM

Installed AAM 2.8.2. on an almost fresh osC 2.3.3. Getting lots of warnings like:

Strict Standards: Non-static method amDB::query() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 143
Strict Standards: Non-static method amDB::query() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 148
Strict Standards: Non-static method amDB::query() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 167
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168

Someone got an idea?

#1237   johnnymacsoldier

johnnymacsoldier
  • Members
  • 7 posts
  • Real Name:John McCarthy

Posted 13 November 2012 - 12:54 AM

I just installed this contribution onto my Osc 2.3 store however when I assign the net price to the attribute the attribute tax is not calculated correctly.
Tax rate is set at 23% in Locations/Taxes > Tax Rates and the base prices are shown with the correct tax added but the attribute prices are not.

Example below

Admin Side:
Product Price 388 inc vat
Attribute Price + 48.78 ex vat

Product Info Side:
Product Price: 388 inc vat
Attribute Price + 51 inc vat (at 23% vat it should read 60 inc vat)

I have spent the last 6 hours searching for any mention of a similar problem to this, but no joy :(

Any help would be greatly appreciated

Edited by johnnymacsoldier, 13 November 2012 - 12:56 AM.


#1238   johnnymacsoldier

johnnymacsoldier
  • Members
  • 7 posts
  • Real Name:John McCarthy

Posted 13 November 2012 - 09:57 PM

View Postjohnnymacsoldier, on 13 November 2012 - 12:54 AM, said:

I just installed this contribution onto my Osc 2.3 store however when I assign the net price to the attribute the attribute tax is not calculated correctly.
Tax rate is set at 23% in Locations/Taxes > Tax Rates and the base prices are shown with the correct tax added but the attribute prices are not.

Example below

Admin Side:
Product Price 388 inc vat
Attribute Price + 48.78 ex vat

Product Info Side:
Product Price: 388 inc vat
Attribute Price + 51 inc vat (at 23% vat it should read 60 inc vat)

I have spent the last 6 hours searching for any mention of a similar problem to this, but no joy :(

Any help would be greatly appreciated


Hello again

Just an update to the price gets calculated incorrectly only when I add the product to Specials

Please any help would be great

#1239   johnnymacsoldier

johnnymacsoldier
  • Members
  • 7 posts
  • Real Name:John McCarthy

Posted 16 November 2012 - 10:01 AM

Bump >>>

Hello Community you fantastic people is there anybody able to help on this at all?

Thanks a mill

#1240   thejudge99

thejudge99
  • Members
  • 116 posts
  • Real Name:Julian

Posted 12 December 2012 - 11:58 AM

View PostiTea, on 25 October 2012 - 11:23 PM, said:

Installed AAM 2.8.2. on an almost fresh osC 2.3.3. Getting lots of warnings like:

Strict Standards: Non-static method amDB::query() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 143
Strict Standards: Non-static method amDB::query() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 148
Strict Standards: Non-static method amDB::query() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 167
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168
Strict Standards: Non-static method amDB::fetchArray() should not be called statically, assuming $this from incompatible context in ......\attributeManager\classes\attributeManagerConfig.class.php on line 168

Someone got an idea?

After my service provider said they are migrating to 5.4 in january (from 5.2) i also got these errors and fixed them with the following

in admin/attributeManager/classes/amDB.class.php and    in admin/attributeManager/classes/stopDirectAccess.class.php

every function needs to have public static placed in front of it eg

function authorise($sessionVar) {
  amSessionRegister($sessionVar);
  $GLOBALS[$sessionVar] = stopDirectAccess::makeSessionId();
}

becomes

public static function authorise($sessionVar) {
  amSessionRegister($sessionVar);
  $GLOBALS[$sessionVar] = stopDirectAccess::makeSessionId();
}

and finally in admin/attributeManager/includes/attributeManagerGeneralFunctions.inc.php

change

$attributeManager =& new attributeManagerAtomic(amGetSesssionVariable(AM_SESSION_VAR_NAME));

with

$attributeManager = new attributeManagerAtomic(amGetSesssionVariable(AM_SESSION_VAR_NAME));


and change

$attributeManager =& new attributeManagerInstant($_GET['products_id']);

with

$attributeManager = new attributeManagerInstant($_GET['products_id']);

This removed all warnings for me