Forum Replies Created

Viewing 15 replies - 31 through 45 (of 182 total)
  • Thread Starter Warren

    (@rabbitwordpress)

    Hi @konamiman,

    That’s brilliant, you’re a star, works perfectly now!

    Thanks very much
    Warren

    Thread Starter Warren

    (@rabbitwordpress)

    Hi there,

    So it seems only one echo will work, when I changed it to this:

    if ($bool)
            echo '<div class="vouchers_checkout_message"><h3>How can I get my voucher before Christmas?</h3><p>Royal Mail are currently experiencing long delays, so if you need your voucher to arrive <strong>before Christmas</strong>, we suggest <strong>upgrading to the £4.99 DHL</strong> option which is delivered the next working day after dispatch. Our last shipping date with DHL is <strong>22nd December</strong>.</p></div>';

    it worked perfectly.

    Please let me know if there is a better way of doing this?

    Many thanks
    Warren

    • This reply was modified 3 years, 5 months ago by Warren.
    Thread Starter Warren

    (@rabbitwordpress)

    Hi @monomatic , sadly not, we couldn’t wait and had to switch to the webToffee plugin instead.

    Thread Starter Warren

    (@rabbitwordpress)

    Hi @christian1983,

    Okay thanks, I’ll have a look at that.

    Many thanks
    Warren

    Thread Starter Warren

    (@rabbitwordpress)

    Hi @sangeethasrinivasan,

    Yes it was Wordfence that was blocking your plugin.

    I have learning mode in Wordfence running now and its working perfectly.

    Many thanks
    Warren

    Thread Starter Warren

    (@rabbitwordpress)

    Hi @christian1983 ,

    I’m ok thanks, hope you are too 🙂

    I looked for the PEM file and found the following:

    https://developer.amazon.com/docs/amazon-pay-registration/encryption.html

    I will need some time to work this one out.

    Many thanks
    Warren

    Warren

    (@rabbitwordpress)

    Hi @megi190596,

    Thanks for the link! However I followed the instructions, uploaded …GB.json file and I still get the error:

    Can you help please?

    Many thanks
    Warren

    • This reply was modified 3 years, 6 months ago by Warren.
    Thread Starter Warren

    (@rabbitwordpress)

    Hi @anastas10s,

    Thanks for your reply.

    Here goes:

    Status report is here: https://pastebin.com/Ry0Y9mf3

    PW is:
    RPWYE30BMi

    Its set to burn after 1 read.

    Thanks
    Warren

    Thread Starter Warren

    (@rabbitwordpress)

    Hi Femi,

    I have opened a ticket now. I was unable to upload the entire system report for woocommerce-paypal-payments because in exceed the number of characters, please see attached.

    We have had more customers reporting issues checking out with PayPal today.

    Thanks
    Warren

    Thread Starter Warren

    (@rabbitwordpress)

    Hi @pimwick

    Aaah yes that works perfectly, thanks so much! I actually put it in two places to hide all the notices.

    Here’s the complete code for anyone who might be looking for the same solution:

    // Minimum Spend £24 Except when using Gift Card
    
    add_action( 'woocommerce_check_cart_items', 'required_min_cart_subtotal_amount' );
    function required_min_cart_subtotal_amount() {
        // Only run in the Cart or Checkout pages
       if( is_cart() || is_checkout() ) {
    
            // HERE Set minimum cart total amount
           $min_total = 24;
    
            // Total (before taxes and shipping charges)
           $total = WC()->cart->subtotal;
    
            // Add an error notice is cart total is less than the minimum required
           if( $total <= $min_total  ) {
             if ( defined( 'PWGC_SESSION_KEY' ) ) {
                 $session_data = (array) WC()->session->get( PWGC_SESSION_KEY );
                 if ( isset( $session_data['gift_cards'] ) && count( $session_data['gift_cards'] ) > 0 ) {
                     // Gift cards are in use on this order, bypass the minimum order requirement.
                     return;
                 }
             }
                // Display an error message
               wc_add_notice( '<strong>' . sprintf( __("A minimum total purchase amount of %s is required to checkout."), wc_price($min_total) ) . '<strong>', 'error' );
           }
       }
    }
    /**
     * Set a minimum order amount for checkout
     */
    add_action( 'woocommerce_before_checkout_form', 'wc_minimum_order_amount' );
    add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
    add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
    
    function wc_minimum_order_amount() {
        // Set this variable to specify a minimum order value
        $minimum = 24;
    
        if ( WC()->cart->total < $minimum ) {
    
          if ( defined( 'PWGC_SESSION_KEY' ) ) {
              $session_data = (array) WC()->session->get( PWGC_SESSION_KEY );
              if ( isset( $session_data['gift_cards'] ) && count( $session_data['gift_cards'] ) > 0 ) {
                  // Gift cards are in use on this order, bypass the minimum order requirement.
                  return;
              }
          }
    
    		add_filter( 'wt_show_paypal_express_button_in_cart_page', 'wt_show_paypal_express_button_in_cart_page', 99 );
    		add_filter( 'wt_show_paypal_express_button_in_checkout_page', 'wt_show_paypal_express_button_in_checkout_page', 99 );
            if( is_cart() ) {
    
                wc_print_notice(
                    sprintf( 'Your current order total is only %s.' ,
                        wc_price( WC()->cart->total ),
                        wc_price( $minimum )
                    ), 'error'
                );
    
            } else {
    
                wc_add_notice(
                    sprintf( 'Your current order total is only %s.' ,
                        wc_price( WC()->cart->total ),
                        wc_price( $minimum )
                    ), 'error'
                );
            }
        }
    }
    
    function wt_show_paypal_express_button_in_cart_page($show){
    	$show = false;
    	return $show;
    
    }
    function wt_show_paypal_express_button_in_checkout_page($show){
    	$show = false;
    	return $show;
    
    }
    
    // END Minimum Spend £24 Except when using Gift Card

    Many thanks
    Warren

    • This reply was modified 3 years, 7 months ago by Warren. Reason: Changed the comment to be more descriptive
    Thread Starter Warren

    (@rabbitwordpress)

    Hi @pimwick

    Thanks for the code above!

    I tried it but sadly it caused an error.

    Many thanks
    Warren

    Thread Starter Warren

    (@rabbitwordpress)

    Hi @femiyb

    Thanks for your reply.

    I was unable to send the log privately on the link above, there was no form or method to do so.

    Please see a snapshot below instead:

    2022-10-14T10:47:19+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:47:32+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:47:32+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:48:56+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:48:56+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:49:24+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:49:24+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:50:05+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:50:05+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:50:19+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:50:19+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:50:40+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T10:50:40+00:00 ERROR Failed to retrieve stored webhook data.
    2022-10-14T11:04:33+00:00 DEBUG GET https://api.paypal.com/v1/notifications/webhooks
    Response Debug ID: 3a070ae77f42c
    Response: Array
    (
        [code] => 200
        [message] => OK
    )
    
    2022-10-14T11:04:34+00:00 DEBUG GET https://api.paypal.com/v1/notifications/webhooks
    Response Debug ID: d14a1c9525a09
    Response: Array
    (
        [code] => 200
        [message] => OK
    )

    Many thanks
    Warren

    Thread Starter Warren

    (@rabbitwordpress)

    Hi @aweissinpsyde

    Thanks for your reply. Inspired by your suggestion I managed to move the buttons by creating a new hook in my theme: woocommerce > cart > cart-totals.php like this:

    <?php do_action( 'woocommerce_cart_totals_after_order_total' ); ?>
    
    	</table>
    
      <?php do_action( 'twg_paypal_proceed_to_checkout_buttons' ); ?>

    and then updated the filter like this:

    add_filter('woocommerce_paypal_payments_proceed_to_checkout_button_renderer_hook', function() {
        return 'twg_paypal_proceed_to_checkout_buttons';
    });

    See screenshot:

    https://ibb.co/pQs23Qg

    Hope this helps someone else.

    Please go ahead and mark this as resolved unless you can suggest a simpler/better solution.

    Many thanks
    Warren

    • This reply was modified 3 years, 7 months ago by Warren. Reason: Updated filter
    Thread Starter Warren

    (@rabbitwordpress)

    Hi @femiyb

    Thank you very much for your suggestions and help. I managed to move the buttons up using:

    add_filter('woocommerce_paypal_payments_proceed_to_checkout_button_renderer_hook', function() {
        return 'woocommerce_cart_totals_after_order_total';
    });

    However in doing so they are now positioned above the Subtotal, Delivery and Total table.

    How can I move the PP buttons below this table but above still the Proceed to Checkout (Pay by Card) button? Please see screenshot here https://ibb.co/PmySbjY

    Many thanks
    Warren

    Thread Starter Warren

    (@rabbitwordpress)

    Hi @pimwick thanks for getting back to me.

    At the moment we’re using this filter:

    // Minimum Spend £24 for Nick
    
    add_action( 'woocommerce_check_cart_items', 'required_min_cart_subtotal_amount' );
    function required_min_cart_subtotal_amount() {
        // Only run in the Cart or Checkout pages
       if( is_cart() || is_checkout() ) {
    
            // HERE Set minimum cart total amount
           $min_total = 24;
    
            // Total (before taxes and shipping charges)
           $total = WC()->cart->subtotal;
    
            // Add an error notice is cart total is less than the minimum required
           if( $total <= $min_total  ) {
                // Display an error message
               wc_add_notice( '<strong>' . sprintf( __("A minimum total purchase amount of %s is required to checkout."), wc_price($min_total) ) . '<strong>', 'error' );
           }
       }
    }
    /**
     * Set a minimum order amount for checkout
     */
    add_action( 'woocommerce_before_checkout_form', 'wc_minimum_order_amount' );
    add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
    add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
    
    function wc_minimum_order_amount() {
        // Set this variable to specify a minimum order value
        $minimum = 24;
    
        if ( WC()->cart->total < $minimum ) {
    
    		add_filter( 'wt_show_paypal_express_button_in_cart_page', 'wt_show_paypal_express_button_in_cart_page', 99 );
    		add_filter( 'wt_show_paypal_express_button_in_checkout_page', 'wt_show_paypal_express_button_in_checkout_page', 99 );
            if( is_cart() ) {
    
                wc_print_notice(
                    sprintf( 'Your current order total is only %s.' ,
                        wc_price( WC()->cart->total ),
                        wc_price( $minimum )
                    ), 'error'
                );
    
            } else {
    
                wc_add_notice(
                    sprintf( 'Your current order total is only %s.' ,
                        wc_price( WC()->cart->total ),
                        wc_price( $minimum )
                    ), 'error'
                );
    
            }
        }
    }
    
    function wt_show_paypal_express_button_in_cart_page($show){
    	$show = false;
    	return $show;
    
    }
    function wt_show_paypal_express_button_in_checkout_page($show){
    	$show = false;
    	return $show;
    
    }
    
    // END Minimum Spend £24 for Nick

    However I’ve been looking at alternative solutions since an issue where a user was unable to checkout with a PW gift card code that produced £0.00 total.

    Here are two we looked at today:

    https://ww.wp.xz.cn/plugins/order-minimum-amount-for-woocommerce/

    https://woostify.com/woocommerce-minimum-order/

    We are completely open to suggestions though if you can recommend a better solution!

    Many thanks
    Warren

    • This reply was modified 3 years, 8 months ago by Warren.
Viewing 15 replies - 31 through 45 (of 182 total)