You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Pages: 1
I've created two custom columns in the products table that I need to be displayed in the order email that gets sent out to the shipper. I'm slightly overwhelmed by there being 5 different ordersummary php files and not knowing what the proper CCP7 way of calling something from the database would be.
Thanks in advance.
Offline
First you would need to make an edit to the ECOM_Cart/ECOM_Cart.PHP in the function build_item to get your culumns in the order items array ( the array that is built is at the end of the function). Once you done that then you can pull the information in the order summary.
John
Offline
I was running a test to see if I could properly pass data onto the email. I put a bit of test data into the array and tried to call it in the productsummary.php (also productsummaryxhtml.php)...aaand nothing happens. So I tried print_r just to see if it was even able to access the array and it printed the entire array correctly, including the test data I put into the array. Yet when I try to specifically call on the test data, nothing happens. I tried calling on the product ID in the same array and still nothing.
Any ideas why this is happening?
To go over exactly what I'm trying to do, there's an alternative vendor name and vendor price for each product that I need to be mailed out via the shipper email.
Last edited by JDLS88 (08-15-2011 12:23:59)
Offline
Not knowing where (exact place in the script) and how you tried to call the information, and or what your array looks like then one can only guess that your not calling it correctly.
Within the standard ordersummaryxhtml.php script there would be this section
// +-- // | Print our item information cell. // +-- if ($ship_type != 'NOTSHIPPED') {print '<td class="regtable" style="width: 50%">' . $eol;} elseif ($ship_count == 0) {print '<td class="regtable" style="width: 100%">' . $eol;} else {print '<td class="regtable" style="width: 100%" colspan="2">' . $eol;} foreach ($ship_items as $key_num => $item_num) { foreach ($order['items'] as $num => $item) {
If your within the last foreach statement then the call should be something like (your_data = new column)
print $item['your_data'];
but this is a guess at this time since I don't know your exact array.
John
Offline
Here's what I've got:
I used some text as test values for the array to see if I could properly pass them through (around line 1537):
// +-- // | Formulate the item. // +-- $item = array('randid' => $this->random_key(12), 'id' => $product['id'], 'quantity' => $quantity, 'name' => $product['name'], 'number' => $product['prodnum'], 'imgsm' => $product['imgsm'], 'prodinv' => $product['useinv'], 'optdisp' => $optnamevals, 'optselids' => $optselids, 'optids' => $optids, 'optinv' => $optinv, 'dlfiles' => $dlfiles, 'delmethod' => $product['delmethod'], 'sinshipinfo' => $sinshipinfo, 'shipemail' => $shipemail, 'sinprodprice' => $sinprodprice, 'sinoptprice' => $sinoptprice, 'sinaffcomm' => $sinaffcomm, 'taxinfo' => $taxinfo, 'subtotal' => $subtotal, 'subtotalrec' => $subtotalrec, 'url' => $url, 'vendorname' => "vendor name test", 'vendorprice' => "vendor price test", 'addemtext' => $product['addemtext']);
And where I'm calling it...around line 513 in ordersummaryxhtml:
// +--
// | Print the item name.
// +--
if ($shownums) {$name = $item['itemnum'] . ' - ' . $item['itemname'];}
else {$name = $item['itemname'];}
$name = $this->xhtml_encode($name);
$quan = $this->xhtml_encode($item['itemquan']);
print '<p class="strong">' . $name . '</p>' . $eol;
print 'Vendor Name:' . $item['vendorname'];
print 'Vendor Price:' . $item['vendorprice'];
The result is sadly nothing.
Last edited by JDLS88 (08-18-2011 10:29:36)
Offline
You've definately been chatting with the correct guy about this. Jon is probably pretty busy, but if he was sitting there next to you see exactly what you were trying to do I'd bet he'd have the answer right off the top of his head.
Offline
In looking at a array off my site try printing the inforamtion (from the same place you said you where trying form) like:
print 'Vendor Name:' . $item['cartdata']['vendorname']; print 'Vendor Price:' . $item['cartdata']['vendorprice'];
John
Offline
Pages: 1