Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Any advice on how to pull product


user001

Recommended Posts

Hi!,

 

I would need to pull all of the products information in this way from database,

 

product name;price

product name;price

product name;price

 

etc...

 

and to get the information saved in txt file. I tried to accomplish this by altering easy populate, but didnt get it out right, anyone knows any contrib or maybe an other solution to get it like this?

 

Help needed! (again) :rolleyes:

 

VB

Link to comment
Share on other sites

Hi!,

 

I would need to pull all of the products information in this way from database,

 

product name;price

product name;price

product name;price

 

etc...

 

and to get the information saved in txt file. I tried to accomplish this by altering easy populate, but didnt get it out right, anyone knows any contrib or maybe an other solution to get it like this?

 

Help needed! (again) :rolleyes:

 

VB

 

 

why not have a look at the froogle feed contribution, that pulls all products from the db and puts them into a file.

Treasurer MFC

Link to comment
Share on other sites

Unfortunately that froogle contrib didnt manage to get the product listing the way as i need it :/

 

It has to be specifically in the format

 

product name;price

product name;price

product name;price

 

and so on, and to get it saved in to txt file. Anyone else has any good ideas of how to accomplish this? :)

Link to comment
Share on other sites

Unfortunately that froogle contrib didnt manage to get the product listing the way as i need it :/

 

It has to be specifically in the format

 

product name;price

product name;price

product name;price

 

and so on, and to get it saved in to txt file. Anyone else has any good ideas of how to accomplish this? :)

 

all you have to do is strip out the info you do not need and you are done. 1min

Treasurer MFC

Link to comment
Share on other sites

all you have to do is strip out the info you do not need and you are done. 1min

 

correction, 2min

 

 

2005 Lazaris Gilbert Williams Calendar;20.50

Arkansas Clear Quartz Point;498.50

Arkansas Clear Quartz Cluster 99;127.90

Arkansas Clear Quartz Cluster 100;49.70

Clear Quartz Pyramids Set #3;105.80

Crystal Cluster #106;115.40

Clear Quartz Pyramids Set #1;48.10

Smoky Quartz Pyramids Set #1;41.70

Clear Quartz Pyramids Set #2;35.30

Arkansas Clear Quartz Cluster #111;127.90

Messages from your Angels;28.90

Roze Quartz Crystal Sphere;961.80

etc.

Treasurer MFC

Link to comment
Share on other sites

I posted in this thread before but it may have been deleted by a moderator.

I was offering to help for free but my post may have looked like commercial solicitation.

 

If you would like a me to post a solution using php/sql, let me know in this thread. It should take me 10 minutes to write.

 

Robert

 

P.S. After thinking about it.... maybe I never actually posted to this thread before and just clicked preview.

Link to comment
Share on other sites

It might go in 2minutes, if there wouldnt be over 500 products, and estimated amount of products will be 1000-1500 :/

 

 

And rob123 seems to be my new best friend! :) Please Rob if you could write that code for me, it would be very appreciated! :rolleyes:

 

VB

 

 

correction, 2min

2005 Lazaris Gilbert Williams Calendar;20.50

Arkansas Clear Quartz Point;498.50

Arkansas Clear Quartz Cluster 99;127.90

Arkansas Clear Quartz Cluster 100;49.70

Clear Quartz Pyramids Set #3;105.80

Crystal Cluster #106;115.40

Clear Quartz Pyramids Set #1;48.10

Smoky Quartz Pyramids Set #1;41.70

Clear Quartz Pyramids Set #2;35.30

Arkansas Clear Quartz Cluster #111;127.90

Messages from your Angels;28.90

Roze Quartz Crystal Sphere;961.80

etc.

Link to comment
Share on other sites

The number of products has nothing to do with it, you could have half a million. Change the code of the froogle contrib to strip out the data requests you don't need, so that you're left with only products_name, and products_price. Stick a ; in there if need be (in the echo command). Run the page, copy it and paste it into notepad or whatever.

 

Hope that helps,

Jeremy

Link to comment
Share on other sites

Copy the code below into a new file called whateveryouwant.php .

FTP the file into your admin folder.

 

Using your internet browser, access the file called www.yoursite.com/catalog/admin/whateveryouwant.php

 

If all works as it should, you should be prompted to save a file to your local harddrive.

 

Let me know if it works or if you have any questions

Robert

 

<?php
$filename = "txthinnasto.txt";
$status = "1";  //"1"= Active, "2"= Not Active, ""=All Products
$quantity_minimum = "1"; //Only display products with a minimum stock of this value
$language_id = "1";
require('includes/application_top.php');
require('includes/database_tables.php');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: must-revalidate");
header("Cache-Control: post-check=0, pre-check-0", false);
header("Content-Type: text/plain");
header("Content-Disposition: attachment; filename=$filename");
$the_query = tep_db_query("select pd.products_name as 'NAME', 
p.products_price as 'PRICE' from " . TABLE_PRODUCTS ." p
join " . TABLE_PRODUCTS_DESCRIPTION ." pd
on p.products_id = pd.products_id
where p.products_status like '%$status%'
and pd.language_id = '$language_id'
and p.products_quantity >= '$quantity_minimum';");
 while($the_info = mysql_fetch_array($the_query)) {
	 $rows++;
	 print ("$the_info[NAME];" . number_format($the_info[PRICE],2,'.', '') . "\r\n"); 
  	 }
tep_db_free_result($the_query);
?>

Link to comment
Share on other sites

Yes! it works extremly well! :lol:

 

The information in the file is exactly in the in way it needs to be :)

 

I cant thank enough for this, this has reduced my daily price list updating into a one single click! :D

 

Very, very big thanks to you Rob! :thumbsup:

 

Think you might ever need my help in anything, please, give me a PM/email :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...