overkill Posted January 16, 2006 Share Posted January 16, 2006 yuppers Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 16, 2006 Share Posted January 16, 2006 yuppers  How can I create a coupon? Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
mtechama Posted January 16, 2006 Share Posted January 16, 2006 How can I create a coupon?  do I need this contrib. do it http://www.oscommerce.com/community/contri...iscount+Coupons Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 16, 2006 Share Posted January 16, 2006 No, within CCGV there is a section to do this. Do the following  In you admin panel:  Vouchers/Coupons -->Coupon Admin  Click Insert and follow the instructions.  You already did this when you were trying to create a Gift Vouchure. In this section though you put the discount amount as possitive numbers. Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 16, 2006 Share Posted January 16, 2006 ok Discount Coupons: Coupon Name: GIFT25 or GIFT_25  Coupon Description: Whatever you want  Coupon Amount: -25  Coupon Minimum Order: lets say 100.00 or more = 100.00  Uses per Coupon: 1  Uses per Customer: 1  ok on Sending the Voucher by email:  Customer: I know  Subject: like $25 dollars off next order for over $100  Amount: what do I need to put in there?  Message: ?  so instead of -25 now its just 25? Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 16, 2006 Share Posted January 16, 2006 yeah, when you enter in a coupon, you enter it as a possitive number but when it is a vouchure, it should be a negitive number. Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 16, 2006 Share Posted January 16, 2006 yeah, when you enter in a coupon, you enter it as a possitive number but when it is a vouchure, it should be a negitive number.   Well its not working for me. and when I enter a code in the box it automatically generate a code for me when I send an email Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 16, 2006 Share Posted January 16, 2006 Just did a test run on your site and created a coupon that did work for me. Check to see how I created it, don't forget that when a customer is to collect the $5 coupon they must enter it in the payment section and click redeem, it will then show you the same page that you entered in the redeemed coupon and then you click continue. The next page will show the totals less the coupon discount. In my case it was $5. Â You have two things that you need to fix. There has been an error that has been showing up in this forum alot and it showed up on your page. Here is the error when you redeem your coupon. Â Congratulations, you have redeemed ERROR_REDEEMED_AMOUNT_ZERO Â Search the forum for this as I know there are post here on how to fix it. The second thing you should take a look at is your order of how your shipping, subtotal, tax, etc...are showen....you have discount coupon at the very bottom. This does not create an error but does not look right... Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 16, 2006 Share Posted January 16, 2006 Just did a test run on your site and created a coupon that did work for me. Check to see how I created it, don't forget that when a customer is to collect the $5 coupon they must enter it in the payment section and click redeem, it will then show you the same page that you entered in the redeemed coupon and then you click continue. The next page will show the totals less the coupon discount. In my case it was $5. You have two things that you need to fix. There has been an error that has been showing up in this forum alot and it showed up on your page. Here is the error when you redeem your coupon.  Congratulations, you have redeemed ERROR_REDEEMED_AMOUNT_ZERO  Search the forum for this as I know there are post here on how to fix it. The second thing you should take a look at is your order of how your shipping, subtotal, tax, etc...are showen....you have discount coupon at the very bottom. This does not create an error but does not look right...  if you find the forum about this let me know Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
mtechama Posted January 16, 2006 Share Posted January 16, 2006 if you find the forum about this let me know  When I found this contrib http://www.oscommerce.com/community/contri...h,Gift+Vouchers  saw it says "Fix for 'ERROR_REDEEMED_AMOUNT_ZERO' error for COUPON 5.15 and got this error   Fatal error: Cannot instantiate non-existent class: ot_coupon in /home/content/m/t/e/mtechamatest/html/storestest/catalog/includes/classes/order_total.php on line 30 Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 17, 2006 Share Posted January 17, 2006 It wasn't a contribution, it was a forum post that had the fix.... Here is my order_total.php  <?php /* $Id: order_total.php,v 1.3.2.7 2003/05/14 22:52:58 wilt Exp $ orig : order_total.php,v 1.4 2003/02/11 00:04:53 hpdl Exp $  osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com  Copyright © 2003 osCommerce  Released under the GNU General Public License */  class order_total { var $modules;  // class constructor function order_total() { global $language;  if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) { $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED);  reset($this->modules); while (list(, $value) = each($this->modules)) { include(DIR_WS_LANGUAGES . $language . '/modules/order_total/' . $value); include(DIR_WS_MODULES . 'order_total/' . $value);  $class = substr($value, 0, strrpos($value, '.')); $GLOBALS[$class] = new $class; } } }  function process() { $order_total_array = array(); if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $GLOBALS[$class]->process();  for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { $order_total_array[] = array('code' => $GLOBALS[$class]->code, 'title' => $GLOBALS[$class]->output[$i]['title'], 'text' => $GLOBALS[$class]->output[$i]['text'], 'value' => $GLOBALS[$class]->output[$i]['value'], 'sort_order' => $GLOBALS[$class]->sort_order); } } } } }  return $order_total_array; }  function output() { $output_string = ''; if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $size = sizeof($GLOBALS[$class]->output); for ($i=0; $i<$size; $i++) { $output_string .= ' <tr>' . "\n" . ' <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" . ' </tr>'; } } } }  return $output_string; } // ############ Added CCGV Contribution ########## // // This function is called in checkout payment after display of payment methods. It actually calls // two credit class functions. // // use_credit_amount() is normally a checkbox used to decide whether the credit amount should be applied to reduce // the order total. Whether this is a Gift Voucher, or discount coupon or reward points etc. // // The second function called is credit_selection(). This in the credit classes already made is usually a redeem box. // for entering a Gift Voucher number. Note credit classes can decide whether this part is displayed depending on // E.g. a setting in the admin section. // function credit_selection() { $selection_string = ''; $close_string = ''; $credit_class_string = ''; if (MODULE_ORDER_TOTAL_INSTALLED) { $header_string = '<tr>' . "\n"; $header_string .= ' <td><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n"; $header_string .= ' <tr>' . "\n"; $header_string .= ' <td class="main"><b>' . TABLE_HEADING_CREDIT . '</b></td>' . "\n"; $header_string .= ' </tr>' . "\n"; $header_string .= ' </table></td>' . "\n"; $header_string .= ' </tr>' . "\n"; $header_string .= '<tr>' . "\n"; $header_string .= ' <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">' . "\n"; $header_string .= ' <tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">' ."\n"; $header_string .= ' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . "\n"; $header_string .= ' <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n"; $close_string = ' </table></td>'; $close_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $close_string .= '</tr></table></td></tr></table></td>'; $close_string .= '<tr><td width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>'; reset($this->modules); $output_string = '';    while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {  // #################### Begin Added CGV JONYO ###################### //$use_credit_string = $GLOBALS[$class]->use_credit_amount(); // #################### End Added CGV JONYO ######################     if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection(); if ( ($use_credit_string !='' ) || ($selection_string != '') ) { $output_string .= '<tr colspan="4"><td colspan="4" width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>'; $output_string = ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" . ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . ' <td class="main"><b>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string; $output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $output_string .= ' </tr>' . "\n"; $output_string .= $selection_string; }  } } if ($output_string != '') { $output_string = $header_string . $output_string; $output_string .= $close_string; } } return $output_string; } // #################### Begin Added CGV JONYO ###################### function sub_credit_selection(){ $selection_string = ''; $close_string = ''; $credit_class_string = ''; if (MODULE_ORDER_TOTAL_INSTALLED) {  reset($this->modules); $output_string = ''; while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) { $use_credit_string = $GLOBALS[$class]->use_credit_amount(); if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection(); if ( ($use_credit_string !='' ) || ($selection_string != '') ) {  $output_string = /*' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td colspan=2><table border="0" cellpadding="2" cellspacing="0" width="100%"><tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" . ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' .*/ $use_credit_string; $output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $output_string .= ' </tr></table></td><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td></tr>' . "\n"; //$output_string.=$GLOBALS[$class]->use_credit_amount(); //$output_string .= $selection_string; }  } } if ($output_string != '') { //$output_string = $output_string; //$output_string .= $close_string; } } return $output_string; } // #################### End Added CGV JONYO ###################### // if ($selection_string !='') { // $output_string .= '</td>' . "\n"; // $output_string .= $selection_string; // }     // update_credit_account is called in checkout process on a per product basis. It's purpose // is to decide whether each product in the cart should add something to a credit account. // e.g. for the Gift Voucher it checks whether the product is a Gift voucher and then adds the amount // to the Gift Voucher account. // Another use would be to check if the product would give reward points and add these to the points/reward account. // function update_credit_account($i) { if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $GLOBALS[$class]->update_credit_account($i); } } } } // This function is called in checkout confirmation. // It's main use is for credit classes that use the credit_selection() method. This is usually for // entering redeem codes(Gift Vouchers/Discount Coupons). This function is used to validate these codes. // If they are valid then the necessary actions are taken, if not valid we are returned to checkout payment // with an error // function collect_posts() { global $HTTP_POST_VARS,$HTTP_SESSION_VARS; if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $post_var = 'c' . $GLOBALS[$class]->code; // #################### Begin Added CGV JONYO ###################### // if ($HTTP_POST_VARS[$post_var]) $_SESSION[$post_var] = $HTTP_POST_VARS[$post_var]; // if (!tep_session_is_registered($post_var)) tep_session_register($post_var); if ($HTTP_POST_VARS[$post_var]) { if (!tep_session_is_registered($post_var)) tep_session_register($post_var); // ############ Added CCGV Contribution ########## $post_var = $HTTP_POST_VARS[$post_var]; // ############ End Added CCGV Contribution ########## } // #################### End Added CGV JONYO ###################### $GLOBALS[$class]->collect_posts(); }  } } } // pre_confirmation_check is called on checkout confirmation. It's function is to decide whether the // credits available are greater than the order total. If they are then a variable (credit_covers) is set to // true. This is used to bypass the payment method. In other words if the Gift Voucher is more than the order // total, we don't want to go to paypal etc. // function pre_confirmation_check() { // #################### Begin Added CGV JONYO ###################### global $payment, $order, $credit_covers, $customer_id; // #################### End Added CGV JONYO ###################### if (MODULE_ORDER_TOTAL_INSTALLED) {  $total_deductions = 0; reset($this->modules); $order_total = $order->info['total']; while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); $order_total = $this->get_order_total_main($class,$order_total); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $total_deductions = $total_deductions + $GLOBALS[$class]->pre_confirmation_check($order_total); $order_total = $order_total - $GLOBALS[$class]->pre_confirmation_check($order_total); } } // #################### Begin Added CGV JONYO ######################  $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'"); $gv_result=tep_db_fetch_array($gv_query); $gv_payment_amount = $gv_result['amount'];  // if ($order->info['total'] - $total_deductions <= 0 ) { if ($order->info['total'] - $gv_payment_amount <= 0 ) { if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers'); $credit_covers = true; } else{ // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); } // #################### End Added CGV JONYO ###################### } } // this function is called in checkout process. it tests whether a decision was made at checkout payment to use // the credit amount be applied aginst the order. If so some action is taken. E.g. for a Gift voucher the account // is reduced the order total amount. // function apply_credit() { if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $GLOBALS[$class]->apply_credit(); } } } } // Called in checkout process to clear session variables created by each credit class module. // function clear_posts() { global $HTTP_POST_VARS,$HTTP_SESSION_VARS; if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $post_var = 'c' . $GLOBALS[$class]->code; if (tep_session_is_registered($post_var)) tep_session_unregister($post_var); } } } } // Called at various times. This function calulates the total value of the order that the // credit will be appled aginst. This varies depending on whether the credit class applies // to shipping & tax // function get_order_total_main($class, $order_total) { global $credit, $order; // if ($GLOBALS[$class]->include_tax == 'false') $order_total=$order_total-$order->info['tax']; // if ($GLOBALS[$class]->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost']; return $order_total; } // ############ End Added CCGV Contribution ########## } ?> Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 Matt are you using PayPal? Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 17, 2006 Share Posted January 17, 2006 yuppers, I downloaded a contrib called paypal wpp pro or something like that, but this order_total.php I believe was before I installed it. I have a lot of backups and this one should be from when I installed CCGV. Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 (edited) yuppers, I downloaded a contrib called paypal wpp pro or something like that, but this order_total.php I believe was before I installed it. I have a lot of backups and this one should be from when I installed CCGV.   so paypal should work (order_total.php) ? becuase I want to make sure this all works before I put it on my giftshop site and I don't want to miss everything up. you know what I mean?  and I have my shipping and paypal all set up perfectly when I install all this to the giftshop site It shouldn't mess anything up? Edited January 17, 2006 by morrisgiftshop Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 It wasn't a contribution, it was a forum post that had the fix.... Here is my order_total.php <?php /* $Id: order_total.php,v 1.3.2.7 2003/05/14 22:52:58 wilt Exp $ orig : order_total.php,v 1.4 2003/02/11 00:04:53 hpdl Exp $  osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com  Copyright ? 2003 osCommerce  Released under the GNU General Public License */  class order_total { var $modules;  // class constructor function order_total() { global $language;  if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) { $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED);  reset($this->modules); while (list(, $value) = each($this->modules)) { include(DIR_WS_LANGUAGES . $language . '/modules/order_total/' . $value); include(DIR_WS_MODULES . 'order_total/' . $value);  $class = substr($value, 0, strrpos($value, '.')); $GLOBALS[$class] = new $class; } } }  function process() { $order_total_array = array(); if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $GLOBALS[$class]->process();  for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { $order_total_array[] = array('code' => $GLOBALS[$class]->code, 'title' => $GLOBALS[$class]->output[$i]['title'], 'text' => $GLOBALS[$class]->output[$i]['text'], 'value' => $GLOBALS[$class]->output[$i]['value'], 'sort_order' => $GLOBALS[$class]->sort_order); } } } } }  return $order_total_array; }  function output() { $output_string = ''; if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { $size = sizeof($GLOBALS[$class]->output); for ($i=0; $i<$size; $i++) { $output_string .= ' <tr>' . "\n" . ' <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" . ' </tr>'; } } } }  return $output_string; } // ############ Added CCGV Contribution ########## // // This function is called in checkout payment after display of payment methods. It actually calls // two credit class functions. // // use_credit_amount() is normally a checkbox used to decide whether the credit amount should be applied to reduce // the order total. Whether this is a Gift Voucher, or discount coupon or reward points etc. // // The second function called is credit_selection(). This in the credit classes already made is usually a redeem box. // for entering a Gift Voucher number. Note credit classes can decide whether this part is displayed depending on // E.g. a setting in the admin section. // function credit_selection() { $selection_string = ''; $close_string = ''; $credit_class_string = ''; if (MODULE_ORDER_TOTAL_INSTALLED) { $header_string = '<tr>' . "\n"; $header_string .= ' <td><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n"; $header_string .= ' <tr>' . "\n"; $header_string .= ' <td class="main"><b>' . TABLE_HEADING_CREDIT . '</b></td>' . "\n"; $header_string .= ' </tr>' . "\n"; $header_string .= ' </table></td>' . "\n"; $header_string .= ' </tr>' . "\n"; $header_string .= '<tr>' . "\n"; $header_string .= ' <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">' . "\n"; $header_string .= ' <tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">' ."\n"; $header_string .= ' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . "\n"; $header_string .= ' <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n"; $close_string = ' </table></td>'; $close_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $close_string .= '</tr></table></td></tr></table></td>'; $close_string .= '<tr><td width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>'; reset($this->modules); $output_string = '';  while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {  // #################### Begin Added CGV JONYO ###################### //$use_credit_string = $GLOBALS[$class]->use_credit_amount(); // #################### End Added CGV JONYO ###################### if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection(); if ( ($use_credit_string !='' ) || ($selection_string != '') ) { $output_string .= '<tr colspan="4"><td colspan="4" width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>'; $output_string = ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" . ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . ' <td class="main"><b>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string; $output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $output_string .= ' </tr>' . "\n"; $output_string .= $selection_string; }  } } if ($output_string != '') { $output_string = $header_string . $output_string; $output_string .= $close_string; } } return $output_string; } // #################### Begin Added CGV JONYO ###################### function sub_credit_selection(){ $selection_string = ''; $close_string = ''; $credit_class_string = ''; if (MODULE_ORDER_TOTAL_INSTALLED) {  reset($this->modules); $output_string = ''; while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) { $use_credit_string = $GLOBALS[$class]->use_credit_amount(); if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection(); if ( ($use_credit_string !='' ) || ($selection_string != '') ) {  $output_string = /*' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td colspan=2><table border="0" cellpadding="2" cellspacing="0" width="100%"><tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" . ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' .*/ $use_credit_string; $output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>'; $output_string .= ' </tr></table></td><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td></tr>' . "\n"; //$output_string.=$GLOBALS[$class]->use_credit_amount(); //$output_string .= $selection_string; }  } } if ($output_string != '') { //$output_string = $output_string; //$output_string .= $close_string; } } return $output_string; } // #################### End Added CGV JONYO ###################### // if ($selection_string !='') { // $output_string .= '</td>' . "\n"; // $output_string .= $selection_string; // } // update_credit_account is called in checkout process on a per product basis. It's purpose // is to decide whether each product in the cart should add something to a credit account. // e.g. for the Gift Voucher it checks whether the product is a Gift voucher and then adds the amount // to the Gift Voucher account. // Another use would be to check if the product would give reward points and add these to the points/reward account. // function update_credit_account($i) { if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $GLOBALS[$class]->update_credit_account($i); } } } } // This function is called in checkout confirmation. // It's main use is for credit classes that use the credit_selection() method. This is usually for // entering redeem codes(Gift Vouchers/Discount Coupons). This function is used to validate these codes. // If they are valid then the necessary actions are taken, if not valid we are returned to checkout payment // with an error // function collect_posts() { global $HTTP_POST_VARS,$HTTP_SESSION_VARS; if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $post_var = 'c' . $GLOBALS[$class]->code; // #################### Begin Added CGV JONYO ###################### // if ($HTTP_POST_VARS[$post_var]) $_SESSION[$post_var] = $HTTP_POST_VARS[$post_var]; // if (!tep_session_is_registered($post_var)) tep_session_register($post_var); if ($HTTP_POST_VARS[$post_var]) { if (!tep_session_is_registered($post_var)) tep_session_register($post_var); // ############ Added CCGV Contribution ########## $post_var = $HTTP_POST_VARS[$post_var]; // ############ End Added CCGV Contribution ########## } // #################### End Added CGV JONYO ###################### $GLOBALS[$class]->collect_posts(); }  } } } // pre_confirmation_check is called on checkout confirmation. It's function is to decide whether the // credits available are greater than the order total. If they are then a variable (credit_covers) is set to // true. This is used to bypass the payment method. In other words if the Gift Voucher is more than the order // total, we don't want to go to paypal etc. // function pre_confirmation_check() { // #################### Begin Added CGV JONYO ###################### global $payment, $order, $credit_covers, $customer_id; // #################### End Added CGV JONYO ###################### if (MODULE_ORDER_TOTAL_INSTALLED) {  $total_deductions = 0; reset($this->modules); $order_total = $order->info['total']; while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); $order_total = $this->get_order_total_main($class,$order_total); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $total_deductions = $total_deductions + $GLOBALS[$class]->pre_confirmation_check($order_total); $order_total = $order_total - $GLOBALS[$class]->pre_confirmation_check($order_total); } } // #################### Begin Added CGV JONYO ######################  $gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'"); $gv_result=tep_db_fetch_array($gv_query); $gv_payment_amount = $gv_result['amount'];  // if ($order->info['total'] - $total_deductions <= 0 ) { if ($order->info['total'] - $gv_payment_amount <= 0 ) { if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers'); $credit_covers = true; } else{ // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); } // #################### End Added CGV JONYO ###################### } } // this function is called in checkout process. it tests whether a decision was made at checkout payment to use // the credit amount be applied aginst the order. If so some action is taken. E.g. for a Gift voucher the account // is reduced the order total amount. // function apply_credit() { if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $GLOBALS[$class]->apply_credit(); } } } } // Called in checkout process to clear session variables created by each credit class module. // function clear_posts() { global $HTTP_POST_VARS,$HTTP_SESSION_VARS; if (MODULE_ORDER_TOTAL_INSTALLED) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) { $post_var = 'c' . $GLOBALS[$class]->code; if (tep_session_is_registered($post_var)) tep_session_unregister($post_var); } } } } // Called at various times. This function calulates the total value of the order that the // credit will be appled aginst. This varies depending on whether the credit class applies // to shipping & tax // function get_order_total_main($class, $order_total) { global $credit, $order; // if ($GLOBALS[$class]->include_tax == 'false') $order_total=$order_total-$order->info['tax']; // if ($GLOBALS[$class]->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost']; return $order_total; } // ############ End Added CCGV Contribution ########## } ?>    Matt where do I put this total_order.php at? Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 17, 2006 Share Posted January 17, 2006 You should put it in  catalog/includes/classes/order_total.php Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 do I put it in (catalog)/includes/classes/order_total.php? Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 ok got it? when I try to do a check out : I got this error:  Warning: before_process(includes/modules/payment/paypal/classes/osC/osC.class.php): failed to open stream: No such file or directory in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 141  Warning: before_process(): Failed opening 'includes/modules/payment/paypal/classes/osC/osC.class.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 141  Fatal error: Undefined class name 'paypal_osc' in /home/content/m/t/e/mtechamatest/html/catalog/includes/modules/payment/paypal.php on line 142 Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 17, 2006 Share Posted January 17, 2006 check to see if you have this file paypal.php in the directory. Just for a test run, try to use another form of payment and remove the paypal payment Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 Yes Paypal.php is in the directory Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 if my Shipping and PayPal Modules works fine on my Gift Shop Site so the CCGV should work fine my Gift Shop Site Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 17, 2006 Share Posted January 17, 2006 yes as long as you imported the files correctly and made the proper changes Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 yes as long as you imported the files correctly and made the proper changes  like the changes that I made for the test site Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
overkill Posted January 17, 2006 Share Posted January 17, 2006 yes...but before you do that, what you need to do with your live version is BACK-UP BACK-UP BACK-UP BACK-UP BACK-UPBACK-UPBACK-UPBACK-UPBACK-UPBACK-UPBACK-UP..... I can't stress this enough, I have over 37 backups of my catalog directory including the database backup....so make sure you do this Quote Link to comment Share on other sites More sharing options...
mtechama Posted January 17, 2006 Share Posted January 17, 2006 it is backed up Quote Wade Morris Amarillo, Texas  Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.