Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Download Populate


graphicore

Recommended Posts

I am working on a contribution to read/wriite an excel file with the information contained for the filename download.

 

I lack of PHP knowledge and I know anyone that knows PHP can use the file in

: catalog/admin/products_attributes.php as reference to create an import/export in excel since all the funtions needed are defined there.

 

I already worked on half of the contribution but is all a mess. (Since I have code not needed in there)

 

EasyPopulate lacks the import/export for the filename, maxsize and maxcount on the products attributes.

 

Instead of dealing with this contribution it will be easier to create one to import/export an excel file to modify the table products_attributes_download in a easier way than the one-by-one solution of the admin - products_attributes.

 

I know this is a contrib that can be done in couple hours. It's taking me days and I am only half way.

 

Can anyone help? (I got a headache)

Link to comment
Share on other sites

  • 4 weeks later...

Did you try Super Download Shop v1.0?

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Did you try Super Download Shop v1.0?

 

Hi Alex,

 

This contrib is not as download controller.

 

Easy populate helps you on importing/exporting the database, but it lacks of importing/exporting the products attributes. I requested some of their programmers to help including this feature which was left behind since the beggining of EasyPopulate.

 

But I guess easypopulate has gotten too complex and since nobody want to add this feature (I guess because is a little more complex than what I thought) I decided to create a separated contribution.

 

I modified one of the default OSC files (Products Attributes) to output what I need from the database so I can import and edit its missing info on excel and then I later export it as a CVS file and reimport it on my PHPAdmin/SQL section.

 

It was not a difficult task for my site (Basically done manually :P), but it would be great if something is implemented to work kinda like Easy Populate but just for the product attributes.

 

I have a file than just need a few conditions/modifications. If you can help that will be great.

Edited by graphicore
Link to comment
Share on other sites

Sorry I got your idea wrong at the first glance.

 

If you're trying to list all filenames/maxdays/maxcount assigned to products attributes, just use tep_db_query() function to get them, and use a while loop to collect them and copy to an array.

 

$download_query = tep_db_query("select pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount from " . TABLE_PRODUCTS . " as p, " . TABLE_PRODUCTS_ATTRIBUTES . " as pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " as pad where p.products_id = '" . (int)$products_id . "' and pa.products_id = p.products_id and pad.products_attributes_id = pa.products_attributes_id");
while ($download_array = tep_db_fetch_array($download_query)) {
 $filelist[] = $download_array;
}

 

You need to modify above code for your attempt. It is just a sample code showing how to extract such data from db.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Sorry I got your idea wrong at the first glance.

 

If you're trying to list all filenames/maxdays/maxcount assigned to products attributes, just use tep_db_query() function to get them, and use a while loop to collect them and copy to an array.

 

$download_query = tep_db_query("select pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount from " . TABLE_PRODUCTS . " as p, " . TABLE_PRODUCTS_ATTRIBUTES . " as pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " as pad where p.products_id = '" . (int)$products_id . "' and pa.products_id = p.products_id and pad.products_attributes_id = pa.products_attributes_id");
while ($download_array = tep_db_fetch_array($download_query)) {
 $filelist[] = $download_array;
}

 

You need to modify above code for your attempt. It is just a sample code showing how to extract such data from db.

 

The file has it.

I just do not know too much PHP programming (While I am learning PHP fast).

 

Here is the file, open it, run it and check the code. The seleccion variables do not work on this file. Neither I know how to create an excel file but I think I can figure how to create a .txt file from its output.

 

http://www.soundrise.com/download_populate.zip

 

It you can help me at least with enabling the conditioners on top it will be great.

 

Thanks,

Edited by graphicore
Link to comment
Share on other sites

Please be more specific in which part you need help. I am not interested in developing a contribution which I don't need. I don't have time to go through every line of that file either.

 

The top part is where you deal with the info submitted within the form, either by $_GET or $_POST or both. Before you deal with that part, you must build up your form first. I see selection element without form in your code, and a form without submit element, a form without input element.

 

Try to create a simple file at the beginning, with only one or 2 forms and see how it goes. Otherwise you are just creating a big mess.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Sorry...

 

I was just trying to save some time and that's why I modified the OSC file. But I got your point.

 

I will try to start developing from scratch and see how it goes.

 

My major problem is that I know how to create a simple HTML form, but I do not know how to handle and refresh the info on the same page. I guess I will need to learn watching some other sample codes.

 

I am an old programmer.. QBasic, Cobol, Pascal, Informix, Dataflex, etc. and varelly remember coding on them. But I still know programming structures and that's why its easy for me to read a code (In any languaje)and modify it while checking info on the net or other samples.

 

I sometimes can do a few good things from scratch. :P (Check my contributions too)

 

I do not have too much time myself, I am just doing this contrib so others do not have to do what I did manually. I really appreciate your comments.

Edited by graphicore
Link to comment
Share on other sites

OK. I myself was not a php coder either. I was a programmer in C/C++, so php is easy for me, as for you too.

 

You don't need too many thing in that file to start with. The application_top.php is one thing you must have at the top.

 

You will also need those lines which handle the $HTTP_GET_VARS['action'] and the variable $action. When you submit a form to the file itself, set the form action element with tep_redirect() fuction and the parameter 'action=xxxx', the value xxxx you set will be stored in $HTTP_GET_VARS['action'].

 

If the form method is 'post', the info submitted will be stored in $HTTP_POST_VARS['input_name'], otherwise they are stored in $HTTP_GET_VARS['input_name'].

 

You might need a quick reference of all osCommerce fuctions, check this link.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

Ooops, sorry.... not tep_redirect(), it's tep_href_link() to be used in form action element.

Super Download Shop, PayPal Express Checkout IPN, Selling Downloads, Visual Validation (preventing robotic flood), phpBB2 Integration

 

Yes, I'm willing to help, but please ask in the right place. Think twice before trying to PM me, it might be ignored.

Link to comment
Share on other sites

I am suprised that the Easy Populate concept is not a viable product by now...

There is NO WAY to use OSCommerce without a product similar to EP...

Hand inputting a few hundred products and definitions and prices and weights and ..the list goes on and on

is NOT anyway to handle a store product list being placed into a new oscommerce store... no way...

 

I am STILL struggling with EP.... I cannot use OSC or ZenCart or anything like it if a download/upload product is not available.

I am new to OSC but trying hard... ZenCart is nice and has more options but very hard on the database.

Even with a clean install and a product db of ONE product , EP download is perfect but the upload fails to load a line due to "missing" model number (which is NOT missing).... anyway...

Any of you nice folks have a solution to EP... PLEASE let em know...

I am posting to an Easy Populate thread in the Installationa dn Configuration forums...

THANKS

 

SteveRF

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