• Resolved drdraniel

    (@drdraniel)


    This Plugin is awesome and exactly what I was searching for.
    Just one quick questions/request: how can I change the wording of the buttons and text?
    Instead of “Add to Cart” I would like to change the button wording into: “Add to quote request” but in German, as my Website is in German.

    Also I was wondering why the “Add to Cart” button in the products list under each product disappears as soon as I activate the plugin? I would be great if the button could stay there with a new wording and a field to enter the amount. Means that the customer can add products to the cart without going to the product details page, as it works without the activating your plugin.

    thanks,
    daniel

    https://www.ads-software.com/plugins/woo-rfq-for-woocommerce/

Viewing 9 replies - 16 through 24 (of 24 total)
  • Plugin Author Neah Plugins

    (@gplsaver)

    sorry use this one:

    //product section
        /**
         * Change the add to cart text on single product pages
         */
        add_filter( 'woocommerce_product_single_add_to_cart_text', 'gpls_woo_rfq_cart_button_text' );
    
        function gpls_woo_rfq_cart_button_text() {
    
        	global $woocommerce;
    
        	foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {
        		$_product = $values['data'];
    
        		if( get_the_ID() == $_product->id ) {
        			return __('Already in cart - Add Again?', 'woocommerce');
        		}
        	}
    
        	//return __('Add to cart', 'woocommerce');
        }
    
        /**
         * Change the add to cart text on product archives
         */
        add_filter( 'add_to_cart_text', 'woo_add_to_cart_text_custom_cart_button_text' );
    
        function woo_add_to_cart_text_custom_cart_button_text() {
    
        	global $woocommerce;
    
        	foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {
        		$_product = $values['data'];
    
        		if( get_the_ID() == $_product->id ) {
        			return __('Already in cart - Add Again?', 'woocommerce');
        		}
        	}
    
        	//return __('Add to cart', 'woocommerce');
        }
    
        add_filter( 'woocommerce_product_add_to_cart_text', 'woo_archive_custom_cart_button_text' );
    
        function woo_archive_custom_cart_button_text() {
    
        	global $woocommerce;
    
        	foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {
        		$_product = $values['data'];
    
        		if( get_the_ID() == $_product->id ) {
        			return __('Already in cart', 'woocommerce');
        		}
        	}
    
        	//return __('Add to cart', 'woocommerce');
        }

    Plugin Author Neah Plugins

    (@gplsaver)

    change ‘Already in cart – Add Again?’ to what you need

    Thread Starter drdraniel

    (@drdraniel)

    hm it kind of works, but there is no text when the product is not added to the cart. see here: https://dl.dropboxusercontent.com/u/9028267/shop_problem2.png

    Plugin Author Neah Plugins

    (@gplsaver)

    Ok almost there i think…final attempt

    //product section
        /**
         * Change the add to cart text on single product pages
         */
        add_filter( 'woocommerce_product_single_add_to_cart_text', 'gpls_woo_rfq_cart_button_text' );
    
        function gpls_woo_rfq_cart_button_text() {
    
        	global $woocommerce;
    
        	foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {
        		$_product = $values['data'];
    
        		if( get_the_ID() == $_product->id ) {
        			return __('Already in cart - Add Again?', 'woocommerce');
        		}
        	}
    
        	return __('Add to cart', 'woocommerce');
        }
    
        /**
         * Change the add to cart text on product archives
         */
        add_filter( 'add_to_cart_text', 'woo_add_to_cart_text_custom_cart_button_text' );
    
        function woo_add_to_cart_text_custom_cart_button_text() {
    
        	global $woocommerce;
    
        	foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {
        		$_product = $values['data'];
    
        		if( get_the_ID() == $_product->id ) {
        			return __('Already in cart - Add Again?', 'woocommerce');
        		}
        	}
    
        	return __('Add to cart', 'woocommerce');
        }
    
        add_filter( 'woocommerce_product_add_to_cart_text', 'woo_archive_custom_cart_button_text' );
    
        function woo_archive_custom_cart_button_text() {
    
        	global $woocommerce;
    
        	foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {
        		$_product = $values['data'];
    
        		if( get_the_ID() == $_product->id ) {
        			return __('Already in cart', 'woocommerce');
        		}
        	}
    
        	return __('Add to cart', 'woocommerce');
        }
    Thread Starter drdraniel

    (@drdraniel)

    sorry, me again ??
    It seems like this codes doesn’t work with the new version.
    Maybe it’s easier you add the possibility to change wording within the configuration of the plugin?

    Cheers
    Daniel

    Plugin Author Neah Plugins

    (@gplsaver)

    “sorry , me again”
    Not a problem ??

    It will be easier when we add the text options in the configuration and i am working on it. for now i have tested the following and it works on mine. please try the following. remove your other change wording in your functions.php file and add this

    add_filter( 'woocommerce_product_single_add_to_cart_text', 'gpls_woo_rfq_cart_button_text' ,100);
    	add_filter( 'add_to_cart_text', 'gpls_woo_rfq_cart_button_text',100 );
    	add_filter( 'woocommerce_product_add_to_cart_text', 'gpls_woo_rfq_cart_button_text',100 );
    
        function gpls_woo_rfq_cart_button_text() {
    
        	global $woocommerce;
    
    			 // CHANGE THE TEXT HERE
    	 $in_cart = __('your own Already in cart - Add Again?', 'woocommerce');
    	 $add_to_cart = __('your own Add to cart', 'woocommerce');
    	 // END CHANGE THE TEXT HERE
    
        	foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {
        		$_product = $values['data'];
    
        		if( get_the_ID() == $_product->id ) {
        			return  $in_cart;
        		}
        	}
    
        	return $add_to_cart;
        }
    Plugin Author Neah Plugins

    (@gplsaver)

    two section post
    after you have done the above then add this

    //your own proceed to checkout text
    add_filter('gpls_woo_rfq_proceed_to_checkout','gpls_woo_rfq_proceed_to_checkout',10,1);
    
    function gpls_woo_rfq_proceed_to_checkout($proceed_to_checkout){
    
    	$proceed_to_checkout = "your own proceed to checkout text";
    	return $proceed_to_checkout;
    }
    
    // when you have a RFQ checkout setting
    add_filter('gpls_woo_rfq_rfq_submit_your_order_text','gpls_woo_rfq_rfq_submit_your_order_text',10,1);
    
    function gpls_woo_rfq_rfq_submit_your_order_text($order_button_text){
    
    	$order_button_text = "your own submit QUOTE text ";
    	return $order_button_text;
    }
    
    // when you have a normal checkout setting
    add_filter('gpls_woo_rfq_checkout_submit_your_order_text','gpls_woo_rfq_checkout_submit_your_order_text',10,1);
    
    function gpls_woo_rfq_checkout_submit_your_order_text($order_button_text){
    
    	$order_button_text = "your own submit ORDER text ";
    	return $order_button_text;
    }
    Thread Starter drdraniel

    (@drdraniel)

    yes. perfect!

    Plugin Author Neah Plugins

    (@gplsaver)

    translations can now be done in the settings

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Change Wording’ is closed to new replies.