Originally Posted by
aatony
how to add model number in checkout and conformation page,
Adding this to the confirmation page is pretty straightforward.
Which other of the 'checkout' page(s) do you wish this to been seen. If it's the checkout success page then that is a *little* more difficult, but perhaps you are thinking of another page entirely?
Originally Posted by
aatony
,i have spent hours researching this on the forum and google with no results, i took the code from main product page and placed it in the main check out page next to attributes , of coarse nothing happened ,, i have placed different parts of the code in different places in the main cart page with no results,, it seams like it would be a simple task , im missing something somewhere,, can someone help me get it to work?
OK, for the confirmation page.
The file to edit is /includes/templates/YOUR_TEMPLATE/templates/tpl.checkout _confirmation.php
Look for the code that reads like:
Code:
<?php // now loop thru all products to display quantity and price ?>
<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
<tr class="<?php echo $order->products[$i]['rowClass']; ?>">
<td class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
<td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
<?php echo $stock_check[$i]; ?>
Add a new line, so it reads:
Code:
<?php // now loop thru all products to display quantity and price ?>
<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { ?>
<tr class="<?php echo $order->products[$i]['rowClass']; ?>">
<td class="cartQuantity"><?php echo $order->products[$i]['qty']; ?> x</td>
<td class="cartProductDisplay"><?php echo $order->products[$i]['name']; ?>
<?php echo $order->products[$i]['model']; ?>
<?php echo $stock_check[$i]; ?>
You may also wish to place this into its own <td class> for formatting purposes.
Save the file and you're done.
To have this displayed on the checkout success page (where by default they are shown only as part of the 'Please notify me of updates to these products' you need to *either* replicate this loop part of the code and add it to the checkout success page, OR, you could opt to just add the model number to the notification list.
To add it to the notification list you'll need to edit
/includes/modules/pages/account_notifications/header_php.php and modify the search query
Code:
$products_query = "SELECT pd.products_id, pd.products_name
FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd,
" . TABLE_PRODUCTS_NOTIFICATIONS . " pn
WHERE pn.customers_id = :customersID
AND pn.products_id = pd.products_id
AND pd.language_id = :languagesID
ORDER BY pd.products_name";
$products_query = $db->bindVars($products_query, ':customersID',$_SESSION['customer_id'], 'integer');
$products_query = $db->bindVars($products_query, ':languagesID',$_SESSION['languages_id'], 'integer');
$products = $db->Execute($products_query);
while (!$products->EOF) {
$notificationsArray[] = array('counter'=>$counter,
'products_id'=>$products->fields['products_id'],
'products_name'=>$products->fields['products_name']);
$counter++;
$products->MoveNext();
}
... so that it includes the model number. To do this though you'll need to add a 'join' to the query (or create another query) to retrieve the model number from the 'products' table and add this to the $notificationsArray[], either by concating it to one of the exiting fields, or by creating a new field and then making changes to the checkout_success page so that it outputs this additional data field. As I said, its not quite as easy as the change needed for the confirmation page.
Since I'm not sure that this is the actual page you are thinking of though I've left it up to you to fill in the exact detail. :)
Cheers
RodG
Bookmarks