Jump to content


  • Content count

  • Joined

  • Last visited

Everything posted by Fred

  1. I noticed a while ago that the coupon report in coupon admin did not support more then 20 redeemed coupons, i.e. there was no way to look at the next page of redeemed coupons. This have become a problem for me since I am getting quite a lot of redeemed coupons. I don't think this is implemented in 5.10b so I post a fix for this. I also changed the report to display the latest coupon first (i.e changed the SQL-query sort order). //In admin/coupon_admin.php, find these two lines: switch ($HTTP_GET_VARS['action']) { case 'voucherreport': ... //change the sort order of the SQL query : $cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $HTTP_GET_VARS['cid'] . "' order by redeem_date desc"; ... //after this block <td class="dataTableContent" align="center"><?php echo tep_date_short($cc_list['redeem_date']); ?></td> <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 block - BOF <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> //add this block - EOF Enjoy! /Fred
  2. The GV/DC-contribution and PayPal IPN is not "compatible". PayPal IPN is using it's own checkout process which is "checkout_paypal.php" and the GV/DC-contribution does not update this file etc. A while ago I posted in this thread (I think) a way to merge these two contributions. /Fred
  3. Fred

    Master Products - MS2

    Do you really mean you don't use it?! :P /Fred
  4. Fred

    Master Products - MS2

    I just noticed that there is a missing define (maybe it has already been added): languages/english/product_info.php: define('TEXT_NO_PRODUCTS', 'There are not slave products'); /Fred
  5. Fred


    Is there a way to setup which order statuses an affiliate should get provision from? Maybe this question already have been answered somewere else but I could not find the answer? I noticed the Admin->Configuration->Affiliate->Order Min Status which means that order with statuses greater or equ. to Order Min Status generate provision for affiliates. The thing is that I have a lot of order statuses above 3 (waiting for electronic payment, money order not yet paid, paypal processing, etc) which should not generate provision for affiliates. My 2 cents, why not let you configure Order Statuses like a comma delimited list like "3,5,6,99999" foir which order statuses would generate provision for an affliate. This code can be used to check whether the an order is to generate provision: $status_provision_table = split("[,]" , AFFILIATE_PAYMENT_ORDER_STATUS); if (in_array($order_status, $status_provision_table)) { //the order should generate provision ... tbd } /Fred
  6. Hi Jaleel, the concept of discount coupon and gift voucher are similar but GV's can act as ordinary products in the store and you may buy and give them away. DC's are given away by the store owner itself, they can not be bought. And furthermore GV's may also be sent by mail from a customer to another customer. The store owner may send DC's out to customer(s) via email though. With GV's you have your own GV account with the shop but that is not with DC's. DC's are very similar to coupons in ads in newspapers/magazines/commercials. There are more differences but I hope you have a better idea of what DC's are? /Fred
  7. 1) In the Configuration Box of Admin you have the option "Download" on the left side. Click that link and you will be presented four configuration options, one of them is "Enable download". /Fred
  8. Hi James, I am only using the DC part but there you can define "the minimum order value before the coupon is valid" for a DC. I am not sure if you can do the same thing for a GV? Probably not, since you only define the GV amount at signup and not the GV-id as for DC: " // Set the amount of a Gift Voucher that the new signup will receive, set to 0 for none define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '10'); " /Fred
  9. Fred

    Abandoned Carts

    The PHP manual states that money_format() is ONLY available if your system has strfmon capabilities and Windows don't - even if you have PHP 4.3.4! From the PHP docs: " Note: The function money_format() is only defined if the system has strfmon capabilities. For example, Windows does not, so money_format() is undefined in Windows. " I think we should go with some other formating functions instead of money_format() perhaps number_format()? My 2-cents. /Fred
  10. Hi, I may have an odd case here but I am mainly using the discount part of this contribution and I am having a hard time to get it to calculate things right. I am basically using a this setup in the order total. Sub-Total Discount coupon Tax Shipping Total And I need to show all prices INCL VAT, but I can not simple get it to work OK for all cases (fixed amount, precentage, fixed amount with restriction, precentage with restriction, etc). So I have been busy with testing and analyzing the coupon part lately and I have found some major bugs for some cases. I have not only found the bugs but also changed some of vital function in "modules/order_total/ot_coupon.php" and now I got everything working great! I have searched the forum of GV/DC-threads and noticed that some people had this kind of problem before. I am not sure if they ever got it fixed or just stopped using GV/DC for these cases? Please, let me know if you got it fixed? I would like someone with a similar case to test my changes. /Fred
  11. Hi Naomi, have a look at: languages\english\create_account.php languages\english\gv_send.php /Fred
  12. Hi Jason, now I have some code that is NOT using $_SESSION[] but the code standards we were talking about and it seems to work great. It should be compatible with both PHP <4.0.6 and PHP >=4.0.6 I think. I am using tep_session_xxxx() and $GLOBALS[] instead of $_SESSION[]. I have implemented this throughout the contribution (i.e in both the GV and the DC part) but I have only been able to test it for the DC part (discount coupon). Also the coupon link is displayed right away in the shopping cart when you redeem a code as it should. I have also fixed a bug in the coupon admin code. Now you can edit the Start and End date. There was a bug preventing you from editing the dates at least from seeing the Start and End date. Is it possible for you to test the new code? I do not want to release it before someone can test it and verify that it's OK. /Fred
  13. Fred

    Gift Certificate Auto sends outs GC

    Please check your settings in "catalog\include\add_ccgvdc_application_top.php": /Fred
  14. Thanks for any help you may be able to give. Jamie Hmmm... it seems like the class can not be found, I guess that you may have missed something during installation. Please, check that you have the file "\catalog\includes\modules\order_total\ot_coupon.php". An instance of class ot_coupon is created in "catalog\checkout_payment.php", please check that you have followed the installation for that file. /Fred
  15. Hi Jamie, it seems like you are missing a define for a filename. Do you have a file add_ccgvdc_application_top.php in the admin\include folder? Check that it contains: DEFINE('FILENAME_GV_QUEUE', 'gv_queue.php'); And finally, check that your admin\include\application_top.php contains the line: require(DIR_WS_INCLUDES . 'add_ccgvdc_application_top.php'); /Fred
  16. Yes, I agree with you on backward compatibility. I thought that since the approach taken so far is go with $_SESSION instead of session_xxxx() my idea was to be consistent. You're right that $_SESSION is only available for php 4.06 and above with < 4.06 we can use $HTTP_SESSION_VARS. then we should clean up code like this (from ot_coupon.php): // if (!tep_session_is_registered('cc_id')) tep_session_register('cc_id'); $_SESSION['cc_id'] = $coupon_result['coupon_id']; to globals $cc_id; ... if (!tep_session_is_registered('cc_id')) tep_session_register('cc_id'); $cc_id = $coupon_result['coupon_id']; Of course it's faster to go throught $_SESSION then tep_session() but I think the advantages overweight the disadvantages. Do we all in this group agree on using one of the two approaches, the tep_session() approach? Info from the PHP docs to the rest of the group: /Fred
  17. Inconsistant use of $_SESSIONS and session_register() in gift voucher code. When entering a discount coupon code and then click the redeem button in "checkout_payment.php" the coupon help link should appear in the shopping cart in "checkout_confirm.php" but the link is appearing after you do a refresh on the page due to Inconsistant use of $_SESSIONS and session_register() in gift voucher code. I've found some that there is a mix between the $_SESSIONS and session_register() in the code and we should stick to one of them, preferable $_SESSIONS according to the PHP manual. It explicitly say: since both: classes\order_total.php: modules\order\total\ot_coupon.php: are adopted to the $_SESSION[] approach I changed the following to solve the issue with the couon info link not showing in the shopping cart box after a coupon code was redeemed: in boxex\shopping_cart.php: I changed: if (tep_session_is_registered('gv_id')) { to: $gv_id = $_SESSION['gv_id']; if ($gv_id) { and I changed: if (tep_session_is_registered('cc_id') && $cc_id) { to: $cc_id = $_SESSION['cc_id']; if ($cc_id) { I found more places where we should adopt the $_SESSION[] approach: "gv_redeem.php" and "classes\shopping_cart.php".
  18. Just a small issue, in the popup coupon help window I noticed that not all text is localized in GV 5.03, i.e defined in language files (in this case the text NONE). So I added this to change that. In "popup_coupon_help.php" change: if ($prods=='') $prods = '<br>NONE'; ... if ($cats=='') $cats = '<br>NONE; to: if ($prods=='') $prods = '<br>'.TEXT_COUPON_NONE; //Fix Fred ... if ($cats=='') $cats = '<br>'.TEXT_COUPON_NONE; //Fix Fred Add the following define to "language/YOUR_LANGUAGE/popup_coupon_help.php": define('TEXT_COUPON_NONE', 'NONE'); /Fred
  19. Upps .... I thought I was posting this to the Gift Voucher contribution thread .... sorry /Fred
  20. Just a small issue, in the popup coupon help window I noticed that not all text is localized, i.e defined in language files (in this case the text NONE). So I added this to change that. In "popup_coupon_help.php" change: if ($prods=='') $prods = '<br>NONE'; ... if ($cats=='') $cats = '<br>NONE; to: if ($prods=='') $prods = '<br>'.TEXT_COUPON_NONE; //Fix Fred ... if ($cats=='') $cats = '<br>'.TEXT_COUPON_NONE; //Fix Fred Add the following define to "language/YOUR_LANGUAGE/popup_coupon_help.php": define('TEXT_COUPON_NONE', 'NONE'); /Fred
  21. Hi Marc, make sure that your catalog/include/boxes/shopping_cart.php begin with: <!-- shopping_cart //--> <!-- ICW GV start //--> <script language="javascript"><!-- function couponpopupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resiza ble=yes,copyhistory=no,width=450,height=310,screenX=150,screenY=150,top=150,left= 150') } //--></script> <!-- ICW GV stop //--> I missed to add the java script function when I first installed the GV & CC addon. I hope this will help you, Fred
  22. Hi Ian all the rest, I am trying to get the GV contribution to work with the Paypal IPN (0.971) contribution and could use some ideas from you. My idea is to add the same GV code that you have added to checkout_process.php and checkout_confirmation.php to the Paypal IPN contribution. As you pointed out before, the PayPal IPN contribution use it's own process and confirmation code, which is checkout_paypalipn.php and paypal_notify.php. The things here is that paypal_notify.php is "redirected" from PayPal itself. This means that session vars may be old/deleted etc and you can not trust it's there anymore. My idea then is to update the file checkout_paypalipn.php with the same GV code. The file checkout_paypalipn.php contains code which save an order (with all products and attributes etc) to the database, unregister session vars and redirecting to PayPal. If you update the file checkout_paypalipn.php with: <?php /* $Id: checkout_paypalipn.php,v 0.971 2003-20-02 10:56:31 pablo_pasqualino Exp pablo_pasqualino $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com ... $order_total_modules->update->credit_account($i); ... $order_total_modules->apply_credit(); ... if ($credit_covers) $payment=''; $payment_modules = new payment($payment); $payment_modules->update_status(); $order_total_modules = new order_total; $order_total_modules->collect_posts(); $order_total_modules->pre_confirmation_check(); if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); } if (is_array($payment_modules->modules)) { $payment_modules->pre_confirmation_check(); } ... //unregister session vars $order_total_modules->clear_posts(); ... tep_redirect("https://www.paypal.com/cgi.....") There is one issue (at least) with this and that is if a customer aborts the confirmation at PayPal then the GV and/or DC will be gone since the coupon/GV is marked as redeemed. I guess that if you inform about this then it's ok. Any thoughts about this? All input on this is appreciated. /Fred
  23. Regarding the empty redeem code: If you're email discount coupong from the admin section, I just found in "catalogadmincoupon_admin.php" that wrong field is used. To get it to work: change: $message .= TEXT_VOUCHER_IS . $coupon_result['code'] . "nn"; to: $message .= TEXT_VOUCHER_IS . $coupon_result['coupon_code'] . "nn"; i.e change from field 'code' to 'coupon_code'. /Fred
  24. Which contribution did you install first? Paypal IPN or GV? I am using MS1 and GV with success. Right now I am not using Paypal IPN but I will install it soon (today I think), I will let you know how things are progressing. BTW, I tried to use MS1 and GV module with the Paypal module which is included with MS1, then everything is working smooth. All pages in the checkout process are shown correctly (shipping -> payment -> confirmation -> paypal). /Fred
  25. Maybe a silly suggestion but is the GV module turn on? Please make sure that the GV module is activated in admin/modules/order total. /Fred