Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EasyPopulate Mod - Downloads & Attributes -


Guest

Recommended Posts

Not sure if anybody else has done this. If so please tell me....

 

The idea first emerged after I could not find a quick and easy way to add the filenames of multiple downloadable products to the database.

My original workaround goes as follows:

 

The Old Long Drawn-out Process: (skip waaay down to read about the EasyPopulate Mod)

---------------------------------------------------------------------------------------------

Add an Option Name called "Version" and an Option Value called "Download" via the Admin interface. This gives you the "products_options_id"

and "products_options_values_id" needed for the next step.

 

(If you need to repeat this procedure; you can find these ID's on the 'products attributes' page or in the "products_options" and "products_options_values" tables respectively.)

 

So for example:

products_options_id (Version) = 15

products_option_values_id (Download) = 13

 

(Side Note: These are mapped to a unique ID in the table "products_options_values_to_products_options", however that unique ID is not used in the actual "products_attributes" table which maps the product to its attributes. Why don't we just remove the "options_id" and "options_values_id" fields from the attributes table and replace it with "products_options_values_to_products_options_id" ?????)

 

Next, export your "products" table from MySql. Using phpMyadmin the settings will be: CSV data [default sub-options], add drop table, enclose table & field names, complete inserts, extended inserts, & CSV field names in row.

This CSV file will give you the OSC assigned "product_id".

 

Now export the tables "products_attributes" and "products_attributes_download" as CSV files using the same settings. (I refer to the default names -table_name-.CSV from this point)

 

In Excel, insert the 'product_id' of your downloadable products from the products.CSV file into product_attributes.CSV. The 'products_attributes_id' field should be set to autoincrement in Excel. Now in the 'options_id' & 'options_values_id' fields insert (mass copy) the ID's we got earlier (ex: 15 & 13).

 

Fill the 'options_values_price' & 'price_prefix' fields with what fits your needs and save product_attributes.CSV.

 

Now copy/insert the autoincremented field 'products_attributes_id' from products_attributes.CSV to products_attributes_download.CSV.

Editing products_attributes_download.CSV is simple, just insert the filenames of your products into the field 'products_attributes_filename' making sure the 'attribute_id' coincides with the correct model number.

Once again edit the other fields as seen fit.

 

Save, backup your MySql data and import the files products_attributes.CSV and products_attributes_download.CSV back into the database.

----------------------------------------------------------------------------------------------

 

The Easy Way

Well didn't that take forever?!

Having done this a few times on a site with hundreds of downloadable products I have finally decided to modify EasyPopulate and give it the ability to add multiple filenames for your products.

 

As of right now you will have to make sure you have the download Option Name and Value already created and will need the ID numbers of them.

However, I should be able to figure out a routine to create the Option names & values and retrieve the ID's automagically if they are entered in EasyPopulate.

Will probably base it on the same functions used to create categories on the fly.

 

If I am able to do that, there should be no problem adding other attributes on the fly using Easy Populate as well.

 

Any suggestions or comments are welcome.

Link to comment
Share on other sites

  • 4 weeks later...

yes and no.

 

I did get it to work for my needs but I need to do some considerable cleanup before it's anywhere near ready for a public release.

 

the issue of creating the Option Name and Option Value first still stands so it is a bit cumbersome.

 

I'm actually working on it this weekend so I will post an update ASAP.

Link to comment
Share on other sites

  • 2 months later...

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