Plugin Directory

Changeset 1753370


Ignore:
Timestamp:
10/26/2017 04:41:48 PM (8 years ago)
Author:
cardinalmarketing
Message:

Remove CardinalCommerce logo from payment gateway; load card brand logos instead

A responsive CardinalCommerce logo was loading in the payment gatway.
This logo has been removed and replaced with 4 fixed width logos for
Visa, MasterCard, Discover, and Amex. An images folder was added to the
assets directory and populated with popular card brand logos. The
abstract-wc-gateway-cardinalpm.php file was modified to load the 4 logos
mentioned above.

In the future, a decorator pattern should be used to load the logos
dynamically based on the merchant's supported cards as specified in the
plugin settings.

Add changelog and fix jQuery reload bug

  • changelog.txt added to main directory
  • In jquery.cc.songbird.woocomerce.js and ScriptRenderer.php the CardinalCruiseWooCommerce function is saved to the window object instead of the jQuery variable; therefore, if jQuery is reloaded the script doesn't break when the function no longer exists
Location:
cardinalcommerce-oneconnect/trunk
Files:
46 added
3 edited

Legend:

Unmodified
Added
Removed
  • cardinalcommerce-oneconnect/trunk/assets/js/jquery.cc.songbird.woocommerce.js

    r1683582 r1753370  
    2121            bindSubmitButton: cardinalOpts.bindSubmitButton,
    2222            disableSubmitUntilStarted: cardinalOpts.disableSubmitUntilStarted,
    23            
     23
    2424            serverJWT: elements.serverJWT,
    2525            responseJWT: elements.responseJWT,
     
    6666    }
    6767
    68     $.fn.CardinalCruiseWooCommerce = function(opts, configureOpts) {
    69         var form = $(this);
     68    window.CardinalCruiseWooCommerce = function(form, opts, configureOpts) {
     69        var form = $(form);
    7070
    7171        var obj = form.data(CC_WOOCOMMERCE_OBJ);
     
    7878            form.data(CC_WOOCOMMERCE_OBJ, obj);
    7979        }
    80        
     80
    8181        return obj;
    8282    };
  • cardinalcommerce-oneconnect/trunk/includes/abstracts/abstract-wc-gateway-cardinalpm.php

    r1683584 r1753370  
    117117        if ( version_compare( WOOCOMMERCE_VERSION, '2.0.0', '>=' ) ) {
    118118            add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( &$this, 'process_admin_options' ) );
    119         } 
     119        }
    120120        else {
    121121            add_action( 'woocommerce_update_options_payment_gateways', array( &$this, 'process_admin_options' ) );
     
    128128    */
    129129    public function get_icon() {
    130         $icon_html = '<img src="https://www.cardinalcommerce.com/images/logo.png" />';
    131        
     130        $icon_html = '<img src="../wp-content/plugins/cardinalcommerce-oneconnect/assets/images/card-visa.svg" width="40" height="25" style="width: 40px; height: 25px;" />
     131        <img src="../wp-content/plugins/cardinalcommerce-oneconnect/assets/images/card-mastercard.svg" width="40" height="25" style="width: 40px; height: 25px;" />
     132        <img src="../wp-content/plugins/cardinalcommerce-oneconnect/assets/images/card-discover.svg" width="40" height="25" style="width: 40px; height: 25px;" />
     133        <img src="../wp-content/plugins/cardinalcommerce-oneconnect/assets/images/card-amex.svg" width="40" height="25" style="width: 40px; height: 25px;" />
     134        ';
     135
    132136        return apply_filters( 'woocommerce_gateway_icon', $icon_html, $this->id );
    133137    }
     
    159163
    160164    protected function cardinal_admin_options() {
    161         ?><h3><?php _e( 'Cardinal Processor Module', 'wc-cardinalprocessormodule'); ?></h3><?php 
     165        ?><h3><?php _e( 'Cardinal Processor Module', 'wc-cardinalprocessormodule'); ?></h3><?php
    162166
    163167        $apiCreds = $this->_settings->getAPICredentials();
  • cardinalcommerce-oneconnect/trunk/php-src/CardinalCommerce/Payments/Carts/WooCommerce/Songbird/ScriptRenderer.php

    r1683585 r1753370  
    6666        var form = $("{{form_sel}}");
    6767
    68         $(form).CardinalCruiseWooCommerce({{opts}}, {{configureOpts}});
     68        window.CardinalCruiseWooCommerce(form, {{opts}}, {{configureOpts}});
    6969    });
    7070}(window.jQuery));
Note: See TracChangeset for help on using the changeset viewer.