Plugin Directory

Changeset 456741


Ignore:
Timestamp:
10/28/2011 03:31:40 PM (14 years ago)
Author:
moshthepitt
Message:

Adding Affiliate Mode

Location:
dukapress/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • dukapress/trunk/js/dukapress.js

    r398899 r456741  
    3131                            }
    3232                });
     33            }
     34            else if (buy_now_present == '3') {
     35                var affiliate_url = jQuery('#dpsc_affiliate_url_'+productId).val();
     36                window.open(affiliate_url,'dp_product_'+productId);
     37                jQuery('div.dpsc_update_icon', jQuery(this)).css('display', 'none');
    3338            }
    3439            else {
  • dukapress/trunk/php/dp-products.php

    r456734 r456741  
    3838        if ($buy_now) {
    3939            $action = 'dpsc_paypal_button';
     40        }
     41        //Dukapress affiliate mode
     42        if ($affiliate) {
     43            $action = 'dpsc_affiliate';
    4044        }
    4145//        if ($direct) {
     
    7680            $dropdown_content .= '</div><div class="clear"></div>';
    7781            $custom_fields_output['dropdown'] = $dropdown_content;
    78             if ($dp_shopping_cart_settings['dp_shop_mode'] != 'inquiry') {
     82            if ($dp_shopping_cart_settings['dp_shop_mode'] != 'inquiry' || !$affiliate) {
    7983                $custom_fields_output['end'] = '<script language="javascript" type="text/javascript">
    8084                var flag=0;var SalePriceLabel1=0; //whether ie or ff
     
    195199            $buy_now_present = '2';
    196200        }
     201        //redirect to Affiliate
     202        if ($affiliate) {
     203            $value_atc = __('Buy Now', "dp-lang");
     204            $buy_now_present = '3';
     205        }
    197206        //Out of stock disabled button
    198207        $disabled_add_to_cart = '';
     
    201210        }
    202211        $custom_fields_output['add_to_cart'] = '<input ' . $disabled_add_to_cart . ' type="submit" class="dpsc_submit_button" id="dpsc_submit_button_' . $product_id . '" name="dpsc_add_to_cart" value="' . $value_atc . '" />';
     212        if ($affiliate) {
     213            if(isset($all_custom_fields['affiliate_url'][0])){
     214                $affiliate_url = $all_custom_fields['affiliate_url'][0];
     215            }
     216            else if(isset($dp_shopping_cart_settings['affiliate_url'])) {
     217                $affiliate_url = $dp_shopping_cart_settings['affiliate_url'];
     218            }
     219            $custom_fields_output['add_to_cart'] .= '<input type="hidden" id="dpsc_affiliate_url_' . $product_id . '" name="dpsc_affiliate_url_' . $product_id . '" value="' . $affiliate_url . '" />';
     220        }
    203221        $custom_fields_output['add_to_cart'] .= '<input type="hidden" id="dpsc_buy_now_button_present_' . $product_id . '" name="dpsc_buy_now_button_present_' . $product_id . '" value="' . $buy_now_present . '" />';
    204222        return $custom_fields_output;
Note: See TracChangeset for help on using the changeset viewer.