baras
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce Square] Apple Pay + WooCommerce SubscriptionsUnderstood ☹
Thanks for the information @jricketts4 .
I see that you guys did implement Apple Pay + Subscriptions with other payment processors
(See your answer here).
We would be very happy to see the same implemented with the Square digital wallets.
For any solution you end up providing, please consider supporting All Products for WooCommerce Subscriptions as well.
Thanks again,
me.Forum: Plugins
In reply to: [WooCommerce] Coupon is invalid after failed payment attemptHi,
My best solution so far is to remove the coupon usage from the database.
/** * Executed when the status is changed to failed. * * @param int $order_id * @param \WC_Order $order */ function ladida_woocommerce_order_status_failed( $order_id, $order ) { global $wpdb; foreach ( $order->get_coupon_codes() as $coupon_code ) { $coupon_object = new WC_Coupon( $coupon_code ); $sql = "DELETE FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_value = %d LIMIT 1;"; $wpdb->query( $wpdb->prepare( $sql, $coupon_object->get_id(), $order->get_user_id() ) ); $sql = "DELETE FROM {$wpdb->prefix}wc_order_coupon_lookup WHERE order_id = %d AND coupon_id = %d LIMIT 1;"; $wpdb->query( $wpdb->prepare( $sql, $order->get_id(), $coupon_object->get_id() ) ); } } add_action( 'woocommerce_order_status_failed', 'ladida_woocommerce_order_status_failed', 15, 2 );This works well most of the time, however sometimes, if I continue to other pages and attempt checkout again, the usage returns to the database somehow.
Any input on how that might happen?
Thanks!
Forum: Plugins
In reply to: [WooCommerce] WooCommerce Square requires a postal codeTurns out this field gets auto-populated by JS.
So all I had to do was hide it.Hi Adam,
Good answer, I was looking for the same hook.
Worked perfectly.
Thank you!There is a redundant condition here, in PHP a variable is considered empty if it does not exist:
if ( ! isset( $response[ 'success' ] ) || empty( $response[ 'success' ] ) ) {This would be the same but slightly faster:
if ( empty( $response[ 'success' ] ) ) {Forum: Plugins
In reply to: [Social Media Widget by Acurax] PHP 7.2 and 7.3 not supportedIn case anyone is interested, the problem for us wasn’t the PHP version.
7.3 works, no problem.There was an invalid value for the ‘social_widget_icon_array_order‘ option in the database (wp_options table).
Deleting this value caused Social Media Widget to recreate it and the problem was solved.Forum: Plugins
In reply to: [Social Media Widget by Acurax] PHP 7.2 and 7.3 not supported