• Resolved Lois

    (@loiscr)


    Hello, thank you very much, it is a great plugin.

    How could I show the [minimum] fee at checkout?

    With the plugin we can show the values ??of [PERCENT_AMOUNT] or [FIXED_AMOUNT] but we cannot put [MINIMUM] to indicate that the fee will have a minimum amount of €3, for example, even though the percentage is €1.22.

    Thanks!!!`

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Karolina Vyskocilova

    (@vyskoczilova)

    Hi,
    interesting idea ??

    I’ve added two placeholders [MINIMUM_AMOUNT] and [MAXIMUM_AMOUNT] and made it ready in 2.1.5-rc.1 version. Could you download and test it out and let me know?

    If everything will work fine, I’ll release it as regular version

    Best regards
    Karolína

    Thread Starter Lois

    (@loiscr)

    Great!!! I will try and tell you. Thanks a lot!!!

    Thread Starter Lois

    (@loiscr)

    Well, I just tried it right now and it works.

    Replaces the text [MINIMUM_AMOUNT] the other placeholders correctly but in the item breakdown of the purchase, just before the order total.

    However, it does not replace these new placeholders (nor the old ones) in the explanation of the payment method selector.

    I don’t know if this is correct or not. It may be a failure of my website since I am doing local tests to update a site that has not been updated for 4 years and maybe there is something wrong.

    Should the placeholders in the “description” field of the payment method selector also be replaced?

    Thanks!!!`

    Plugin Author Karolina Vyskocilova

    (@vyskoczilova)

    Nope, just in the Fee title.

    Thread Starter Lois

    (@loiscr)

    oh ok I understand

    I think it would be very interesting if placeholders could also be used in the description.

    I suppose it would not be a very difficult improvement to implement. But I don’t know, I just guess. You are the expert.
    It would be nice for an update in the future.

    Thank you so much for everything!!!

    Plugin Author Karolina Vyskocilova

    (@vyskoczilova)

    Yeah, maybe, but it’s not as easy as it might look – like this I’m manipulating the setting I’m adding not the others.

    You’re welcome. If I could ask you for a favor, leave me a five star review ??

    Thread Starter Lois

    (@loiscr)

    I just found that a few years ago I programmed it like this and it worked for years:

    add_action('woocommerce_add_order_fee_meta','sustituir_expr_payforpayment', 10, 4);
    	function sustituir_expr_payforpayment($order_id, $item_id, $fee, $fee_key){
    		
    		global $woocommerce;
    		
    		if(
    			! (strpos( $fee->name, '[FIXED_AMOUNT]') === FALSE)
    			|| ! (strpos( $fee->name, '[PERCENT_AMOUNT]') === FALSE)
    			|| ! (strpos( $fee->name, '[MINIMO]') === FALSE)
    			|| ! (strpos( $fee->name, '[enlace+info]') === FALSE)
    		){
    			
    			//veo si tengo todas las variables de pago que necesito para calcular el nuevo nombre
    			$metodo_elegido = $woocommerce->session->chosen_payment_method;
    			$pasarelas_disponibles = $woocommerce->payment_gateways->get_available_payment_gateways();
    			
    			if( empty($metodo_elegido) || empty($pasarelas_disponibles) )
    			return;
    			
    			if( !isset($pasarelas_disponibles[$metodo_elegido]->settings['pay4pay_item_title']) ) //para comprobar que esta instalado el plugin y que existe el array de datos necesarios
    			return;
    		
    			//calculamos el nuevo nombre con sustiticiones
    			$nuevo_nombre_fee = str_replace( 
    				array('[FIXED_AMOUNT]','[PERCENT_AMOUNT]', '[MINIMO]', '[enlace+info]' ) , 
    				array(
    					strip_tags( wc_price( $pasarelas_disponibles[$metodo_elegido]->settings['pay4pay_charges_fixed'] ) ) , 
    					str_replace('.', ',', $pasarelas_disponibles[$metodo_elegido]->settings['pay4pay_charges_percentage'] ),
    					str_replace('.', ',', $pasarelas_disponibles[$metodo_elegido]->settings['pay4pay_charges_minimum'] ) ,
    					''
    				),
    				$fee->name );
    			
    			//modificamos el titulo del fee en el carro o pedido
    			$args = array("name"	=>	$nuevo_nombre_fee);
    			$order = new WC_Order($order_id);
    			$order->update_fee( $item_id, $args );
    			
    		}
    		
    	}

    The problem is that this hook is already deprecated and doesn’t work now.

    I think you just have to look for the new hook but I haven’t programmed for a long time and I can’t find it.

    Yes, right now I will leave you 5 stars. Thanks!!

    Plugin Author Karolina Vyskocilova

    (@vyskoczilova)

    Wow, thanks. I’ll have a look and thanks for the review ??

    Thread Starter Lois

    (@loiscr)

    Thank you.

    It would be great if you could fix it and implement this function in your plugin.

    [link+info] was a placeholder I made up so that I could add a link for people who wanted more information. Then people click on the link and a “_blank” window opens with the detailed explanation of the payment method and calculation of the fee.

    It was like this: “this method has an amount of 1.5% with a minimum of €1 click here for +info”

    Thanks!!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Display de minimun amount’ is closed to new replies.