Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,268
    Plugin Contributions
    3

    Default New Jrox JAM integration code for 1.3.8

    Just had word that Jrox JAM has obtained (via zencart chaps) the new integration code for 1.3.8.

    PHP Code:
    ------------------------
    // bof JROX integration
    if (isset($zv_orders_id) && (int)$zv_orders_id && isset($order_summary) && is_array($order_summary)) {
      if (!isset(
    $_SESSION['affiliate_order_id']) || $_SESSION['affiliate_order_id'] != $zv_orders_id ) {
          
    $_SESSION['affiliate_order_id'] = $zv_orders_id;
         
    $commissionable_order_formatted number_format($order_summary['commissionable_order'], 2'.''');
         echo 
    '<script language="javascript" type="text/javascript" src="http://www.yourdomain.com/affiliates/sale.php?amount=' $commissionable_order_formatted '&trans_id=' $order_summary['order_number'] . '"></script>';
        }
    }
    // eof JROX integration
    ------------------------- 
    My questions are:-

    1. Does this code perform the same calculation(s) as the old footer integration code - particularly with regard to deducting discounts from the sub total. Here is the relevant line in the old code:-

    PHP Code:
      $commissionable_order = ($order_subtotal $coupon_amount $group_pricing_amount); 
    2. And is it possible to ALSO subtract Gift Certificate amount, which a few of us think is vital to the correct calculation of affiliate commissions:-

    PHP Code:
    $commissionable_order = ($order_subtotal $gv_amount $coupon_amount $group_pricing_amount); 
    If the NEW code can't do (2) above, is it still okay to use the old code?
    20 years a Zencart User

  2. #2
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: New Jrox JAM integration code for 1.3.8

    Wouldnt it be better to contact JAM directly? Since this is THEIR code.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  3. #3
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,268
    Plugin Contributions
    3

    Default Re: New Jrox JAM integration code for 1.3.8

    I've spent most of the morning in the JAM forum asking the same question.


    Here's their Forum Admin response:-


    this is code given to us directly from the folks over at zencart.

    you are welcome to change it, however you see fit.
    20 years a Zencart User

  4. #4
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: New Jrox JAM integration code for 1.3.8

    Quote Originally Posted by schoolboy View Post
    My questions are:-

    1. Does this code perform the same calculation(s) as the old footer integration code - particularly with regard to deducting discounts from the sub total. Here is the relevant line in the old code:-

    PHP Code:
      $commissionable_order = ($order_subtotal $coupon_amount $group_pricing_amount); 
    2. And is it possible to ALSO subtract Gift Certificate amount, which a few of us think is vital to the correct calculation of affiliate commissions:-

    PHP Code:
    $commissionable_order = ($order_subtotal $gv_amount $coupon_amount $group_pricing_amount); 
    If the NEW code can't do (2) above, is it still okay to use the old code?
    The "new" code is based on making use of the code in the bottom of /includes/modules/YOUR_TEMPLATE/checkout_process.php

    Specific to your questions:
    1. is built-in, as described
    2. Gift Certificate amounts are automatically deducted, since they are handled by a credit-class OT module.
    However, if needed, you can customize as desired, using an override of checkout_process.php
    3. Yes, if you don't like the new code, you can use the old code; however, you're using more SQL queries and CPU cycles needlessly.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,268
    Plugin Contributions
    3

    Default Re: New Jrox JAM integration code for 1.3.8

    Thanks a ton doc... I'll stick with the old code for now. Next month I'll put up a test site to see how the new footer code performs!
    20 years a Zencart User

  6. #6
    Join Date
    Feb 2005
    Location
    New Jersey
    Posts
    646
    Plugin Contributions
    0

    Default Re: New Jrox JAM integration code for 1.3.8

    Hi,
    I also have a question concerning Jam. I added the following code to the bottom of my tpl_footer. Is this correct? They do state the code is provided by ZenCart. I am using 1.3.8 but now I am noticing an issue during check out since adding the code. At the last stage of checkout, confirm order, I am getting a warming that the page contains secure and unsecure items. Is this possibly due to the code?

    ##########################################
    ## START JAM INTEGRATION WITH ZEN CART ##
    ## ZC Integration code by DrByte 8/2006 ##
    ##########################################
    if ((int)$orders_id > 0) {
    $JAM = $db->Execute("select class, value from " . TABLE_ORDERS_TOTAL . " where orders_id = '".(int)$orders_id."' AND class in ('ot_coupon', 'ot_subtotal', 'ot_group_pricing')");
    while (!$JAM->EOF) {
    switch ($JAM->fields['class']) {
    case 'ot_subtotal':
    $order_subtotal = $JAM->fields['value'];
    break;
    case 'ot_coupon':
    $coupon_amount = $JAM->fields['value'];
    break;
    case 'ot_group_pricing':
    $group_pricing_amount = $JAM->fields['value'];
    break;
    }
    $JAM->MoveNext();
    }
    $commissionable_order = ($order_subtotal - $coupon_amount - $group_pricing_amount);
    $commissionable_order = number_format($commissionable_order,2,'.','');
    echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://www.mydomain.com/affiliates/sale.php?amount=$commissionable_order&trans_id=$orders_id\"></script></td></tr>

    </table>";
    }
    #######################################
    ## END JAM INTEGRATION WITH ZEN CART ##
    #######################################

    Thanks,
    Kelly

  7. #7
    Join Date
    Feb 2005
    Location
    New Jersey
    Posts
    646
    Plugin Contributions
    0

    Default Re: New Jrox JAM integration code for 1.3.8

    It was it...
    I just changed the src=\"http://www.mydomain.com/affiliates/sale.php?
    to src=\"https://www.mydomain.com/affiliates/sale.php?
    I seems to have fixed the problem...I hope!

    Thanks,
    Kelly

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,268
    Plugin Contributions
    3

    Default Re: New Jrox JAM integration code for 1.3.8

    If changing the "http" to "https" results in no errors, then what you have done should be OK.
    20 years a Zencart User

  9. #9
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: New Jrox JAM integration code for 1.3.8

    Another option is to change:

    from
    src=\"http://www.mydomain.com/affiliates/sale.php?

    to
    src="/affiliates/sale.php?

    That allows your Browser to decide if using an 'https' or 'http' connection.

    You only need to use a full URL (includes the Domain name) when the link is to another site. Then you have to decide if 'https' or 'http' is to be used.

  10. #10
    Join Date
    Feb 2005
    Location
    New Jersey
    Posts
    646
    Plugin Contributions
    0

    Default Re: New Jrox JAM integration code for 1.3.8

    Thanks Rob!! I think that is a much better idea.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. JROX JAM Affiliate program integration
    By eazy in forum All Other Contributions/Addons
    Replies: 15
    Last Post: 27 Jan 2011, 01:07 AM
  2. Jrox JAM integration
    By Berzerk in forum General Questions
    Replies: 8
    Last Post: 11 Jan 2011, 08:09 AM
  3. Jam Jrox integration - can't get it to record
    By jasonk in forum General Questions
    Replies: 29
    Last Post: 26 Sep 2008, 07:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg