Jump to content

bobdabuilder

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bobdabuilder's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey bud this is a basic one that i have come across. http://www.phpwebcommerce.com/ hope you find it use full.
  2. some open source E commerce Solutions are http://virtuemart.net/ http://www.magentocommerce.com/ http://www.zen-cart.com/ http://www.oscommerce.com/ I am no php guru but i see no point in reinventing the wheel. Good Luck
  3. Hi all hope some one can give me some insight. OK i am running VirtueMart and trying to send purchase order emails with attached pdfs. Using TCPDF & FPDI to import a template and generate the pdf. The creation and attaching works fine but.. I am running in to some trouble with trying to use a foreach loop to loop through array and add pages to the pdf. Dont know if i am totally on the wrong path or if i need to make a class or some thing Here is my code <?php require_once( CLASSPATH .'opdf/tcpdf.php'); require_once( CLASSPATH .'opdf/fpdi.php'); //start pdf buffer ->Stops white space from beign send to browser ob_start(); //Creating PDF $prodIds = array(); while($dboi->next_record()) { $my_qty = $dboi->f("product_quantity"); $prodId = $dboi->f("product_id"); $prodPid = $dboi->f("product_parent_id"); $prodName = $dboi->f("product_name"); $attr = trim($dboi->f("product_attribute")); // Get a list of the parent product ids $prodIds[$prodPid]['id'] = $prodId; $prodIds[$prodPid]['name'] = $prodName; $prodIds[$prodPid]['items'][$attr]['attr'] = $attr; $prodIds[$prodPid]['items'][$attr]['qty'] = $my_qty; } // initiate FPDI $pdf =& new FPDI('L','mm','A4'); //Loop using parent ids foreach($prodIds as $prod) { // no header or footer $pdf->SetPrintHeader(false); $pdf->SetPrintFooter(false); // add a page $pdf->AddPage(); // set the sourcefile $pdf->setSourceFile( CLASSPATH .'opdf/conform.pdf'); // import page 1 $tplIdx = $pdf->importPage(1); // use the imported page and place it at point origin with a A4 width $pdf->useTemplate($tplIdx, 0, 0, 297); // now write some text above the imported page //Contact $pdfcontact = $dbbt->f('first_name').' '.$dbbt->f('last_name'); $pdf->SetFont('freesans'); $pdf->SetTextColor(0,0,0); $pdf->SetXY(23, 21); $pdf->Write(0, $pdfcontact); //JobNo $pdforder = $_SESSION['auth']['username'].' - '. $order_id; $pdf->SetFont('freesans'); $pdf->SetTextColor(0,0,0); $pdf->SetXY(88, 21); $pdf->Write(0, $pdforder); //DeliveryDate $pdf->SetFont('freesans'); $pdf->SetTextColor(0,0,0); $pdf->SetXY(118, 21); $pdf->Write(0, $del_date); // Image example $pdfimage = IMAGEPATH."product/".$dboi->f("product_full_image"); $pdf->Image($pdfimage, 0, 40, 0, 0, '', '', '', false, 72, 'C'); } //Close and output PDF document $pdf->Output(); //clean pdf buffer ->Stops white space from beign send to browser ob_end_clean(); ?> When i have the foreach loop in i get a blank pdf attached. Any help will be greatly appreciated.
  4. Hey all I am new to php and jumped in to the deep end. If some one can just direct me to some tutorials (tell me i am mad that will help to), or tell me how to go about it it will be much appreciated. ok i followed the tutorial on http://www.phpwebcommerce.com/index.php and got every thing working. What i want now is to have a drop down box with a list of customers to enable them to login to their unique shopping pages. so basically have a bunch of different product unique to a client. Any help or ideas will be appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.