login
Forgot?
Login with Facebook

Don't have an account? Register one now!

CRELoaded osCommerce PHP Script for SQL Query/Import Needed

Bids 
7
Avg Bid
$223 USD
CLOSED
  • Project ID:

    632229
  • Project Type:

    Fixed
  • Budget:

    $30-$250 USD

Project Description:

We're in need of a few different PHP scripts for our site that export from and import to the SQL database.

For the first one, we need it to be a sort of an EasyPopulate basic export for customers so they can export model/price/qty. whenever they want. This needs to be linkable so that when a customer clicks the link, it brings up a download dialog box.

The second one we need is a script that reads a .xls file from a remote location, reads through it, connects to the database and updates the necessary tables. The .xls file in the remote location will have the model number, price, and quantity without column headers. It will always be in that exact order and will be updated hourly. We need to be able to run this script as a cron job.

If you have any questions, feel free to ask on the PMB. Please reply with "I have read and understand this project" in your bid so that I know you took the time to read this.

Skills required:

eCommerce, OSCommerce, PHP, SQL

Project posted by:

leenegri United States
(5 Reviews)

Last seen:

Public Clarification Board

2 messages

  • leenegri

    Also, we need to have a way in the admin to choose which customers can access this export script and make it hidden or unaccessable to people who don't have access. A checkbox in the "edit customer details" page in the admin would work if that can be done.

    over 1 year ago

  • leenegri

    Here's an example of an export script someone wrote to work with a .csv file. If we can modify this to work how we need it to, that'd be great.

    <?php

    // name this file get_feed.php or whatever you want, just change it below also.
    /* use the following cron job to execute this as often as you need.
    cd /absolute/path/to/catalog/your_admin/
    php get_feed.php
    */

    // set options
    $use_map = 0; // set to 1 to enable map
    $use_markup = 0; //set to 1 to enable markup calculations
    $remote_file = 'products.csv' // name of products file to get from vendor
    $local_file = '/absolute/path/to/catalog/products.csv'; // Change to absolute path to a local file name
    $ftp_server = 'ftp://domain.com'; // Change to fully qualified domain name
    $ftp_user_name = 'your_user_name'; // Change to your user name
    $ftp_user_passs = 'password'; // Change to your password
    $remote_dir = '' ; // Change to something other than entry directory

    // open some file to write to
    $handle = fopen($local_file, 'w');

    // set up basic connection
    $conn_id = ftp_connect($ftp_server);

    // login with username and password
    $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

    // change directory if need to
    if (isset($remote_dir)) {
    ftp_chdir($conn_id, "somedir")
    }

    // try to download $remote_file and save it to $handle
    if (ftp_fget($conn_id, $handle, $remote_file, FTP_ASCII, 0)) {
    echo "successfully written to $local_file\n"; // may have to comment this out after testing or may get emailed to you by the cron process
    } else {
    echo "There was a problem while downloading $remote_file to $local_file\n"; // may have to comment this out after testing or may get emailed to you by the cron process
    }

    // close the connection and the file handler
    ftp_close($conn_id);
    fclose($handle);

    // end of php-ftp code



    // grab content os file into array
    $lines = file_get_contents($source);

    // let's get the database open now
    // have to include the configure file
    require('includes/configure.php');

    // include the database functions
    require('includes/functions/database.php');

    // make a connection to the database... now
    tep_db_connect() or die('Unable to connect to database server!');


    // loop through lines in file
    foreach($lines as $line) {

    $items = explode(",",$line); // change the , to whatever your field separator is. Use \t for tab delimited.
    $itemno = $items[0]; // change these numbers to match the order of data received in the file
    $qty = $items[1]; // 0 is the first element, 1 is the second element, etc.
    $cost = $items[2];
    // $another_field = $items[3]; // expand if you need to but you will have to add to the sql statement below


    if ($use_markup == true) { // requires a markup column in the categories table with markeup amount as decimal ( .20 as 20%)
    // get and set markup
    $sql = "select categories.markup from categories,products_to_categories,products where products.products_id = '" . $itemno . "' and products.products_id = products_to_categories.products_id and products_to_categories.categories_id = categories.categories_id";
    $result = mysql_query($sql);
    $markup = mysql_fetch_row($result);
    $price = (int)($cost * (1+$markup[0]))+.99; // go ahead and change the .99 to whatever you want
    $cost = $price;
    }

    // are we going to use MAP pricing? Requires a products_map column in the products table, with a value for map, NULL if no MAP
    if ($use_map == true) {
    $sql = "select products_map from products where products_id = '" . $itemno . "'";
    $result = mysql_query($sql);
    $map = mysql_fetch_row($result);
    if (!(is_null($map[0]))) {
    $cost = $map[0];
    }
    }

    // let's do it
    $sql = "update products set products_quantity = '" . $qty . "', products_price = '" . $cost . "' where products_id = '" . $itemno . "'";
    $result = mysql_query($sql);

    }

    tep_db_close();

    ?>

    over 1 year ago


If you are the project creator or one of the bidders, please Log In for more options.


Awarded Bids

raver Romania
logo-mic.jpg
raver
Romania From Romania     Gold Member     Offline
  US English Level 1 (95%, 71st percentile)
  General Freelancer Orientation (95%, 100th percentile)
  Foundation EUFreelance.com Member
 Accepted
$200 in 2 days 
0
over 1 year ago
5.0

6.2

68 Reviews
90% Completion Rate
I have read and understand this project. Let's discuss in greater detail in the PMB.

All Bids ()

phpcluster India
phpcluster
India From India     Gold Member     Offline
  Freelancer Orientation (85%, 99th percentile)
  Foundation EUFreelance.com Member
$250 in 3 days 
0
over 1 year ago
4.9

5.0

9 Reviews
83% Completion Rate
We are interested to work with you. We have necessary experience for this project. We have highly experienced team for this project. Please check INBOX for more details.
AbrarHassan Pakistan
AbrarHassan
Pakistan From Pakistan     Offline
  General Freelancer Orientation (80%, 90th percentile)
$200 in 3 days 
0
over 1 year ago
5.0

4.8

1 Review
33% Completion Rate
Have read and understand this project. View PM. Thanks.
sumramca India
sumramca
India From India     Offline
  Foundation LimeExchange Member
$250 in 5 days 
0
over 1 year ago
0.0

0.0

1 Review
0% Completion Rate
I have a 5 years of experience in Html,php,mysql,Ajax,smarty.i have worked in oscommerce,magento.zencart,wordpress,Joomla,phpbb,cakephp. I am well qualified for this job and if you accept my bid i know you will be e... more
I have a 5 years of experience in Html,php,mysql,Ajax,smarty.i have worked in oscommerce,magento.zencart,wordpress,Joomla,phpbb,cakephp. I am well qualified for this job and if you accept my bid i know you will be extremely satisfied with the work. This is the oscommerce projects which i have done : https://www.cruzinworld.com/store http://www.sandalstore.co.uk http://www.puremobile.com http://frizbee.co.uk http://krazy-k9s.project-ezy.com/shop http://www.cbgb.com http://www.bellbikes.com/catalog http://alligator-lederwaren.de http://www.mobim8.com http://www.blufone.com http://www.hyperhobbies.com.au http://www.nsihealth.com/store http://cabinetpartsdirect.com/catalog http://www.dcardshop.com http://www.dsicardshop.com http://www.skinbright.com http://www.thompsonoutdoors.com http://seetobelieve.com http://www.tyrashair.com http://tymplates.com/store/ http://signwizard.biz/ http://buypokerchipsets.com/ http://www.mwbilliards.com/ http://www.nacdesigns.co.uk http://www.playballweb.com/ http://hit-equipment.com.au/shop/ http://pacfood.com.au/shop/ http://www.vsom.com/ http://www.tarahydroponics.com/ http://www.1080online.com/ http://www.engraveyourgift.co.uk/ http://www.tarahydroponics.com/ The oscommerce projects with single page checkout: http://thecovet.com (creloaded) http://jassepaintball.storefrontx.com The oscmax projects: http://redefininghealth4u.com The Cre Loaded Oscommerce projects: http://www.canyongear.com http://hanahsflags.com http://thecovet.com The Zencart Projects which i have done so far: http://www.shopmanhattanite.com http://www.salvianoid.com http://www.jerseyvault.com http://www.dreamingpottery.co.nz http://www.easycookoven.co.uk/ http://www.alavastros.gr/vr-jewels/ http://absolutepaintball.net/ http://www.aquariumcenter.net/en/ http://babiesandbabies.com/ http://www.beddingtopstore.com/ http://boardgamesstore.net/ http://campingnfishing.com/ http://www.petapparelfashion.com/ http://thechesssetsstore.com/st/ http://www.totellyhandbags.com/ http://www.kaoud.com/ http://directorschairsnow.com/ http://www.alwaysbaby.com/ The Wordpress Projects which i have done so far: http://marismith.com http://www.shopdisplays.net/ http://reganhr.com/blog/ http://www.thekaiserlawfirm.com http://shamanicwisdom.com/ http://www.shopdisplays.net/ http://www.weeklymenumaker.com/ http://actitudlibre.com This is the Joomla projects which i have done : http://dancestudiowebsite.net/ http://plugyou.com/~hoffman/ The phpbb work i have done so far are: http://www.cursodedropshipping.org/ http://www.worldspace.in/worldspace/forum/viewforum.php?f=3&chn_id=8 The google map work i have done so far are: http://ibmx.net/index.php?mode=bmxtracks http://mixedin.com.au/ http://info.opel.dk less
ecrypt India
ecrypt
India From India     Offline
  Foundation LimeExchange Member
$160 in 30 days 
0
over 1 year ago
i wish to do these project
ashwaniexpert India
ashwaniexpert
India From India     Offline
$250 in 5 days 
0
over 1 year ago
I have done work on such kind of projects . I can do it .
UrmanSoft India
urmansoft.jpg
UrmanSoft
India From India     Offline
  Foundation Freelancer.co.uk Member
$250 in 3 days 
0
over 1 year ago
0.0

0.0

0 Reviews
20% Completion Rate
Plz check the PMB..!!