Forum Replies Created

Viewing 15 replies - 1 through 15 (of 36 total)
  • Thread Starter tristanmason

    (@tristanmason)

    After looking through the code, it looks like Content Control should be looping through all the roles and only excluding the user if there are no valid roles that can access the content:

    // Checks all roles, should not exclude if any are active.
    $valid_role = false;
    
    foreach ( $roles as $role ) {
    	if ( current_user_can( $role ) ) {
    		$valid_role = true;
    		break;
    	}
    }

    So now I’m stumped as to why some of our users with valid roles are still being redirected to login when trying to access content. We are using the Members plugin to create and assign the roles.

    • This reply was modified 1 year, 3 months ago by tristanmason.
    Thread Starter tristanmason

    (@tristanmason)

    Excellent, thanks! That does indeed make it keyboard focusable. However, looks like I’m going to have to write a handler that triggers the click event when the item is in focus and someone presses Space or Enter. I’ll do that and report back for posterity’s sake. ??

    Question – is the Youtube video title variable exposed to that filter in such a way that I could pass it in and make the ARIA-label actually say the title of the video? If not, no worries.

    Thread Starter tristanmason

    (@tristanmason)

    @paulostp Great, thanks again for your help with this issue!

    Thread Starter tristanmason

    (@tristanmason)

    @shameemreza Thanks for taking the time to provide this thorough reply! I reached out to the Shipstation extension support team, and they’re looking into this. In the meantime, #3 is a good, workable solution.

    Thread Starter tristanmason

    (@tristanmason)

    @paulostp Thanks for looking into this more! If we have to, we can change this fee to a hidden virtual product in order to bypass the issue. But I do think this is something that will probably keep coming up occasionally when people use the add_fee function, and it seems like a pretty simple adjustment to add a switch or filter for it.

    Thread Starter tristanmason

    (@tristanmason)

    Hi @anastas10s,

    Thanks, but I think we’re getting off track from my question. I don’t need support for code customization. I’m reporting what appears to be a bug in the plugin and asking for a way to fix it.

    The problem is in the file /includes/api-export/class-wc-shipstation-api-export.php , starting at line 236:

    // Item data.
    $found_item = false;
    $items_xml  = $xml->createElement( 'Items' );
    // Merge arrays without loosing indexes.
    $order_items = $order->get_items() + $order->get_items( 'fee' );
    foreach ( $order_items as $item_id => $item ) {
    	$product                = is_callable( array( $item, 'get_product' ) ) ? $item->get_product() : false;
    	$item_needs_no_shipping = ! $product || ! $product->needs_shipping();
    	$item_not_a_fee         = 'fee' !== $item->get_type();
    	if ( apply_filters( 'woocommerce_shipstation_no_shipping_item', $item_needs_no_shipping && $item_not_a_fee, $product, $item ) ) {
    		continue;
    	}
    
    	$found_item = true;
    	$item_xml   = $xml->createElement( 'Item' );
    	$this->xml_append( $item_xml, 'LineItemID', $item_id );
    
    	if ( 'fee' === $item->get_type() ) {
    		$this->xml_append( $item_xml, 'Name', $item->get_name() );
    		$this->xml_append( $item_xml, 'Quantity', 1, false );
    
    		$item_total = $order->get_item_total( $item, false, true );
    
    		// Maybe convert fee item total.
    		if ( 1.00 !== $exchange_rate ) {
    			$item_total = wc_format_decimal( ( $item_total * $exchange_rate ), wc_get_price_decimals() );
    		}
    
    		$this->xml_append( $item_xml, 'UnitPrice', $item_total, false );
    	}

    In line 240, it lumps all the products and fees together before exporting to the XML <Items>.

    $order_items = $order->get_items() + $order->get_items( 'fee' );

    Then on line 245, it skips the product if it’s virtual, but not if it’s a fee:

    if ( apply_filters( 'woocommerce_shipstation_no_shipping_item', $item_needs_no_shipping && $item_not_a_fee, $product, $item ) ) {
    	continue;
    }

    The result is that even if all the products in the order are virtual, it still exports the order to Shipstation if there is a fee in the order. It should not do this since not all fees are shipping fees.

    Especially since I’m not the only one who has asked about this recently (see other support post I linked to)—is there a way for us to bypass this behavior? For example, a filter hook, a constant, or a setting that would instruct the plugin not to export fees if all the items are virtual.

    Thanks!

    Thread Starter tristanmason

    (@tristanmason)

    @anastas10s Thanks for your reply!

    Here is the system report. Heads up, I’ve changed QuickForget expiration to 1 view/36 hours for this one. https://quickforget.com/s/dddd872a1b6c7ae3145527e18037e84ea7297e18b487f2a1

    And here is the code we are using to add the fee: https://quickforget.com/s/4cc8b37890ab278584f384ddae1c6bb7eb33db1ac9917b14
    It adds a checkbox in checkout so a customer can voluntarily donate the equivalent of the credit card processing fee, and then uses AJAX to add the fee using WooCommerce’s normal add_fee() method.

    Thread Starter tristanmason

    (@tristanmason)

    @howarddc Ah yes, I did have FontAwesome disabled. Thanks for this!

    Thread Starter tristanmason

    (@tristanmason)

    @mrclayton Thanks for quick reply! To answer your question, on all orders I’ve seen so far (both on the orders that failed and the client manually re-ran, and on the orders that renewed correctly), the payment gateway is now “Credit Cards”. When I hover over the question mark icon, they say “Gateway ID: [stripe_cc]”.

    This may be extraneous info, but on those orders that failed and the client manually re-ran, the following note appears on the subscription afterward:

    Payment method changed from “Credit Card (Stripe)” to “Credit Cards” by the subscriber.

    I asked to client to follow your instructions and populate the payment method token field on the subscription next time one of these fails. Will report back. Thanks again!

    Thread Starter tristanmason

    (@tristanmason)

    @mrclayton Thanks! The connection process was indeed easy. For anyone finding this thread in the future: I needed to be logged in as the account owner to connect. Having developer permissions for a Stripe account was not enough in my case.

    Question – the plugin migrated almost all of the subscriptions; however, we are running into a problem where a few recurring payments are failing with this error:

    Recurring payment for order failed. Reason: You passed an empty string for ‘payment_method’. We assume empty values are an attempt to unset a parameter; however ‘payment_method’ cannot be unset. You should remove ‘payment_method’ from your request or supply a non-empty value.

    When we look at them, these subscription orders are all missing a Payment Method Token (the field was blank). My client says with the previous plugin (WooCommerce Stripe), this field could be blank and it would still pull a payment.

    The client says they had to process these payments manually:

    I logged into stripe, processed the amount, then copied the transaction ID to the pending payment in Woo, this when marked complete, updated the subscription to active again.?

    Clearly that isn’t a good long-term solution – do you have any idea why this is happening and what we can do to fix it? Thanks!

    Thread Starter tristanmason

    (@tristanmason)

    Hello,

    For Stripe all you have to do is disable the other plugin then enable ours and everything else is automated.

    When I tried this in our staging site, it did not migrate our API keys, and when I went into your plugin’s settings, it presented me with a Connect button to connect to Stripe. Wasn’t it supposed to transfer the settings automatically?

    Thanks,
    Tristan

    Thread Starter tristanmason

    (@tristanmason)

    @mrclayton Many thanks! Will do.

    Thread Starter tristanmason

    (@tristanmason)

    @mrclayton Thank you! Yes, we will test it in staging first as you recommended.

    Do we need to do anything in particular to migrate our WooCommerce Subscriptions? In your docs I found this page about migrating from Braintree: https://docs.paymentplugins.com/wc-stripe/config/#/data_migration?id=steps , but the image is broken.

    Could you guys confirm that the issue was resolved with latest version?

    Yes, looks like it’s fixed after the latest update. Thanks for your help!

    was it pushed out to an update that any site would be able to use?

    For us, the update appeared in Dashboard > Updates like any other plugin update, and installing it fixed the errors.

    We are having the same problem. Would love to see a new version released to fix this soon. We have many sites using this plugin, and they are sending fatal error emails.

    [12-Oct-2021 14:46:42 UTC] PHP Fatal error:  Uncaught Error: Class 'WPPopups_License' not found in /[redacted]/wp-content/plugins/wp-popups-lite/wp-popups-lite.php:361
    Stack trace:
    #0 /[redacted]/wp-includes/class-wp-hook.php(292): WPPopups->objects('')
    #1 /[redacted]/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
    #2 /[redacted]/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
    #3 /[redacted]/wp-settings.php(423): do_action('plugins_loaded')
    #4 /[redacted]/wp-config.php(90): require_once('/home/stelizabe...')
    #5 /[redacted]/wp-load.php(37): require_once('/home/stelizabe...')
    #6 /[redacted]/wp-cron.php(44): require_once('/home/stelizabe...')
    #7 {main}
      thrown in /[redacted]/wp-content/plugins/wp-popups-lite/wp-popups-lite.php on line 361
Viewing 15 replies - 1 through 15 (of 36 total)