Support » Plugin: WooCommerce Accepted Payment Methods » Adding other common methods

Viewing 5 replies - 1 through 5 (of 5 total)
  • Well said. We need at least all the standard options from WooCommerce. And logo for all the woocommerce payment options add ons. So, what about it? It’s been two months since the above comment and nothing changed.

    I found out that adding payment options is easily done.
    1. Find the plugin files on your server.
    2. open the images and take their sizes
    3. Find the logos you need online and create for each one two images in the same hight as the existing images.
    4. Upload the images to the image folder on your server and name them in the same way as the existing images.
    5. Open the .php file and look for the lists (there are two) with the payment options.
    6. Copy the last item and paste it below the last one and change the names accordingly.
    7. Edit the css file; look for the list and copy and paste the last one below the list and change the names accordingly.

    Your done.
    Don’t update this plugin in the future or all will be lost 😉

    Plugin Author James Koster

    (@jameskoster)

    Yup, adding new methods is a piece of cake. So why not contribute back?

    https://github.com/jameskoster/woocommerce-accepted-payment-methods

    😉

    I add more methods as I find time.

    With pleasure. I post it here cause gut hub?
    This is the modified part of the css file;

    ul.accepted-payment-methods li.visa span {
      width: 50px;
      background-image: url(../images/visa.png);
    }
    ul.accepted-payment-methods li.ideal span {
      width: 18px;
      background-image: url(../images/ideal.png);
    }
    ul.accepted-payment-methods li.sofort span {
      width: 100px;
      background-image: url(../images/sofort.png);
    }
    ul.accepted-payment-methods li.mister_cash span {
      width: 50px;
      background-image: url(../images/mister_cash.png);
    }
    ul.accepted-payment-methods li.paypal span {
      width: 61px;
      background-image: url(../images/paypal.png);
    }
    ul.accepted-payment-methods li.mastercard span {
      width: 26px;
      background-image: url(../images/mastercard.png);
    }
    ul.accepted-payment-methods li.google span {
      width: 77px;
      background-image: url(../images/google.png);
    }
    ul.accepted-payment-methods li.american-express span {
      width: 18px;
      background-image: url(../images/amex.png);
    }
    @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1) {
      ul.accepted-payment-methods li.visa span {
        background-image: url(../images/visa@x2.png);
        background-size: 50px 16px;
      }
      ul.accepted-payment-methods li.ideal span {
        background-image: url(../images/ideal@x2.png);
        background-size: 19px 16px;
      }
      ul.accepted-payment-methods li.sofort span {
        background-image: url(../images/sofort@x2.png);
        background-size: 30px 16px;
      }
      ul.accepted-payment-methods li.mister_cash span {
        background-image: url(../images/mister_cash@x2.png);
        background-size: 27px 16px;
      }
      ul.accepted-payment-methods li.paypal span {
        background-image: url(../images/paypal@x2.png);
        background-size: 61px 16px;
      }
      ul.accepted-payment-methods li.mastercard span {
        background-image: url(../images/mastercard@x2.png);
        background-size: 26px 16px;
      }
      ul.accepted-payment-methods li.google span {
        background-image: url(../images/google@x2.png);
        background-size: 77px 16px;
      }
      ul.accepted-payment-methods li.american-express span {
        background-image: url(../images/amex@x2.png);
        background-size: 18px 16px;
      }
    }

    This is the modified part off the php file

    array(
    						'name' 		=> __( 'American Express', 'woocommerce-accepted-payment-methods' ),
    						'desc' 		=> __( 'Display the American Express logo', 'woocommerce-accepted-payment-methods' ),
    						'id' 		=> 'wc_apm_american_express',
    						'type' 		=> 'checkbox'
    					),
    					array(
    						'name' 		=> __( 'Google', 'woocommerce-accepted-payment-methods' ),
    						'desc' 		=> __( 'Display the Google logo', 'woocommerce-accepted-payment-methods' ),
    						'id' 		=> 'wc_apm_google',
    						'type' 		=> 'checkbox'
    					),
    					array(
    						'name' 		=> __( 'MasterCard', 'woocommerce-accepted-payment-methods' ),
    						'desc' 		=> __( 'Display the MasterCard logo', 'woocommerce-accepted-payment-methods' ),
    						'id' 		=> 'wc_apm_mastercard',
    						'type' 		=> 'checkbox'
    					),
    					array(
    						'name' 		=> __( 'PayPal', 'woocommerce-accepted-payment-methods' ),
    						'desc' 		=> __( 'Display the PayPal logo', 'woocommerce-accepted-payment-methods' ),
    						'id' 		=> 'wc_apm_paypal',
    						'type' 		=> 'checkbox'
    					),
    					array(
    						'name' 		=> __( 'Visa', 'woocommerce-accepted-payment-methods' ),
    						'desc' 		=> __( 'Display the Visa logo', 'woocommerce-accepted-payment-methods' ),
    						'id' 		=> 'wc_apm_visa',
    						'type' 		=> 'checkbox'
    					),
    					array(
    						'name' 		=> __( 'iDeal', 'woocommerce-accepted-payment-methods' ),
    						'desc' 		=> __( 'Display the iDeal logo', 'woocommerce-accepted-payment-methods' ),
    						'id' 		=> 'wc_apm_ideal',
    						'type' 		=> 'checkbox'
    					),
    					array(
    						'name' 		=> __( 'Sofort', 'woocommerce-accepted-payment-methods' ),
    						'desc' 		=> __( 'Display the Sofort logo', 'woocommerce-accepted-payment-methods' ),
    						'id' 		=> 'wc_apm_sofort',
    						'type' 		=> 'checkbox'
    					),
    					array(
    						'name' 		=> __( 'Mister cash', 'woocommerce-accepted-payment-methods' ),
    						'desc' 		=> __( 'Display the Mister cash logo', 'woocommerce-accepted-payment-methods' ),
    						'id' 		=> 'wc_apm_mister_cash',
    						'type' 		=> 'checkbox'
    					),
    					array( 'type' => 'sectionend', 'id' => 'wc_apm_options' ),
    				);
    
    				// Default options
    				add_option( 'wc_apm_label', '' );
    				add_option( 'wc_apm_american_express', 'no' );
    				add_option( 'wc_apm_google', 'no' );
    				add_option( 'wc_apm_mastercard', 'no' );
    				add_option( 'wc_apm_paypal', 'no' );
    				add_option( 'wc_apm_visa', 'no' );
    				add_option( 'wc_apm_ideal', 'no' );
    				add_option( 'wc_apm_sofort', 'no' );
    				add_option( 'wc_apm_mister_cash', 'no' );
    
    				// Admin
    				add_action( 'woocommerce_settings_image_options_after', array( &$this, 'admin_settings' ), 20);
    				add_action( 'woocommerce_update_options_catalog', array( &$this, 'save_admin_settings' ) );
    				add_action( 'wp_enqueue_scripts', array( &$this, 'setup_styles' ) );
    
    			}
    
    	        /*-----------------------------------------------------------------------------------*/
    			/* Class Functions */
    			/*-----------------------------------------------------------------------------------*/
    
    			function admin_settings() {
    				woocommerce_admin_fields( $this->settings );
    			}
    
    			function save_admin_settings() {
    				woocommerce_update_options( $this->settings );
    			}
    
    			// Setup styles
    			function setup_styles() {
    				wp_enqueue_style( 'apm-styles', plugins_url( '/assets/css/style.css', __FILE__ ) );
    			}
    
    		}
    		$WC_apm = new WC_apm();
    	}
    
    	/**
    	 * Frontend functions
    	 */
    	// Template tag
    	if ( ! function_exists( 'wc_accepted_payment_methods' ) ) {
    		function wc_accepted_payment_methods() {
    			$amex 		= get_option( 'wc_apm_american_express' );
    			$google 	= get_option( 'wc_apm_google' );
    			$mastercard = get_option( 'wc_apm_mastercard' );
    			$paypal 	= get_option( 'wc_apm_paypal' );
    			$visa 		= get_option( 'wc_apm_visa' );
    			$ideal 		= get_option( 'wc_apm_ideal' );
    			$sofort 	= get_option( 'wc_apm_sofort' );
    			$mister_cash 	= get_option( 'wc_apm_mister_cash' );
    
    			// Display
    			echo '<ul class="accepted-payment-methods">';
    				if ( $amex == "yes" ) { echo '<li class="american-express"><span>American Express</span>'; }
    				if ( $google == "yes" ) { echo '<li class="google"><span>Google</span>'; }
    				if ( $mastercard == "yes" ) { echo '<li class="mastercard"><span>MasterCard</span>'; }
    				if ( $paypal == "yes" ) { echo '<li class="paypal"><span>PayPal</span>'; }
    				if ( $visa == "yes" ) { echo '<li class="visa"><span>Visa</span>'; }
    				if ( $ideal == "yes" ) { echo '<li class="ideal"><span>iDeal</span>'; }
    				if ( $sofort == "yes" ) { echo '<li class="sofort"><span>Sofort</span>'; }
    				if ( $mister_cash == "yes" ) { echo '<li class="mister_cash"><span>Mister cash</span>'; }
    			echo '';
    		}
    	}

    [Please post code or markup between backticks or use the code button. Or better still – use a pastebin. Your posted code may now have been permanently damaged/corrupted by the forum’s parser.]

    Plugin Author James Koster

    (@jameskoster)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding other common methods’ is closed to new replies.