Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

AJAX Attribute Manager support


Guest

Recommended Posts

I don't believe V2.7 is working with osCommerce Online Merchant v2.2 Release Candidate 1, I have not used Attribute Manager before but when I have installed on a fresh copy of v2.2 rc 1 none of the drop downs have information in them and if I select anything it grays the panel and nothing happens.

 

Regards

Tim

Link to comment
Share on other sites

Can you share how you achieved this? I just need to add a weight box, no prefixes.

 

I'm still tweaking it. I think you need to have a prefix along the lines of wprefix as suggested in post #444.

 

When it's stable i'll post the files.

 

Howard

Link to comment
Share on other sites

I'm still tweaking it. I think you need to have a prefix along the lines of wprefix as suggested in post #444.

 

When it's stable i'll post the files.

 

Howard

 

Thank you! looking forward to it but I really don't need the prefix. I am using actual attribute weight and would love to get rid of that prefix box!

Link to comment
Share on other sites

I am constantly getting this error in th error.log file whenever I access the edit product page (without even editing anything, just accessing the page that show the attribute manager):

PHP Warning:  implode() [<a href='function.implode'>function.implode</a>]: Bad arguments. in /home/x16st3/public_html/admin/attributeManager/attributeManager.php on line 468

 

Line 468 is:

<input type="image" src="attributeManager/images/icon_add.png" value="Add" onclick="return root('<?php echo implode(",", $dropDownOptions); ?>');" title="Update or Insert the attribute combination with the given quantity" border="0"  /><br/>t:

 

Any idea how I can fix this or why this is happening?

Link to comment
Share on other sites

Hi

Has anyone set the attribute prices to include tax when entering the amount?

At the present time I have to calculate the attribute prices.

A solution is to remove the tax in products_info, but I need the tax to be specified in orders so that wont work.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Hello everyone!

 

I faced with next problem:

 

When I'm adding a new attribures a error massage appears:

 

Fatal error: Call to undefined function: sprint_f() in /home/motor/motozap4asti.ru/docs/catalog/admin/attributeManager/includes/attributeManagerPrompts.inc.php on line 132

 

What's this?? I not so experienced in php..

 

Please help!

Link to comment
Share on other sites

refer to previous threads...

 

change all sprint_f in that file to sprintf..that will fix the error prompt...

 

however, if you have the problem of removing the option values, then dont worry...i have that problem too...some say its browser incompatibility...but i think its more in the codes...as there are actually no codes for removing the option values...read it on the installation file...the creator mentioned 'no removing of option values'. so i guess we have to create them...

 

anyone with a fix on removing option values?

 

Hello everyone!

 

I faced with next problem:

 

When I'm adding a new attribures a error massage appears:

 

Fatal error: Call to undefined function: sprint_f() in /home/motor/motozap4asti.ru/docs/catalog/admin/attributeManager/includes/attributeManagerPrompts.inc.php on line 132

 

What's this?? I not so experienced in php..

 

Please help!

Link to comment
Share on other sites

refer to previous threads...

 

change all sprint_f in that file to sprintf..that will fix the error prompt...

 

however, if you have the problem of removing the option values, then dont worry...i have that problem too...some say its browser incompatibility...but i think its more in the codes...as there are actually no codes for removing the option values...read it on the installation file...the creator mentioned 'no removing of option values'. so i guess we have to create them...

 

anyone with a fix on removing option values?

 

Thanks a lot!!!

 

It works!! and I can remove attributes!!!!

Link to comment
Share on other sites

Thanks a lot!!!

 

It works!! and I can remove attributes!!!!

 

 

nice!!! then it must be in my codes...or because i'm using RC1...incompatibility with RC1 or PHP5 support...or both of them...care to share your server settings?

Link to comment
Share on other sites

This contrib looks really slick - as I have several hundred products, all with size and color options...

 

Does this work with ms2.2?

 

Just checking before I install... Saw some discussion about a work in progress... Just want to be certain.

 

Thanks in advance!

 

--Jeff

Link to comment
Share on other sites

refer to previous threads...

 

change all sprint_f in that file to sprintf..that will fix the error prompt...

 

however, if you have the problem of removing the option values, then dont worry...i have that problem too...some say its browser incompatibility...but i think its more in the codes...as there are actually no codes for removing the option values...read it on the installation file...the creator mentioned 'no removing of option values'. so i guess we have to create them...

 

anyone with a fix on removing option values?

 

That fix works like a champ!

 

Thanks a million!

 

--Jeff

Link to comment
Share on other sites

Can anyone tell me how to allow the + character to be added to the database record even if the value of the option is set to 0.000?

 

Right now, if the option value is set to 0.00, then the prefix is set to "" (empty).

 

I want to show the base-price of the products in the drop-down option menu and not just for the other options. Right now it looks like:

 

Option 1

Option 2 ($price)

Option 3 ($price)

 

I want it to show:

 

Option 1 ($price)

Option 2 ($price)

Option 3 ($price)

 

There are other options, such as color, that do not affect the price....so I don't want the price to be displayed everywhere. Only where I add the "+" prefix.

 

Thanks!

Link to comment
Share on other sites

Several posts earlier I said that everything is OK!

 

But now, when I added a new product such message appeared:

 

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'motor.mysql' (2) in /home/motor/motozap4asti.ru/docs/catalog/includes/functions/database.php on line 19

Unable to connect to database server!

 

So I can't use my site(((( What's happened???

 

Please suggest!

 

Thanks in advance!!!

Link to comment
Share on other sites

I just added the contirb today (latest version) and it works great, except for a couple of things.

 

Firstly, It adds two copies of an attribute. I have added a "Standard" attribute, and a "Coated" attribute, but the Coated attribute is added twice, and shows twice in the main view.

 

Secondly, When I added the coated attribute, I left the select box blank, and added the new price in the price box (ie 77 versus 70 for standard). When I go to checkout however when I have selected the coating option, the product price comes up as $-7. This is always the difference between the product price, and the price I linked with the attribute. It is thus, that I assume that if you dont selec + or -, the default is -?

 

Thanks,

Alex

Link to comment
Share on other sites

Entering gross and net prices

 

This allows entering prices with and without tax. It does basically the same as categories.php, instead of one price field there are two, one (to the left) for the gross price and one (to the right) for the net price, both automatically updated via onKeyUp event handlers.

 

Step #1 - Requirements

 

I'm using the latest version of the Attribute Manager (2.7). It should also work with earlier versions, but finding the right places for the replacements could be harder.

 

Check if the following javascript functions exist in your version of categories.php (including linked scripts):

function getTaxRate()

function doRound(x, places)

 

If not, the contrib(s) you're using have their own ideas about entering gross and net values and I can't help you. :(

If they do exist, feel free to continue. :)

 

 

Step #2 - IMPORTANT!

 

Backup the following files:

admin/categories.php

admin/attributeManager/attributeManager.php

admin/attributeManager/javascript/attributeManager.js

 

 

Step #3 - Changes to attributeManager.js

 

Replace (in function amSendRequest)

function calcGross(net, rate) {
 if (rate > 0) {
   return doRound(net * ((rate / 100) + 1), 4);
 } else {
   return net;
 }
}

function calcNet(gross, rate) {
 if (rate > 0) {
   return doRound(gross / ((rate / 100) + 1), 4);
 } else {
   return gross;
 }
}

function amUpdNet(optionValueId) {
 var taxRate = getTaxRate();
 getElement('price_'+optionValueId).value = calcNet(getDropDownValue('price_gross_'+optionValueId), taxRate);
 return true;
}

function amUpdGross(optionValueId) {
 var taxRate = getTaxRate();
 getElement('price_gross_'+optionValueId).value = calcGross(getDropDownValue('price_'+optionValueId), taxRate);
 return true;
}

function amUpdNewNet() {
 var taxRate = getTaxRate();
 getElement('newPrice').value = calcNet(getDropDownValue('newPrice_gross'), taxRate);
 return true;
}

function amUpdNewGross() {
 var taxRate = getTaxRate();
 getElement('newPrice_gross').value = calcGross(getDropDownValue('newPrice'), taxRate);
 return true;
}

function amUpdAllGross() {
 var inp = getElement('attributeManager').getElementsByTagName("input");
 for (var i = 0; i < inp.length; i++) {
   var n = inp[i].getAttribute('name');
   if (n && n.match(/^price_gross_/)) {
     amUpdGross(n.substr(12));
   }
 }
 amUpdNewGross();
}

 

Step #4 - Changes to attributeManager.php

 

Add the gross price field and the event handlers to the new attribute values at the bottom:

Replace

			<td valign="top">
			<?=AM_AJAX_PRICE?> <?php echo tep_draw_input_field('newPrice','','size="4" id="newPrice"'); ?>
		</td>

with

			<td valign="top">
			<?=AM_AJAX_PRICE?> <?php echo tep_draw_input_field('newPrice_gross','','size="7" id="newPrice_gross" onKeyUp="amUpdNewNet()"'); ?> <?php echo tep_draw_input_field('newPrice','','size="7" id="newPrice" onKeyUp="amUpdNewGross()"'); ?>
		</td>

 

Add the gross price field and the event handlers to the option value rows in the table:

Replace

<?php echo tep_draw_input_field("price_$optionValueId",$optionValueInfo['price'],' style="margin:3px 0px 3px 0px;" id="price_'.$optionValueId.'" size="7" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\');"'); ?>

with

<?php echo tep_draw_input_field("price_gross_$optionValueId",tep_round(tep_add_tax($optionValueInfo['price'],$_GET['taxRate'],true),4),' style="margin:3px 0px 3px 0px;" id="price_gross_'.$optionValueId.'" size="7" onKeyUp="amUpdNet(\''.$optionValueId.'\')" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\');"'); ?> <?php echo tep_draw_input_field("price_$optionValueId",$optionValueInfo['price'],' style="margin:3px 0px 3px 0px;" id="price_'.$optionValueId.'" size="7" onKeyUp="amUpdGross(\''.$optionValueId.'\')" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\');"'); ?>

 

 

Step #5 - Changes to categories.php

 

Search for the line where the tax class pull down is written, there should be something like

tep_draw_pull_down_menu('products_tax_class_id'

In this line, replace

'onchange="updateGross()"'

with

'onchange="updateGross();amUpdGrossAll()"'

(basically, just add ;amUpdGrossAll() to whatever the onchange event of the tax class selection is right now)

 

Step #6 - Happy testing! :D

Link to comment
Share on other sites

'onchange="updateGross();amUpdGrossAll()"'

(basically, just add ;amUpdGrossAll() to whatever the onchange event of the tax class selection is right now)

 

Sorry, there's a typo. It should read amUpdAllGross instead of amUpdGrossAll. So, Step #5 is:

 

In the tax class selection drop down, replace

'onchange="updateGross()"'

with

'onchange="updateGross();amUpdAllGross()"'

(basically, just add ;amUpdAllGross() to whatever the onchange event of the tax class selection is right now)

 

This should work now.

Link to comment
Share on other sites

Hi

Almost work like a charm.

 

The only small issue is how to get the price inkl to show up after update.

Now the field is empty.

 

Thanks a lot for great help......

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