Guest Posted May 13, 2003 Posted May 13, 2003 Since I use quantity discounts I needed to have the shopping_cart.php page show the unit price instead of just the product name and total for multiple quantities. Since this is far too simple to add as a contribution I figured I would just put it here. :? In catalog/includes/languages/english/shopping_cart.php add the define: define('TABLE_HEADING_EACH', 'Price Each'); In catalog/includes/modules/order_details.php find this: echo '<td align="right" class="tableHeading">' . TABLE_HEADING_TOTAL . '</td>'; Add this just before it: if (strstr($PHP_SELF, FILENAME_SHOPPING_CART)) { $colspan++; echo '<td align="right" class="tableHeading">' . TABLE_HEADING_EACH . '</td>'; } Find this: // Tax (not in shopping cart, tax rate may be unknown) if (!strstr($PHP_SELF, FILENAME_SHOPPING_CART)) { echo ' <td align="center" valign="top" class="main">' . number_format($products[$i]['tax'], TAX_DECIMAL_PLACES) . '%</td>' . "n"; } Add this right after: // Product Each Price if (strstr($PHP_SELF, FILENAME_SHOPPING_CART)) { echo ' <td align="right" valign="top" class="main"><b>' . $currencies->display_price($products[$i]['price'], $products[$i]['tax']) . '</b>' . "n"; } This works great with the Staffelpreis/quantity discounts which shows the proper unit price if the quantity is changed. Screenshots:
hijinx Posted June 4, 2003 Posted June 4, 2003 Very cool. Thanks for the tip. My customer will love it! :D
emiliano Posted June 11, 2003 Posted June 11, 2003 now it?s time to add admin control to this... give me a week to work it out.. patagonia, argentina
Guest Posted July 23, 2003 Posted July 23, 2003 Updated codes for newer snapshots that no longer have the file order_details.php :D : In catalog/includes/languages/english/shopping_cart.php add the define: define('TABLE_HEADING_EACH', 'Price Each'); In catalog/shopping_cart.php find this around line 70: $info_box_contents[0][] = array('align' => 'center', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_QUANTITY); Add this right after: $info_box_contents[0][] = array('align' => 'right', 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_EACH); Next in catalog/shopping_cart.php find this around line 148: $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="top"', 'text' => tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id'])); Add this right after: $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="top"', 'text' => '<b>' . $currencies->display_price($products[$i]['price'], tep_get_tax_rate($products[$i]['tax_class_id'])) . '</b>'); HTH
aryo1 Posted November 9, 2005 Posted November 9, 2005 Since I use quantity discounts I needed to have the shopping_cart.php page show the unit price instead of just the product name and total for multiple quantities. Since this is far too simple to add as a contribution I figured I would just put it here. :? In catalog/includes/languages/english/shopping_cart.php add the define: define('TABLE_HEADING_EACH', 'Price Each'); In catalog/includes/modules/order_details.php find this: ?echo '<td align="right" class="tableHeading">' . TABLE_HEADING_TOTAL . '</td>'; Add this just before it: ?if (strstr($PHP_SELF, FILENAME_SHOPPING_CART)) { ? ?$colspan++; ?echo '<td align="right" class="tableHeading">' . TABLE_HEADING_EACH . '</td>'; ?} Find this: // Tax (not in shopping cart, tax rate may be unknown) ?if (!strstr($PHP_SELF, FILENAME_SHOPPING_CART)) { ? ?echo ' ? ?<td align="center" valign="top" class="main">' . number_format($products[$i]['tax'], TAX_DECIMAL_PLACES) . '%</td>' . "n"; ?} Add this right after: // Product Each Price ?if (strstr($PHP_SELF, FILENAME_SHOPPING_CART)) { ? ?echo ' ? ?<td align="right" valign="top" class="main"><b>' . $currencies->display_price($products[$i]['price'], $products[$i]['tax']) . '</b>' . "n"; ?} This works great with the Staffelpreis/quantity discounts which shows the proper unit price if the quantity is changed. Screenshots: ;) I dont have this file in my directory: In catalog/includes/modules/order_details.php !!!
dpwilt Posted November 26, 2005 Posted November 26, 2005 ;) I dont have this file in my directory:In catalog/includes/modules/order_details.php !!! Same here????
Recommended Posts
Archived
This topic is now archived and is closed to further replies.