Jump to content

Fred

Members
  • Content count

    102
  • Joined

  • Last visited

Posts posted by Fred


  1. 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

     

    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


  2. 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. 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 everyone!

     

    Was just wondering if anyone is able to tell me how to correct the issue where:

     

    a voucher which gives a percentage discount AND has free shipping enabled does not calculate the percentage discount! and only gives the customer free shipping.

     

    Thanks for all your help!

     

    Edwin.

    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. Fred, thanks but I got it fixed thanks to Strider..

     

    as far as posting the entire code, my editor in cpanel doesn't allow me to search lines, to find 292 I have to count each line and I already know that when I do it I never get the correct line. The only way I can search the line is by copy/pasting code into MS Word and have that "goto" the line

     

    if there's a better editor out there, please suggest it as I'm sick and tired of these stupid amp; appearing after every "&" when I edit a page

     

     

    jeff

    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. I just installed this today and it works like a champ except for this error :

     

    Parse error: parse error in /home/graveyar/public_html/create_account.php on line 292

     

    Not sure what line 292 is, but here's my code from that page:

     

    <?php
    /*
    ?$Id: create_account.php,v 1.65 2003/06/09 23:03:54 hpdl Exp $
    
    [snippet]
    
    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

     

    Best I can tell, it has something to do with a "}" or along those lines, but not sure how to fix it..

     

     

    jeff

     

    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. hi all, i have been using this mod for a while and now i want to allow my customers to redeem 3 coupons/vouchers in 1 order. i have made the cosmetic changes to have 3 fields but the first 2 fields are not responding. would anyone care to help?

     

    this is the code i made:

    //multiple redemption code fields

    $selection_string .= "Please enter your coupon/voucher code in the following fields. (One code per field only) " . '<p>';

     

    $selection_string .= TEXT_ENTER_COUPON_CODE . tep_draw_input_field('gv_redeem_code') . '<p>';

    $selection_string .= TEXT_ENTER_COUPON_CODE . tep_draw_input_field('gv_redeem_code') . '<p>';

    $selection_string .= TEXT_ENTER_COUPON_CODE . tep_draw_input_field('gv_redeem_code') . '</td>';

     

    can somebody pls help me with this? i am not familiar with the codes.

     

    i want to have 3 fields for entering the codes but all must be activated by 1 redeem button. and it must accept when any 1 of 3 is filled up and of course not go through when all 3 are empty. i am using Credit Class/Gift Vouchers/Discount Coupons (Version 5.06). please help me with the coding and thanks again!

    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. Hi this is probably a really easy error to solve, but what do i do to fix it?

     

    1146 - Table 'ohmonlineshop.TABLE_COUPON_GV_CUSTOMER' doesn't exist
    
    select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '2'
    
    [TEP STOP]

     

    Thanks in advance :D

    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. you can just post what you have changed here so everyone can take a look

    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. Problem report:

     

    Editing a coupon with coupon admin resets the start/end date of the coupon.? There is some code that tries to retain the old start/end date, but it didn't

    seem to work on my system, so I had to change it to make it work.

    ...

    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. Problem report:

     

    Editing a coupon with coupon admin resets the start/end date of the coupon.  There is some code that tries to retain the old start/end date, but it didn't

    seem to work on my system, so I had to change it to make it work.

     

    I was just wondering if someone else could confirm they had the same problem

    or if I have a install problem.

    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. ...

    Coupons:

     

    Shop-prices of items: all included Tax (this is 16%)

     

    Case - I want to create a coupon lets say of an amount of 10. The job is now to select an item, take that amount and deduct the coupon from that one. Looks like this:

     

    what I want:

     

    ITEM cost 100

    -

    Coupon 10

    Tax included 12,41

    TOTAL to pay: 90

     

    [calc: 100 - 10 = 90

    Tax 90 / 116 * 16 = 12,41]

     

    I come so far that the total is ok. But always the shown tax is either totally wrong or is calculated upon the ITEM price without recognizing the coupon.

     

    SO what should I set in the admin area?

     

    ...

    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


  16. Yep, I checked those settings in the admin...that's not it. Everything else seems to be working perfectly except that the GV and Coupons don't "go away" after checking out.

     

    - Matt

    Are the coupons entered into the redeem track list after you click "Confirm Order"? Please, check table "coupons_redeem_track".

     

    The Authorize.net contribution does it have it's own checkout_processing page? If it has it's own page then the GV/DC-contribution is not processed (tracking, clean up, etc) as expected.

     

    /Fred


  17. I just installed this, and it is working fine, except that nothing on the front end shows up for gift voucher, except in the shopping cart

     

    there is no way to add a gift voucher to the product list

    there is no way to use a gift voucher upon checking out

    there are no gift voucher options at all on the outside of the site, but the admin is working fine it looks like.

    nothing under "my account" either

     

    it shows the gift voucher in the shopping cart, but I can't use it when going to check out.

    OK, i figured out how to get them into the cart and for people to buy them

     

    but it won't let me redeem them when I go to checkout, and there is no heading for gift certificates in account info like it says there should be

     

    any ideas? please....

    Have you activated GV in Admin? Admin | Modules | Order Total -> Set GV Enabled to true.

     

    Then you should see a redeem box in checkout payment page.

     

    /Fred


  18. affiliate_sales.php:

    new:

    ? ?$accept_table = split("[,]" , AFFILIATE_PAYMENT_ORDER_MIN_STATUS);

    ? ?$order_status = $affiliate_sales['orders_status_id']

    ? ?while ($affiliate_sales = tep_db_fetch_array($affiliate_sales_values)) {

    ? ? ?$number_of_sales++;

    ? ? ?if (in_array($order_status, $accept_table)) $sum_of_earnings += $affiliate_sales['affiliate_payment'];

    ? ? ?if (($number_of_sales / 2) == floor($number_of_sales / 2)) {

    ? ? ? ?echo ' ? ? ? ? ?<tr class="productListing-even">';

    ? ? ?} else {

    ? ? ? ?echo ' ? ? ? ? ?<tr class="productListing-odd">';

    ? ? ?}

     

    I am sorry. Of course we need to grab order status within the loop .... it should be

     

    new:
      $accept_table = split("[,]" , AFFILIATE_PAYMENT_ORDER_MIN_STATUS);
      while ($affiliate_sales = tep_db_fetch_array($affiliate_sales_values)) {
        $number_of_sales++;
        $order_status = $affiliate_sales['orders_status_id']
        if (in_array($order_status, $accept_table)) $sum_of_earnings += $affiliate_sales['affiliate_payment'];
        if (($number_of_sales / 2) == floor($number_of_sales / 2)) {
          echo '          <tr class="productListing-even">';
        } else {
          echo '          <tr class="productListing-odd">';
        }


  19. I suggested earlier that we change AFFILIATE_PAYMENT_ORDER_MIN_STATUS not to be a single order status but a comma separeted list of order status. Just status in the comma separated list would generate commission for an affiliate. In order to change that I have identified 6 files to be changed to accomplish that, see below. The changes are minor I think.

     

    I have not had a chance to look at the admin configuration part yet but I guess that is the easy part.

     

    Please let me know what you think of this.

     

    /Fred

     

     

    affiliate_sales.php:
    old:
       while ($affiliate_sales = tep_db_fetch_array($affiliate_sales_values)) {
         $number_of_sales++;
         if ($affiliate_sales['orders_status_id'] >= AFFILIATE_PAYMENT_ORDER_MIN_STATUS) $sum_of_earnings += $affiliate_sales['affiliate_payment'];
         if (($number_of_sales / 2) == floor($number_of_sales / 2)) {
           echo '          <tr class="productListing-even">';
         } else {
           echo '          <tr class="productListing-odd">';
         }
    new:
       $accept_table = split("[,]" , AFFILIATE_PAYMENT_ORDER_MIN_STATUS);
       $order_status = $affiliate_sales['orders_status_id']
       while ($affiliate_sales = tep_db_fetch_array($affiliate_sales_values)) {
         $number_of_sales++;
         if (in_array($order_status, $accept_table)) $sum_of_earnings += $affiliate_sales['affiliate_payment'];
         if (($number_of_sales / 2) == floor($number_of_sales / 2)) {
           echo '          <tr class="productListing-even">';
         } else {
           echo '          <tr class="productListing-odd">';
         }
    
    
    ---
    
    affiliate_summary.php:
    old:
     $affiliate_sales_raw = "
    	 select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a 
    	 left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id) 
    	 where a.affiliate_id = '" . $affiliate_id . "' and o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " 
    	 ";
    new:
     $affiliate_sales_raw = "
    	 select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a 
    	 left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id) 
    	 where a.affiliate_id = '" . $affiliate_id . "' and o.orders_status in (" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . ") 
    	 ";
    
    ---
    
    admin/affiliate_affiliates.php:
    old:
       default:
         if (is_object($aInfo)) {
           $heading[] = array('text' => '<b>' . $aInfo->affiliate_firstname . ' ' . $aInfo->affiliate_lastname . '</b>');
    
           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT, 'selected_box=affiliate&affiliate=' . $aInfo->affiliate_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
    
           $affiliate_sales_raw = "select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id) where o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and  affiliate_id = '" . $aInfo->affiliate_id . "'";
           $affiliate_sales_values = tep_db_query($affiliate_sales_raw);
           $affiliate_sales = tep_db_fetch_array($affiliate_sales_values);
    new:
       default:
         if (is_object($aInfo)) {
           $heading[] = array('text' => '<b>' . $aInfo->affiliate_firstname . ' ' . $aInfo->affiliate_lastname . '</b>');
    
           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE, tep_get_all_get_params(array('acID', 'action')) . 'acID=' . $aInfo->affiliate_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_AFFILIATE_CONTACT, 'selected_box=affiliate&affiliate=' . $aInfo->affiliate_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
    
           $affiliate_sales_raw = "select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id) where o.orders_status in (" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . ") and  affiliate_id = '" . $aInfo->affiliate_id . "'";
           $affiliate_sales_values = tep_db_query($affiliate_sales_raw);
           $affiliate_sales = tep_db_fetch_array($affiliate_sales_values);
    
    ---
    
    admin/affiliate_payment.php:
    old:
    // Select all affiliates who earned enough money since last payment
         $sql="
           SELECT a.affiliate_id, sum(a.affiliate_payment) 
             FROM " . TABLE_AFFILIATE_SALES . " a, " . TABLE_ORDERS . " o 
             WHERE a.affiliate_billing_status != 1 and a.affiliate_orders_id = o.orders_id and o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and a.affiliate_date <= '" . $oldday . "' 
             GROUP by a.affiliate_id 
             having sum(a.affiliate_payment) >= '" . AFFILIATE_THRESHOLD . "'
           ";
    ...
    // Get all orders which are AFFILIATE_BILLING_TIME days old
           $sql="
           SELECT a.affiliate_orders_id 
             FROM " . TABLE_AFFILIATE_SALES . " a, " . TABLE_ORDERS . " o 
             WHERE a.affiliate_billing_status!=1 and a.affiliate_orders_id=o.orders_id and o.orders_status>=" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " and a.affiliate_id='" . $affiliate_payment['affiliate_id'] . "' and a.affiliate_date <= '" . $oldday . "'
           ";
    new:
    // Select all affiliates who earned enough money since last payment
         $sql="
           SELECT a.affiliate_id, sum(a.affiliate_payment) 
             FROM " . TABLE_AFFILIATE_SALES . " a, " . TABLE_ORDERS . " o 
             WHERE a.affiliate_billing_status != 1 and a.affiliate_orders_id = o.orders_id and o.orders_status in (" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . ") and a.affiliate_date <= '" . $oldday . "' 
             GROUP by a.affiliate_id 
             having sum(a.affiliate_payment) >= '" . AFFILIATE_THRESHOLD . "'
           ";
    ...
    // Get all orders which are AFFILIATE_BILLING_TIME days old
           $sql="
           SELECT a.affiliate_orders_id 
             FROM " . TABLE_AFFILIATE_SALES . " a, " . TABLE_ORDERS . " o 
             WHERE a.affiliate_billing_status!=1 and a.affiliate_orders_id=o.orders_id and o.orders_status in (" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . ") and a.affiliate_id='" . $affiliate_payment['affiliate_id'] . "' and a.affiliate_date <= '" . $oldday . "'
           ";
    
    
    ---
    
    admin/affiliate_statistics.php:
    old:
     $affiliate_sales_raw = "
       select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a 
       left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id) 
       where a.affiliate_id = '" . $HTTP_GET_VARS['acID'] . "' and o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . "
       ";
    new:
     $affiliate_sales_raw = "
       select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a 
       left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id=o.orders_id) 
       where a.affiliate_id = '" . $HTTP_GET_VARS['acID'] . "' and o.orders_status in (" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . ")
       ";
    
    
    ---
    
    admin/affiliate_summary.php:
    old:
     $affiliate_sales_raw = "
               select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a 
               left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id = o.orders_id) 
               where o.orders_status >= " . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . " 
               ";
    new:
     $affiliate_sales_raw = "
               select count(*) as count, sum(affiliate_value) as total, sum(affiliate_payment) as payment from " . TABLE_AFFILIATE_SALES . " a 
               left join " . TABLE_ORDERS . " o on (a.affiliate_orders_id = o.orders_id) 
               where o.orders_status in (" . AFFILIATE_PAYMENT_ORDER_MIN_STATUS . ") 
               ";
    ---


  20. ahhhh,

     

    I didn't install oscommerce and thus not kidding.  I know it means you have to install a new table in the database.  The question is how?

     

    Mic

    Use whatever MYSQL Admin DB tool you are most comfortable using ... MySQL CC, PhpMyAdmin, .....

     

    /Fred


  21. Somehow, on my checkout_payment.php page, it is putting up two places to put the coupon code in.  The top one doesn't work and the bottom one does.  How can I eliminate the top one?  I know I have to edit a file somewhere.  But, I just can't figure out which one.  You can see it at

    https://secureform1.dnspropagation.com/~knd...d68e4db9d5e0aaf

    You should only have one redeem box. Take a look at the credit_selection() function in \catalog\includes\modules\order_total\ot_coupon.php, that function generates the redeem box.

     

    /Fred


  22. I loaded the credit class contribution from

    http://www.oscommerce.com/community/contributions,282

     

    I want to use the coupon component, but I don't see any place for the customer to enter the coupon on my site. Can someone describe how this is supposed to work or provide an illustration?

     

    I merged the changes into MS1, if that gives a clue to the problem.

     

     

    -Matt

    Have you activated coupons?

     

    Try Admin | Modules | Order Total | Discount Coupons.

     

    You should then see a redeem box in stage "Payment" of the checkout process.

     

    /Fred


  23. Now this define: define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

     

    I have no idea where this is supposed to be pointing to. My catalog is where most peoples are: jewelrycabin/catalog    (jewelrycabin being the store name). Should I be replacing the /home/oscworks/work/new_oscworks/ with jewelrycabin/catalog ?

     

    As far as the download.php is concerned, this is here: jewelrycabin/catalog/download.php

    On a regular installation of OSC, you have all your catalog files in a a directory called "catalog" in this directory you should have more directories like "admin" and also "download".

     

    The constant DIR_FS_DOWNLOAD in configure.php is supposed to point to the absolut "download" directory. On a typical Win32 installation you would have these constants:

    define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

    define('DIR_FS_CATALOG', 'c:/inetpub/wwwroot/catalog');

    define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

    define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

     

    This means that you have all your catalog-php-files in "c:/inetpub/wwwroot/catalog" and in there you will also have a directory named "download", i.e. it's physical path is "c:/inetpub/wwwroot/catalog/download".

     

    I hope this will get you going.

     

    /Fred


  24. I am feeling pretty dense right now. The define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

    line wasn't there, so I added it. I am not sure what is mean't by adjust to my settings? How should I do this. I have never played with this file before. Any help would be great.

     

    Here is what the code now looks like.

     

    ...

    Please note that you now have the constant DIR_FS_CATALOG defined twice.

     

    define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
    define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

     

    Also note the comment "// * DIR_FS_* = Filesystem directories (local/physical)", this means that all constants starting with "DIR_FS_" are local directories of your server. Make sure you have these directories created and that they are configured correct due to security etc. Use "chmod" or similar on Windows to change the permission.

     

    /Fred


  25. Thanks so much for getting back to me so quickly. I am quite a novice at all of this. Am I supposed to add:

    define('DIR_FS_CATALOG', '/home/oscworks/work/new_oscworks/');

    define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

     

    somewhere? Please let me know where to add those lines or modify the lines that exist to match the lines you have supplied. Thanks again Strider.

     

    The two defines should already be in "\catalog\includes\configure.php" somewhere close to line 33. You need to adjust them to your settings.

     

    /Fred

×