Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ubur

Archived
  • Posts

    34
  • Joined

  • Last visited

Profile Information

  • Real Name
    Cory

ubur's Achievements

  1. I am using Mass Attributes and am having some trouble. I like the contribution, just need some help. The contribution automatically names the attribute set you create as just "Options" So I have about 130 items all with an attribute set of "Options". This gets really confusing. Here is the code for those not familiar with Mass Attributes (this is massattributes.php by he way) <? require('includes/application_top.php'); $languages = tep_get_languages(); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> </table></td> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <? //--- Did we submit the attribute changes? if(isset($_POST[updateattributes])){ //I think im going to just delete all the old crap and re-insert cause I don't know how this script works yet~! $deleteattributes=mysql_query("DELETE FROM products_attributes WHERE products_attributes.products_id='$_GET[current_product_id]'"); if(!$deleteattributes) die(mysql_error()); $deleteattributelinks=mysql_query("DELETE FROM products_attributes WHERE products_attributes.products_id='$_GET[current_product_id]'"); if(!$deleteattributelinks) die(mysql_error()); $addanewoption=mysql_query("INSERT INTO products_options (language_id,products_options_name) VALUES ('1','Options')"); $optionid=mysql_insert_id(); $attributes = explode("\n", $_POST[prod_attributes]); foreach($attributes AS $key => $value){ if($value!=""){ $addnewoptionvalue=mysql_query("INSERT INTO products_options_values (language_id,products_options_values_name) VALUES ('1','$value')"); if(!$addnewoptionvalue) die('Damn you suck at coding. Trying to add new option value.<br><br>'.mysql_error()); $optionvalueid=mysql_insert_id(); $linkvaluewithoption=mysql_query("INSERT INTO products_options_values_to_products_options (products_options_id,products_options_values_id) VALUES ('$optionid','$optionvalueid')"); if(!$linkvaluewithoption) die('Damn you suck at coding. Trying to add link value with option.<br><br>'.mysql_error()); $linkattributewithproduct=mysql_query("INSERT INTO products_attributes (products_id,options_id,options_values_id ) VALUES ('$_GET[current_product_id]','$optionid','$optionvalueid')"); if(!$linkattributewithproduct) die('Damn you suck at coding. Trying to link attribute with product.<br><br>'.mysql_error()); } } echo "You have successfully updated the attributes for this product.<br> <a href=\"java script:history.go(-2)\">Click here to return.</a>"; die(); } //--- First we see if we even have any attributes for this product yet $getattributes=mysql_query("SELECT * FROM products_attributes,products_options,products_options_values WHERE products_attributes.products_id='$_GET[current_product_id]' AND products_options.products_options_id=products_attributes.options_id AND products_options_values.products_options_values_id=products_attributes.options_v alues_id ORDER BY products_options_values.products_options_values_name"); $oldattributes=""; while($attribute=mysql_fetch_array($getattributes)){ $oldattributes="$oldattributes"."$attribute[products_options_values_name]"."\n"; } echo " <table cellspacing=0 cellpadding=4> <tr><td colspan=2><h2>Mass Attributes</h2></td></tr> <form action=massattributes.php?action=select&current_product_id=$_GET[current_product_id]&cPath=$_GET[cPath] method=post> <tr><td colspan=2><textarea cols=30 rows=25 name=prod_attributes>$oldattributes</textarea></td></tr> <tr><td><input type=submit name=updateattributes value='Save Changes'></td> <td><a href=\"java script:history.back()\">Cancel</a></td></tr> </table></form>"; ?> </table></TD> </TR> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Is there a simple fix so that instead of naming it "Options" it uses the Products name??? This would be a huge help if it could be. I would think you could just do something where it tells it to name the new set "Options", that you could change that to say echo product_name, or something. I am not a programmer. Thank you so much in advance, I really appreciate any help anyone can provide. Cory
  2. Hey everyone, I am having aproblem with the one time charge feature in the attributes. I set the one time charge, sit save, but it doesnt save. I dont get any errors like the table for it doesnt exist or anything, it just won't take it. I have added some contributions, and wondering if maybe one of those did something? I did revert back to my original product_attributes.php file to see if I did change something, and that wasnt it. My other questions was does the One Time Charge over ride the products price? Can it? I have a lot of products, I really dont want to have to go through each one and do the -1.25, or -4.67, on each and every product. Way to many. I am doing a site for a carpet seller, they have a lot of carpets, each having many attributes. They also need to be able to offer people the ability to but a sample at a flat rate. Any ideas would be very much appreciated. Cory
  3. I just installed Options as Images MS2, shiwh is exactly what I have been looking for. But I also needed a way to easily and quickly add attributes, as a lot of the items for the store had a lot of them, and all different. So I found Mass Attributes, which works great. My Only problem is getting the two to work together wiht out problems. here are the issues I am running into: Mass Attributes works great, but instead of using the product name as the name of the product options, which would be ideal, it uses the word "options". This causes a huge headache to find what options you want with Options as Images. Anyone know how to make it display the product you are adding it to name, instead of "options" Whenever i change the attributes in Mass Attributes, it creates a new set of options, instead of just updating the current set. Any fixes anyone knows of? Other than that, I would highly reccomend these two for anyone that has a ton of options and products that need images. Just what i wanted, just a few bugs that is giving me a hard time. If anyone can help out, it would be much appreciated. Thanks, Cory http://www.gamealmanac.com
  4. If you go into PHPMyAdmin, Run SQL and just paste in the text it will work. I did have to make another change, and doing this: INSERT INTO configuration_group SET configuration_group_title = 'Product Attribute Images', configuration_group_description = 'Use Images for Product Options/Attributes instead of drop lists.', sort_order =5, visible =1; INSERT INTO configuration SET configuration_title = 'Large Option Images', configuration_key = 'OPTIONS_IMAGES_LARGE', configuration_value = 'true', configuration_description = 'Include larger image in pop-up window on product info page', configuration_group_id = '14', sort_order =2; Added a ";" after visible=1 Cory
×
×
  • Create New...