Jump to content
Sign in to follow this  
joeyjgarcia

Attribute Sets Contribution

Recommended Posts

Hi Joey,

Thanks for replying to my post. My apologies, it confused you.

Basically, this is what I am doing.

 

The features:

a) A member on my site can rent movies for a week or two

B) The cost of renting a movie for a week is 5 ?

c) With every movie rented a member can rent an additional movie (in the same transaction) at a discounted price of 3 ? ( which normally will cost 5)

d) Maximum of 4 movies can be rented as ?additional movie? per transaction

 

Requirement:

a) Each record under movie rental category should have 4 options (one for each additional movie)

B) Each option should have list of all the movies under the movie rental category and the value should be +3 (constant)

 

My problem: Because the list of options and records are increasing everyday, I am hoping a SQL statement be the best option for me.

 

For now, I guess an Insert statement should be sufficient. Hopefully, I should be able to carry forward from there.

Please let me know if something is not clear

 

Thanks in advance

 

Aali

Edited by aalishan

Share this post


Link to post
Share on other sites

Well, I know the table exists definately, I thoroughly examined the db. I'll give databasetable.php a look. Thx!

 

I am assuming that db117028926 is your database.

 

This is one of two possible causes:

 

1) You haven't created the TABLE_PRODUCTS_ATTRIBUTES_SETS table.

or

2) You haven't correctly added the /catalog/admin/includes/database_tables.php

 

Whenever you see text that is in all uppercase it is "constant variable" which should be translated to the actual table name. 

 

Hope this helps.

 

Joey

Share this post


Link to post
Share on other sites

Found attribute sets thought great contribution, installed it as instructed or so i thought.

Now having a few problems

 

1) Now have two links in the admin to product attributes not too worried about that.

 

2) Attribute sets seem to be working fine, however when i update the product and add the update i get a message in the top of the screen saying "Warning no file uploaded."

 

3) When i try and enter the attribute manually it goes to an error screen saying

 

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

 

insert into products_attributes values ('', '1651', '1', '1', '', '+','0')

 

[TEP STOP]

 

The funny thing is when i first installed it i had products with attributes assigned and the add on seemed to work fine. Then i deleted those products and re uploaded with easy populate to tidy up the attributes. Then attribute sets stopped working.

 

Any help would be much appreciated.

Share this post


Link to post
Share on other sites

I'm sorry aalishan, I can't help you.

 

Joey

 

Hi Joey,

      Thanks for replying to my post. My apologies, it confused you.

  Basically, this is what I am doing.

 

  The features:

a) A member on my site can rent movies for a week or two

B) The cost of renting a movie for a week is 5 ?

c) With every movie rented a member can rent an additional movie (in the same transaction) at a discounted price of 3 ? ( which normally will cost 5)

d) Maximum of 4 movies can be rented as ?additional movie? per transaction

 

  Requirement:

a) Each record under movie rental category should have 4 options (one for each additional movie)

B) Each option should have list of all the movies under the movie rental category and the value should be +3 (constant)

 

My problem: Because the list of options and records are increasing everyday, I am hoping a SQL statement be the best option for me.

 

For now, I guess an Insert statement should be sufficient. Hopefully, I should be able to carry forward from there.

Please let me know if something is not clear

 

Thanks in advance

 

Aali

Share this post


Link to post
Share on other sites

Attribute Sets Start Going Away

 

Has anyone else experienced this?

 

Some of our items do not use attribute sets (because it doesn't make sense to use a set for an item that has a unique set of attributes).

 

If we log on to the admin site to make a change to anything about the product (price, description, title, etc) all of the attributes we selected that were not attribute sets get deleted.

 

Is there away to stop that from happening aside from creating 1000 attribute sets?

 

My guess is that since no attribute sets are choosen, then it goes back and deletes all attributes, but if that's true, it will can cause a problem with stores like mine who don't want hundreds of attribute sets.

 

Thanks in advance!

Share this post


Link to post
Share on other sites

OK. I've searched this thread but I can't find any mention of this problem...

 

Step 6 if the install.txt says

Step 6. Order the Drop Down options by the "sort_order" field in the /catalog/product_info.php file.

        This will display the options in the drop down list in the order that they were assigned

        when they were created/modified.

       

        **HINT**: In a fresh copy of osCommerce's /catalog/product_info.php page, look at line 132 for this

        query.

       

******** 6.1a: I changed this query:

       

       

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");   

 

The problem is, I don't have a "$products_options_query" or anything quite like it in catalog/product_info.php.

 

I'm running a heavily modded OSC 2.2MS2 with SEC, but as far as I know, it is MS2.2.

 

How can I get this installed?

 

Thanks

RickKnight

Share this post


Link to post
Share on other sites

Hello all,

 

After installing Attributes Sets (thank you for the contrib. by the way) I have this error (had a couple more so far but was able to fix them). I need some help!!!! :)

 

Parse error: parse error, unexpected T_STRING in /home/ballpark/public_html/cart/admin/includes/database_tables.php on line 58

 

Here's lines 50-60:

 

define('TABLE_SESSIONS', 'sessions');
 define('TABLE_SPECIALS', 'specials');
 define('TABLE_TAX_CLASS', 'tax_class');
 define('TABLE_TAX_RATES', 'tax_rates');
 define('TABLE_GEO_ZONES', 'geo_zones');
 define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones');
 define('TABLE_WHOS_ONLINE', 'whos_online');
 define('TABLE_ZONES', 'zones'); cart/admin/includes/database_tables.php
 define('TABLE_PRODUCTS_ATTRIBUTES_SETS', 'products_attributes_sets');
 define('TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS', 'products_attributes_sets_to_products');
?>

Share this post


Link to post
Share on other sites

i'm going to try for the 4th time to install this contrib...i'm an idiot.. in the install.txt one of the files it says to back up is:

  • /catalog/admin/products_attributes_sets.php
    /catalog/admin/includes/languages/english/products_attirbutes_sets.php

i don't have any of these files in my current installation to backup. should i have them already? does anyone want to volunteer to do the install for me? i might be able to afford a nominal fee. lol

Share this post


Link to post
Share on other sites

i can't believe it. i did it!!! woo hoo! one small issue however. on the page that you set the option name and size there is no submit button but rather a link that says:

IMAGE_CREATE_ATTRIBUTE_SET

 

it works and i don't want to mess anything up since i finally added this contrib. anyone know a quick easy fix? if not no big deal since it's on the admin side.

 

thank you!

Share this post


Link to post
Share on other sites

Hi,

I am getting:

 

Parse error: parse error in /home/httpd/vhosts/dhponline.com/httpdocs/store/admin/categories.php on line 446

 

Can someone help me :(

 

 

Here is the code lines 414 - 489:

 

// BOF: Attributes sort/copy

if ( $HTTP_POST_VARS['copy_attributes']=='copy_attributes_yes' and $HTTP_POST_VARS['copy_as'] == 'duplicate' ) {

// WebMakers.com Added: Copy attributes to duplicate product
 // $products_id_to= $copy_to_products_id;
 // $products_id_from = $pID;
           $copy_attributes_delete_first='1';
           $copy_attributes_duplicates_skipped='1';
           $copy_attributes_duplicates_overwrite='0';

           if (DOWNLOAD_ENABLED == 'true') {
             $copy_attributes_include_downloads='1';
             $copy_attributes_include_filename='1';
           } else {
             $copy_attributes_include_downloads='0';
             $copy_attributes_include_filename='0';
           }
           tep_copy_products_attributes($products_id_from,$products_id_to);

// EOF: WebMakers.com Added: Attributes Copy on non-linked

         }

         if (USE_CACHE == 'true') {
           tep_reset_cache_block('categories');
           tep_reset_cache_block('also_purchased');
         }
       }

       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id));
       break;
     case 'new_product_preview':
// copy image only if modified
       $products_image = new upload('products_image');
       $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
       if ($products_image->parse() && $products_image->save()) {
         $products_image_name = $products_image->filename;
       } else {
         $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
       }
       break;
   }
 }
// check if the catalog image directory exists
 if (is_dir(DIR_FS_CATALOG_IMAGES)) {
   if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
 } else {
   $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
 }
?>
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
 }
?>
<?php
/* BOF: Attributes sort/copy (afaik, this doesn't do anything) */
// WebMakers.com Added: Display Order
 switch (true) {
   case (CATEGORIES_SORT_ORDER=="products_name"):
     $order_it_by = "pd.products_name";
     break;
   case (CATEGORIES_SORT_ORDER=="products_name-desc"):
     $order_it_by = "pd.products_name DESC";
     break;
   case (CATEGORIES_SORT_ORDER=="model"):
     $order_it_by = "p.products_model";
     break;
   case (CATEGORIES_SORT_ORDER=="model-desc"):
     $order_it_by = "p.products_model DESC";
     break;
   default:
     $order_it_by = "pd.products_name";
     break;
   }
/* EOF: Attributes sort/copy */
?>

Share this post


Link to post
Share on other sites

The module is fabulous. And I really would like to useit, but I'm not at all familiar with coding. One of the things that's gotten me slowed down is that pricing for size in my catalog is based on a percentage of the retail price for each item. If I create a set, I can only add a currency amount to the price when I create an attribute set. i.e. Add +$3.00 for XXXL and so forth.

 

In reality, each plus size for me is based on the actual price of the item I'm posting and I have about 200 different items in my catalog. If I use the attributes_sets mod, it means actually creating a different set for each item, which sort of takes away from the whole intent.

 

Is there a way of referring back to the price of each item and multiplying by a percentage? Those are fixed. +10% for 3XL, +20% for 4XL. Is there some place where such a calculation can be performed or is this getting too far away from the module?

 

Thanks!

Share this post


Link to post
Share on other sites

Yes, you are correct on your guess. I see that that can be a problem and I'll work on a fix for that. Unfortunately, I am strapped for time on a side project but I'll make it a priority to get this fixed.

 

Thanks for posting this overlooked symptom of the feature.

 

Joey

 

Attribute Sets Start Going Away

 

Has anyone else experienced this?

 

Some of our items do not use attribute sets (because it doesn't make sense to use a set for an item that has a unique set of attributes).

 

If we log on to the admin site to make a change to anything about the product (price, description, title, etc) all of the attributes we selected that were not attribute sets get deleted.

 

Is there away to stop that from happening aside from creating 1000 attribute sets?

 

My guess is that since no attribute sets are choosen, then it goes back and deletes all attributes, but if that's true, it will can cause a problem with stores like mine who don't want hundreds of attribute sets.

 

Thanks in advance!

Share this post


Link to post
Share on other sites

You had me worried there for a second, but my install instructions were off my a couple of line number, instead of line 132 it should be line 134. I did a search for "$products_options_query" and found it.

 

I have a freshly extracted version of osCommerce that I use strictly to get line numbers from an original copy of osCommerce 2.2 MS2, I don't use this copy at all and I don't install any contributions to it so line number 134 should be pretty close.

 

I hope this helps.

 

Joey

 

 

OK. I've searched this thread but I can't find any mention of this problem...

 

Step 6 if the install.txt says

The problem is, I don't have a "$products_options_query" or anything quite like it in catalog/product_info.php.

 

I'm running a heavily modded OSC 2.2MS2 with SEC, but as far as I know, it is MS2.2.

 

How can I get this installed?

 

Thanks

RickKnight

Share this post


Link to post
Share on other sites

I know you fixed this problem by now, but it is easy to see the problem on line 58. Fresh eyes always make a difference. :-)

 

Joey

 

Hello all,

 

After installing Attributes Sets (thank you for the contrib. by the way) I have this error (had a couple more so far but was able to fix them). I need some help!!!! :)

 

Parse error: parse error, unexpected T_STRING in /home/ballpark/public_html/cart/admin/includes/database_tables.php on line 58

 

Here's lines 50-60:

 

define('TABLE_SESSIONS', 'sessions');
 define('TABLE_SPECIALS', 'specials');
 define('TABLE_TAX_CLASS', 'tax_class');
 define('TABLE_TAX_RATES', 'tax_rates');
 define('TABLE_GEO_ZONES', 'geo_zones');
 define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones');
 define('TABLE_WHOS_ONLINE', 'whos_online');
 define('TABLE_ZONES', 'zones'); cart/admin/includes/database_tables.php
 define('TABLE_PRODUCTS_ATTRIBUTES_SETS', 'products_attributes_sets');
 define('TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS', 'products_attributes_sets_to_products');
?>

Share this post


Link to post
Share on other sites

Do you have the following variable set in the specified file?

 

admin\includes\languages\english.php(240): define('IMAGE_CREATE_ATTRIBUTE_SET', 'Create Attribute Set');

 

Whenever you get a variable name in ALL CAPS it is the same problem, the variable was not defined or correctly defined.

 

Joey

 

 

 

 

i can't believe it. i did it!!! woo hoo! one small issue however.  on the page that you set the option name and size there is no submit button but rather a link that says:

IMAGE_CREATE_ATTRIBUTE_SET

 

it works and i don't want to mess anything up since i finally added this contrib. anyone know a quick easy fix? if not no big deal since it's on the admin side.

 

thank you!

Share this post


Link to post
Share on other sites

Not that I know of, but if you can send me more details (if possible) I'll look into it.

 

Joey

 

 

Is there a limit to the amount of drop down items? I have 23 in one of my sets and only 19 show up when you click the drop down on the site....

Share this post


Link to post
Share on other sites

Can't see an obvious error, try identifying the exact line with a comment at the END of the line to show which is line 446.

 

Joey

 

 

Hi,

I am getting:

 

Parse error: parse error in /home/httpd/vhosts/dhponline.com/httpdocs/store/admin/categories.php on line 446

 

Can someone help me  :(

Here is the code lines 414 - 489:

 

// BOF: Attributes sort/copy

if ( $HTTP_POST_VARS['copy_attributes']=='copy_attributes_yes' and $HTTP_POST_VARS['copy_as'] == 'duplicate' ) {

// WebMakers.com Added: Copy attributes to duplicate product
 // $products_id_to= $copy_to_products_id;
 // $products_id_from = $pID;
           $copy_attributes_delete_first='1';
           $copy_attributes_duplicates_skipped='1';
           $copy_attributes_duplicates_overwrite='0';

           if (DOWNLOAD_ENABLED == 'true') {
             $copy_attributes_include_downloads='1';
             $copy_attributes_include_filename='1';
           } else {
             $copy_attributes_include_downloads='0';
             $copy_attributes_include_filename='0';
           }
           tep_copy_products_attributes($products_id_from,$products_id_to);

// EOF: WebMakers.com Added: Attributes Copy on non-linked

         }

         if (USE_CACHE == 'true') {
           tep_reset_cache_block('categories');
           tep_reset_cache_block('also_purchased');
         }
       }

       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories_id . '&pID=' . $products_id));
       break;
     case 'new_product_preview':
// copy image only if modified
       $products_image = new upload('products_image');
       $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
       if ($products_image->parse() && $products_image->save()) {
         $products_image_name = $products_image->filename;
       } else {
         $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
       }
       break;
   }
 }
// check if the catalog image directory exists
 if (is_dir(DIR_FS_CATALOG_IMAGES)) {
   if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
 } else {
   $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
 }
?>
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
 }
?>
<?php
/* BOF: Attributes sort/copy (afaik, this doesn't do anything) */
// WebMakers.com Added: Display Order
 switch (true) {
   case (CATEGORIES_SORT_ORDER=="products_name"):
     $order_it_by = "pd.products_name";
     break;
   case (CATEGORIES_SORT_ORDER=="products_name-desc"):
     $order_it_by = "pd.products_name DESC";
     break;
   case (CATEGORIES_SORT_ORDER=="model"):
     $order_it_by = "p.products_model";
     break;
   case (CATEGORIES_SORT_ORDER=="model-desc"):
     $order_it_by = "p.products_model DESC";
     break;
   default:
     $order_it_by = "pd.products_name";
     break;
   }
/* EOF: Attributes sort/copy */
?>

Share this post


Link to post
Share on other sites

I don't know if osCOmmerce already works that way with a percent sign, if not it could be added in but I don't want to venture to add it in, mainly because it doesn't help me out (it's hard enough keeping up with this thread). I bet someone else has already created this though. Worst case, you could pay someone to add it in?

 

Good Luck

 

Joey

 

 

 

The module is fabulous.  And I really would like to useit, but I'm not at all familiar with coding.  One of the things that's gotten me slowed down is that pricing for size in my catalog is based on a percentage of the retail price for each item.  If I create a set, I can only add a currency amount to the price when I create an attribute set.  i.e.  Add +$3.00 for XXXL and so forth. 

 

In reality, each plus size for me is based on the actual price of the item I'm posting and I have about 200 different items in my catalog.  If I use the attributes_sets mod, it means actually creating a different set for each item, which sort of takes away from the whole intent. 

 

Is there a way of referring back to the price of each item and multiplying by a percentage?  Those are fixed.  +10% for 3XL, +20% for 4XL.  Is there some place where such a calculation can be performed or is this getting too far away from the module?

 

Thanks!

Share this post


Link to post
Share on other sites

Thanks, Joey. Actually, I also asked a friend, who said that it's an easy fix. Hopefully that's true. I'll look forward to seeing it done and will see how much he charges. :)

 

I don't know if osCOmmerce already works that way with a percent sign, if not it could be added in but I don't want to venture to add it in, mainly because it doesn't help me out (it's hard enough keeping up with this thread).  I bet someone else has already created this though.  Worst case, you could pay someone to add it in?

 

Good Luck

 

Joey

Share this post


Link to post
Share on other sites
Do you have the following variable set in the specified file?

 

admin\includes\languages\english.php(240): define('IMAGE_CREATE_ATTRIBUTE_SET', 'Create Attribute Set');

 

Whenever you get a variable name in ALL CAPS it is the same problem, the variable was not defined or correctly defined.

 

Joey

 

as i told you already joey after successfully installing this contrib. after several tries i just had to do it again after having to have a fresh osc installation. both the first time i successfully did it and this time i somehow missed adding that definition. i've gone back and search through the install.txt. if it's not there i jsut wanted to let you know. if it is there then it's confirmed what i've always thought-i'm an idiot...:)

Share this post


Link to post
Share on other sites

Hi Guys,

Just added the contrib and everything "seems" to be working fine but I have 1 probably really dumb question.

How do I add more attributes to an already created set? I can see where I can remove them but I just can't figure out how to add them!

Do I have to create another new set with the new attributes after deleting the old one?

 

Thanks,

Bob

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×