I had the same problem except with add-to-cart.js. Simple solution is to DEQUEUE the woocommerce script and ENQUEUE your replacement. In my case I added the following to my functions.php:
wp_dequeue_script('wc-add-to-cart');
wp_enqueue_script( 'wc-add-to-cart', get_bloginfo( 'stylesheet_directory' ). '/js/add-to-cart-multi.js' , array( 'jquery' ), false, true );
You would want to DEQUEUE the 'wc-add-to-cart-variation' script. I don't think you have to ENQUEUE with the same name, but I couldn't see a reason not to.
Hope this helps.
If you're using WordPress Version 4.0.1 and WooCommerce Version 2.2.10. You can use the following scripts:
wp_deregister_script('wc-add-to-cart');
wp_register_script('wc-add-to-cart', get_bloginfo( 'stylesheet_directory' ). '/js/add-to-cart-multi.js' , array( 'jquery' ), WC_VERSION, TRUE);
wp_enqueue_script('wc-add-to-cart');
It seems there is no override solution to your question. But you can add a brand new payment gateway
simply extending the WC_Payment_Gateway
class, in other words by adding another payment gateway.
Step 1
You can duplicate the file:
plugins/woocommerce/includes/gateways/class-wc-gateway-paypal.php
in your directory theme, change its name for convenience and include it in functions.php:
/* Custom gateway class */
require( get_template_directory() . '/path/to/class-wc-gateway-paypal-custom.php' );
Step 2
This file holds the WC_Gateway_Paypal
class which extends WC_Payment_Gateway
. You can edit this file for your customizations.
Remember to change the name of the extender class:
class WC_Gateway_Paypal_Custom extends WC_Payment_Gateway {
public function __construct() {
$this->id = 'paypal';
$this->icon = apply_filters( 'woocommerce_paypal_icon', WC()->plugin_url() . '/assets/images/icons/paypal.png' );
$this->has_fields = false;
// Change the text in the way you like it
$this->order_button_text = __( 'Proceed to PayPal', 'woocommerce' );
$this->liveurl = 'https://www.paypal.com/cgi-bin/webscr';
$this->testurl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
$this->method_title = __( 'PayPal', 'woocommerce' );
$this->notify_url = WC()->api_request_url( 'WC_Gateway_Paypal' );
}
//other payment gateway stuff
}
Give it a try, let us know if you get stuck! : )
UPDATE 06/13/2014
It's also useful to know that there's a filter that allows you to change the paypal image, so:
function paypal_checkout_icon() {
// pls return the new logo/image URL here
return 'http://www.url.to/your/new/logo.png';
}
add_filter( 'woocommerce_paypal_icon', 'paypal_checkout_icon' );
Best Solution
I was having this same issue. I don't have a need for reviews on my site, so I copied what I wanted to remove from a file inside of the
includes
folder and copied it into myfunctions.php
file like so:Works for me!