Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Attributes/Item problem, os v2.3.4


pabloo20

Recommended Posts

Hello, I am new to oscommerce, interested me:
 
and I have a problem with steps 2 and 3, I do not know where in the file admin / categories.php copy the code below
My oscommerce version is 2.3.4
 
Thank you
 
Just above the following line:

echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  ';


Add:


// Improve Product Attributes/Item Editor begin
/*  Reveision by RE
    (1) ALLOW ARRAYS TO BE POPULATED BY ITERATIONS OF $i
    (2) CHANGE $n COMPARISON VALUE FOR ATTRIBUTE ARRAY
    (3) IN ESSENCE, CREATE A HIDDEN FIELD FOR ALL ARRAYS REGARDLESS OF NULL VALUE
    (3) ALL UNPOPULATED ARRAYS (THOSE NOT SELECTED) WILL BE FILTERED ON UPDATE AND ONLY CHECKED ARRAYS WILL BE STORED
*/
for ($i = 0, $n = sizeof ($att_price); $i < $n; $i++) {
	echo tep_draw_hidden_field('attributes['.$i.']', $attributes[$i]) . "\n";
}

for ($i = 0, $n = sizeof($att_price); $i < $n; $i++) {
	echo tep_draw_hidden_field('att_price['.$i.']', $att_price[$i]) . "\n";
}

for ($i = 0, $n = sizeof($plus); $i < $n; $i++) {
	echo tep_draw_hidden_field('plus['.$i.']', $plus[$i]) . "\n";
}

// Improve Product Attributes/Item Editor end


Just Below:

          if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
            $sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);
          }

Add:

// Improve Product Attributes/Item Editor begin
if ( isset($pID) && $pID != '' ) {
	tep_db_query("DELETE FROM products_attributes WHERE products_id = " . $pID);
	
	for ($i = 0, $n = sizeof($attributes); $i < $n; $i++) {
	  $values = split("_", $attributes[$i]);

/*	Revision by RE	 
    Since all array elements are passed from the hidden fields we need a way to add only the populated ones.
    ---> IF AFTER THE SPLIT $values[0] (options_id) IS NOT SET THEN DO NOT INSERT THE ARRAY INTO THE products_attributes TABLE
*/
	  if($values[0] !== ""){

// Added by SP beg
	  if($values[2] == "" && $values[3] == "") {
//	    tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $pID . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$x]. "','". $plus[$x]. "')");
	    tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $pID . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$i]. "','". $plus[$i]. "')");
	  } else {
	    $values[2] = "\"" . $values[2] . "\"";
	    $values[3] = "\"" . $values[3] . "\"";
	    tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $pID . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$i]. "','". $plus[$i]. "')");
//	    tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $pID . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$x]. "','". $plus[$x]. "')");
	  }
// Added by SP end
// by SP	tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id) VALUES (" . $pID . ", " . $values[0] . ", " . $values[1] . ")");
	}}
	// Revision by RE
	// --> ADD CLOSE BRACKET FOR ABOVE IF STATEMENT THAT FILTERS THE POPULATED ARRAYS
		}
// Improve Product Attributes/Item Editor end

 

Link to comment
Share on other sites

Hello Pablo @@pabloo20,

 

This add-on is not suitable for your store version. It is written for OsCommerce 2.2. See also that the upload date is from 2003, an eternity since this.

 

You should use this one:

Ajax Attribute Manager for 2.3

http://addons.oscommerce.com/info/7888

 

regards

Rainer

Link to comment
Share on other sites

@@pabloo20,

 

Sorry I posted the wrong link. It seems the newest full version is here:

http://addons.oscommerce.com/info/4063

 

Open the history tab and always check for the latest full version download

Link to comment
Share on other sites

I saw above the module. I began to remodel the one about which I asked and displays I have improved attributes added to the product , but I have a problem with saving them from the file categories.php

 

This code does not work:


if ( isset($HTTP_GET_VARS['pID']) && $HTTP_GET_VARS['pID'] != '' ) {
	tep_db_query("DELETE FROM products_attributes WHERE products_id = " . $HTTP_GET_VARS['pID']);
	
	for ($i = 0, $n = sizeof($attributes); $i < $n; $i++) {
	  $values = split("_", $attributes[$i]);

	  if($values[0] !== ""){

	  if($values[2] == "" && $values[3] == "") {
	    tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $HTTP_GET_VARS['pID'] . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$i]. "','". $plus[$i]. "')");
	  } else {
	    $values[2] = "\"" . $values[2] . "\"";
	    $values[3] = "\"" . $values[3] . "\"";
	    tep_db_query("INSERT INTO products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix) VALUES (" . $HTTP_GET_VARS['pID'] . ", '" . $values[0] . "', '" . $values[1] . "','". $att_price[$i]. "','". $plus[$i]. "')");
	  }
	}}

		}

How can I get $attributes of this:

					echo "\n" . "<input type=\"checkbox\" name=\"attributes[".$i."]\" value=\"" . $options_values['products_options_id'] . "_" . $suboptions_values['products_options_values_id'] . "_" . $prodoptions_values['options_values_price'] . "_" . $prodoptions_values['price_prefix'] . "\"" . $checked . ">" . $suboptions_values['products_options_values_name'] . " <input size=\"6\" type=\"text\" name=\"att_price[".$i."]\" value=\"".$prodoptions_values['options_values_price']."\"> <select name=\"plus[".$i."]\"><option value=\"\"><option value=\"+\"". $price_checked_plus .">+<option value=\"-\"". $price_checked_minus .">-</select><br>";

I have this:

for ($i = 0, $n = sizeof ($att_price); $i < $n; $i++) {
	echo tep_draw_hidden_field('attributes['.$i.']', $attributes[$i]) . "\n";
}

for ($i = 0, $n = sizeof($att_price); $i < $n; $i++) {
	echo tep_draw_hidden_field('att_price['.$i.']', $att_price[$i]) . "\n";
}

for ($i = 0, $n = sizeof($plus); $i < $n; $i++) {
	echo tep_draw_hidden_field('plus['.$i.']', $plus[$i]) . "\n";
}
Link to comment
Share on other sites

@@pabloo20,

 

I wouldn't try to mix up 2 add-ons- WHy? Which is the reason and the Goal? Why do you wants to loose time doing something which is already done in the ajax attributes manager, which works and does what you need.

 

Forget for the first add-on it's not for your store version.

 

Just revert all what you changed for the first add-on. Then do a new clean installation of ajax attribute manager and use it. If there is something which doesn't fit your needs, post again in the ajax attribute manager support forum and explain the details.

 

 

Another issue although in this case it wouldn't help neither: If you post code snippets, tell us from which file, from which add-on or if they are from the original core files. Best with line numbers.

Link to comment
Share on other sites

@@pabloo20

 

Use ajax attribute manager, it will allow to add attributes in a comfortable way in the product edit page. It replaces 100% the standard attributes page. You can create attributes in all variants there, prices, downloads etc. and even setup attribute groups which you can apply then on any other product with one click.

Link to comment
Share on other sites

PLEASE remove this topic. I create new with the correct query regarding my problem.

 

I need a module that allows me to add the product in the attributes . This allows you showed me who add attributes after adding the product :/

 

Paste the file categories.php the changes and describe exactly the problem

Link to comment
Share on other sites

When you add a new product Ajax Attribute displays me " Save Product options before adding ," I would like to select a possibility was immediately attributes and store them along with new product

Link to comment
Share on other sites

@@pabloo20,

 

you need to store the new option. Then it is available for other products without need to create it again.

 

Please, there exists a specific support forum for this add-on. You should post these kind of questions there:

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 weeks later...

@@vampirehunter,

 

same like for 2.3.4 standard, there is no difference on admin site between 2.3.4 standard and bootstrap, except for the categories.php file including gtin fields in the latest edge versions:
http://addons.oscommerce.com/info/4063

 

Between, this question should be better posted in the official attributes manager support forum:

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/page-68?hl=+attribute%20+manager

 

rgds

Rainer

Link to comment
Share on other sites

@@vampirehunter,

 

same like for 2.3.4 standard, there is no difference on admin site between 2.3.4 standard and bootstrap, except for the categories.php file including gtin fields in the latest edge versions:

http://addons.oscommerce.com/info/4063

 

Between, this question should be better posted in the official attributes manager support forum:

http://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/page-68?hl=+attribute%20+manager

 

rgds

Rainer

hi thanks

so the latest version on that link is ok to install.

is it quite a long install?

was wondering if this is the best alternative to the default attributes manager?

thanks

Link to comment
Share on other sites

@@vampirehunter,

 

it's considered the best actual version by all folks out here.

Installation is easy, just 2 file changes, if I well remember.

 

rgds

Rainer

Link to comment
Share on other sites

@@vampirehunter,

 

it's considered the best actual version by all folks out here.

Installation is easy, just 2 file changes, if I well remember.

 

rgds

Rainer

so the latest version this one

 

AJAX AttributeManager v2.8.14

  surfalot 25 Jul 2014  16x16_report.png

AJAX AttributeManager v2.8.14

 

+ Turned off QT Pro plugin that was left enabled in Phocea's version

+ Fixed 1062 - Duplicate entry '1-4' for key 'PRIMARY' insert into products_options_values (products_options_values_id, ... in shops with osC2.2ms2 & using mysql_ PHP functions

 

** All non-english Translations need at least a little more work. **

** espanol, french, german, hebrew, italian, portugues, russian **

 

This is a FULL PACKAGE compatible with both osCommerce 2.2ms2 and 2.3.x

 

support:

http://www.oscommerce.com/forums/index.php?showtopic=195959

 

is ok to use on BS Edge version?

thanks

Link to comment
Share on other sites

@@vampirehunter,

 

all 2.3.4 standard addons which only affect the admin side are compatible with BS.

AJAX Attribute mManager should work all ok with BS.

 

Only Add-Ons which manipulate products outside of the standard categories page, like "multiple products manager" or "Easy populate" for example need some updates.

The latest BS EDGE versions introduced new fileds like GTIN and SEO fileds which these add-ons do not include, so you can't address them with these add-ons.

 

rgds

Rainer

Link to comment
Share on other sites

  • 1 month later...

@@vampirehunter,

 

all 2.3.4 standard addons which only affect the admin side are compatible with BS.

AJAX Attribute mManager should work all ok with BS.

 

Only Add-Ons which manipulate products outside of the standard categories page, like "multiple products manager" or "Easy populate" for example need some updates.

The latest BS EDGE versions introduced new fileds like GTIN and SEO fileds which these add-ons do not include, so you can't address them with these add-ons.

 

rgds

Rainer

 

hi thanks

so if i use the AJAX AttributeManager v2.8.14 is this considered the best one available?

thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...