Jump to content

Fred

Members
  • Content count

    102
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Fred
  1. Fred

    NEW! Complete Order Editing Tool!

    I answer my own question in order to help anyone else with the same question. If you add a discount (a negative) order total value the tax calculation will not be correct. At lest in my case with "show prices incl tax" but there is a workaround. You do get the correct tax calculation if you add a "MISC" product to the order. You can then alter the text, model and tax for your discount to fit your need. Hope this will help somebody out there ... /Fred
  2. Fred

    NEW! Complete Order Editing Tool!

    I've read the last 25 pages of this thread but I can't seem to find if this contribution will work with the Ian's GV add-on? If you add a manual discount, i.e. a new order_total row with a negative value, how is the tax affected? What tax class will be used for the discount amount? TIA, Fred
  3. Fred

    HelpDesk For osCommerce

    I've installed this add-on and it seems to work OK in almost all cases (plain text and HTML e-mails) but I have one case where the body is empty ... then it's hard to help the sender ... ;-) The case where helpdesk fetches a blank body is when helpdesk is fetching a HTML mail with a picture from the IMAP server. I've tried this from both Outlook Express and Thundermail with the same result. Has anyone experienced this or got a fix for this? TIA, Fred
  4. Hi Edwin, If I am not wrong, you can not mix percentage discount and free shipping, at least not for the discount coupon part. You have to choose between precentage discount or free shipping NOT both. I think free shipping has higher precedence then precentage discount, that explains why you only get free shipping. /Fred
  5. Jeff, there are quite a few good PHP editors out there, PHPEdit (freeware) etc. I am quite often ending up using Notepad or Wordpad for editing my PHP files. Notepad supports "Goto Line ...". I am sorry for being harsh, that was not my intention. I am glad you solved your matter. /Fred
  6. Please use whatever editor you use and goto line 292. This must be the easiest thing to do by yourself not ment to be a forum matter. This is at least my opinion. Look I am not trying to be rude or anything. Well that said ... I found it's the line before [// ICW - CREDIT CLASS CODE ...], see the code below. It seems like you have other contributions installed but your blocks or bracets seems a little bit of. For example you have two bracets "} }" inside the credit class block which seems not to match up ... please check that. /Fred [LINE 292] } // ICW - CREDIT CLASS CODE BLOCK ADDED ?******************************************************* BEGIN if (NEW_SIGNUP_GIFT_VOUCHER_AMOUNT > 0) { ? $coupon_code = create_coupon_code(); ? $insert_query = tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $coupon_code . "', 'G', '" . NEW_SIGNUP_GIFT_VOUCHER_AMOUNT . "', now())"); ? $insert_id = tep_db_insert_id($insert_query); ? $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $email_address . "', now() )"); ? $email_text .= sprintf(EMAIL_GV_INCENTIVE_HEADER, $currencies->format(NEW_SIGNUP_GIFT_VOUCHER_AMOUNT)) . "\n\n" . ? ? ? ? ? ? ? ? ?sprintf(EMAIL_GV_REDEEM, $coupon_code) . "\n\n" . ? ? ? ? ? ? ? ? ?EMAIL_GV_LINK . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $coupon_code,'NONSSL', false) . ? ? ? ? ? ? ? ? ?"\n\n"; } ?} if (NEW_SIGNUP_DISCOUNT_COUPON != '') { $coupon_code = NEW_SIGNUP_DISCOUNT_COUPON; ? $coupon_query = tep_db_query("select * from " . TABLE_COUPONS . " where coupon_code = '" . $coupon_code . "'"); ? $coupon = tep_db_fetch_array($coupon_query); $coupon_id = $coupon['coupon_id']; ? ? $coupon_desc_query = tep_db_query("select * from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . (int)$languages_id . "'"); ? $coupon_desc = tep_db_fetch_array($coupon_desc_query); ? $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )"); ? $email_text .= EMAIL_COUPON_INCENTIVE_HEADER . ?"\n" . ? ? ? ? ? ? ? ? ?sprintf("%s", $coupon_desc['coupon_description']) ."\n\n" . ? ? ? ? ? ? ? ? ?sprintf(EMAIL_COUPON_REDEEM, $coupon['coupon_code']) . "\n\n" . ? ? ? ? ? ? ? ? ?"\n\n"; } } // ? ?$email_text .= EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; // ICW - CREDIT CLASS CODE BLOCK ADDED ?******************************************************* END
  7. Well, if you look at it as pseudocode - what you've told the module to do is PRINT COUPON REDEEM CODE PRINT COUPON REDEEM CODE PRINT COUPON REDEEM CODE which, if you think about it, is just going to print the coupon redeem code three times. When what you need to be doing is DO GET COUPON REDEEM CODE PRINT COUPON REDEEM CODE UNTIL REDEEM CODE = RETURN CHARACTER At least, thats how it appears to me. David I am afraid that the dc/gv-system is not designed for multiple discount coupons. The reason for this is also a security reason, i.e. a customer may only use one discount coupon for each order. If a customer redeem two different coupons only the last will be "active" and the first one "inactive" so to speak. It's quite some work to do in order to be able to redeem several discount coupons. /Fred
  8. Please, check that you have all configuration in order. It seems like you don't have a TABLE_COUPON_GV_CUSTOMER defined. /Fred
  9. Just a thought, you may have missed some of the steps of the installation procedure. Check that you have the java function "couponpopupWindow" at the top of "catalog\includes\boxes\shopping_cart.php" ... <!-- shopping_cart //--> <script language="javascript"><!-- function couponpopupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re sizable=yes,copyhistory=no,width=450,height=355,screenX=150,screenY=150,top=150,l eft=150') } //--></script> ... /Fred
  10. I've made some changes to the contribution and I would like to tell you about it. As you may have seen Ian had in mind a restriction of coupons like the restrictions on categories and products, there is already a field in the coupon table named "restrict_to_customers". I've implemented restriction of discount coupons to a list of customers just like the restriction to products and/or categories. And the good news is that there is no need to change the database. If you leave this field blank, there is no restriction on customers. In "coupon_admin.php" there is a new field when inserting a new coupon or editing an existing coupon, restrict to customers which is a comma separated list of customers that are valid to use the coupon. I have also changed the class "ot_coupon" in "ot_coupon.php" to calculate credits and tax_deduction etc based on this new restriction rule. I have also added two new files to take care of listing customers etc. So there are 2 amended files and 2 new files required for this change. If someone is interested in this just PM me so we can thoroughly test this before we add this into the contribution. /Fred
  11. The thing is I've posted this before but with no response what so ever ... but here it is again .... In "coupon_admin.php" #1 Change this: if (!$HTTP_POST_VARS['coupon_startdate']) { $coupon_startdate = split("[-]", date('Y-m-d')); } else { $coupon_startdate = split("[-]", $HTTP_POST_VARS['coupon_startdate']); } if (!$HTTP_POST_VARS['coupon_finishdate']) { $coupon_finishdate = split("[-]", date('Y-m-d')); $coupon_finishdate[0] = $coupon_finishdate[0] + 1; } else { $coupon_finishdate = split("[-]", $HTTP_POST_VARS['coupon_finishdate']); } into this: if ($HTTP_GET_VARS['action'] == 'voucheredit') { $coupon_startdate = split("[-]", $coupon['coupon_start_date']); $coupon_finishdate = split("[-]", $coupon['coupon_expire_date']); } else { if (!$HTTP_POST_VARS['coupon_startdate']) { $coupon_startdate = split("[-]", date('Y-m-d')); } else { $coupon_startdate = split("[-]", $HTTP_POST_VARS['coupon_startdate']); } if (!$HTTP_POST_VARS['coupon_finishdate']) { $coupon_finishdate = split("[-]", date('Y-m-d')); $coupon_finishdate[0] = $coupon_finishdate[0] + 1; } else { $coupon_finishdate = split("[-]", $HTTP_POST_VARS['coupon_finishdate']); } } #2 and after: <td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($cc_list['unique_id'] == $cInfo->unique_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . tep_href_link(FILENAME_COUPON_ADMIN, 'page=' . $HTTP_GET_VARS['page'] . '&cid=' . $cc_list['coupon_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> </tr> <?php } ?> add this: <tr> <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $cc_split->display_count($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_COUPONS); ?></td> <td class="smallText" align="right"><?php echo $cc_split->display_links($cc_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'],'action=voucherreport&cid='.$HTTP_GET_VARS['cid']); ?> </td> </tr> </table></td> </tr> /Fred
  12. I've reported this bug some time ago (>3 months) and I've posted a fix for it. It should be in 5.10b I think (I am not sure). /Fred Hi, I just ran an diff on "coupon_admin.php" for 5.10b and my version and they are identical but for two bug fixes I've made. One of the bugs is the one you reported and the other is a fix I made for the voucher report. I.e you can not view the "next 20" redeemed coupons etc. So the fix for start/end date of coupons is not in 5.10b. If you want I can e-mail you my "coupon_admin.php". As I said, it's the same as 5.10b but for the two fixes. /Fred
  13. I've reported this bug some time ago (>3 months) and I've posted a fix for it. It should be in 5.10b I think (I am not sure). /Fred
  14. Anybody having a store with prices including tax or discount coupons with restrictions and having problems with DC/GV contribution? I have found a couple of bugs in "modules/ot_coupon.php" regarding the above case and even cases for shops displaying prices excluding taxes. The thing is that discount coupons with restrictions didn't calculate the discount and tax correct. There were some fundamental bugs in this part. I also fixed some "corrections" to Credit Note, i.e some corrections before was not correct. ;) I have also added a "debug" flag in the class so you can follow the calculation of deduction, tax etc. This is a very nice feature. I am not sure if it's just me or others are having the same issus, so please PM me if you would like to test this modified class. Then when confirmed we can add it to this great contribution! /Fred
  15. Fred

    URGENT Gift Voucher Problems

    Hi Kai, I have also a couple of shops displaying product prices incl. tax (VAT) etc and I noticed this problem a long time ago. I modified ot_coupons.php to fit my case but there are some limitations to it (right now), the tax is calculated wrong for discount coupons where you have restrictions (categories or products). I had a version working smooth in November last year but I was not able to post it due to some tragic events ... then there were some releases of the contribution that made my changes obsolete. I have found some issues/bugs with the current release and I am right now working this for my own case. If you want I can send you the code of ot_coupons.php for you to test. I would like some other part to test it. PM my your mail address. /Fred
×