Forum Replies Created

Viewing 15 replies - 31 through 45 (of 847 total)
  • Thread Starter cutu234

    (@cutu234)

    If you want to post articles or blog posts, do not do that on this site. That’s not what these support forums are for.

    Sorry, I can’t follow. I am clearly looking for help. My other post contained a link to a similar support thread that could have helped here.

    It is a very strange policy that even I can’t see the “archived” post anymore. So, I am not able to answer properly.

    Back to the issue: In the other post (that was “archived”) was a solution for a similar problem. I had to create a value manually in the options table. Perhaps, there is a similar solution in this case. I would assume that dismissing the box normally creates this database entry to prevent the box from re-appearing again.

    • This reply was modified 1 month, 1 week ago by cutu234.
    Thread Starter cutu234

    (@cutu234)

    Yes, I know. I don’t see this issue on just a few customer sites. But if it appears, it’s ALWAYS the BackWPup box. I’ve alread checked the JS console. There are no errors.

    In the past, I had change the database directly. That’s no problem for me. However, something IS wrong, since errors like this appear again and again. I couldn’t find any patterns yet.

    Thread Starter cutu234

    (@cutu234)

    I can see the message logged in as an admin, but not as an editor. Theme, WP and all plugins are the latest version. The site is running on PHP 8.3. Deactivating and Re-activating the plugin did not change anything. No caching enabled.

    Thank you.

    Thread Starter cutu234

    (@cutu234)

    I think, I got it. I changed the snippet a little bit and added the woocommerce_checkout_create_order action. This saves a meta_value “express” for the meta_key “_paypal_context”, if the user paid via express checkout. Eventually, I delete this session. Seems to work. Would you consider this a proper solution?

    add_action('wc_ppcp_cart_order_created', function($paypal_order, $request){
        if($request->get_param('context') === 'express'){
            WC()->session->set('paypal_context', 'express');
        }
    }, 10, 2);
    
    add_action('woocommerce_checkout_create_order', 'custom_data_to_meta', 10, 2);
    function custom_data_to_meta($order) {
        global $woocommerce;
        $custom_data = WC()->session->get('paypal_context');
        if (!empty($custom_data)) {
            $order->update_meta_data('_paypal_context', $custom_data);
        }
    }
    
    add_action('woocommerce_thankyou', 'clear_custom_session_data');
    function clear_custom_session_data() {
        global $woocommerce;
        if (WC()->session) {
            WC()->session->__unset('paypal_context');
        }
    }
    • This reply was modified 1 month, 2 weeks ago by cutu234.
    Thread Starter cutu234

    (@cutu234)

    That sounds great. Unfortunately, I can’t get the saving part right. For test purposes. I included a standard Woo function to save some dummy data:

    add_action('woocommerce_checkout_create_order', 'custom_data_to_order', 10, 2);
    function custom_data_to_order($order) {
            global $woocommerce;
        if (is_checkout()) {
            WC()->session->set('pp_context', 'test');
        }
        $custom_data = WC()->session->get('pp_context');
        if (!empty($custom_data)) {
            $order->update_meta_data('_paypal_context', $custom_data);
        }
    }

    This works just fine. But I don’t exactly understand how to use it with your action.

    Any help would be very appreciated! Thank you!

    • This reply was modified 1 month, 2 weeks ago by cutu234.
    Thread Starter cutu234

    (@cutu234)

    The address_2 fields are deactivated. Users would fill in everything they can think of ?? In this case, I used a PayPal address that doesn’t even contain a house number. The problem is not that a value was intended for the wrong (or in this case non-existent) field, but that an address without a number is accepted.

    Don’t get me wrong. I don’t blame this on you. I just try to find a solution. Activating the address_2 fields wouldn’t change anything as long as they are not mandatory. But IF they are mandatory, users fill in anything BUT the house number. ??

    • This reply was modified 1 month, 2 weeks ago by cutu234.
    • This reply was modified 1 month, 2 weeks ago by cutu234.
    Thread Starter cutu234

    (@cutu234)

    Thanks for the info. No problem. I can imagine that the PayPal API is not always fun to work with. ??

    Thread Starter cutu234

    (@cutu234)

    It sounds like your address validation within WooCommerce has been customized and therefore not validating the address correctly.

    I wish you were right. But I’ve just tested it with the default Storefront theme and all plugins disabled that could affect the checkout. I could easily place the order with a missing street number:

    I would recommend you just turn express checkout off and use PayPal in the payment method section.

    I think, THAT would defeat the purpose of express checkout. ??

    Honestly, I haven’t fully understood what’s going on. In almost all cases is the shipping address identical to the billing address. Just the street number is missing. Why would a customer manually choose a different shipping address that is obviously the same as the billing address? I can only guess that a specific shipping address was set up in the PayPal account with the street number in the wrong field. Unfortunately, this makes troubleshooting a nightmare.

    • This reply was modified 1 month, 2 weeks ago by cutu234.
    • This reply was modified 1 month, 2 weeks ago by cutu234.
    Thread Starter cutu234

    (@cutu234)

    Thank you very much!

    Thread Starter cutu234

    (@cutu234)

    Hi,

    I have to apologize. This was a glitch, I suppose. Maybe a cache issue. Now, these buttons are gone. That’s embarrassing, but I really don’t have an explanation. Sorry for bothering you and thank you very much for the patience.

    Thread Starter cutu234

    (@cutu234)

    Just to clarify, are you referring to the “View Order Details” button in the My Account → Orders section?

    No. As you can see in the URL provided, I am referring to the individual order view. The button refers to itself, so to speak. The other buttons on the orders overview page is totally fine and makes sense, of course.

    Thread Starter cutu234

    (@cutu234)

    Thanks, David!

    It’s even a little bit more complicated. We actually have to remove the description tab first and create a custom one. This totally works. Code goes into child-theme/woocommerce/content-single-product-nab1.php (in this case) right after do_action( 'woocommerce_single_product_summary' );

    add_filter('woocommerce_product_tabs', 'replace_description_tab');
    function replace_description_tab($tabs)
    {
    unset($tabs['description']);
    $tabs['custom_tab'] = array(
    'title'    => 'Custom Tab',
    'priority' => 10,
    'callback' => 'custom_tab_content'
    );
    return $tabs;
    }
    function custom_tab_content()
    {
    echo '<h2>Some Text</h2>';
    echo '<p>This is custom tab content.</p>';
    }
    ?>

    However, I totally agree that this method is quite cumbersome. A PHP test might be a much better option. Will gladly test beta versions.

    Thread Starter cutu234

    (@cutu234)

    Thank you very much. That’s a good starting point, but we are not out of the woods yet. I am fully aware that my question is way beyond the scope of this forum. I appreciate your help. Having said this, I’m sure that this will be a very useful addition to your documentation. It will make the template test super versatile.

    Now, I copied the content of the single product template to the new master template and created two additional template files:

    child-theme/single-product.php
    child-theme/nab-product-a.php
    child-theme/nab-product-b.php

    I added two lines to each template header:

    * Template Name: Nab-0
     * Template Post Type: product
    * Template Name: Nab-1
     * Template Post Type: product

    This makes the templates available on the product edit page. So far so good. This does not give us full access to the content that is called like so:

    <?php wc_get_template_part( 'content', 'single-product' ); ?>

    I changed this is template b child-theme/nab-product-b.php to:

    <?php wc_get_template_part( 'content', 'single-product-nab1' ); ?>

    and created an additional template:

    child-theme/woocommerce/content-single-product-nab1.php

    I can now change the template. This totally works. The main content, however, is called via this action hook:

    do_action( 'woocommerce_after_single_product_summary' );

    For test purposes, I added some dummy content like this:

    add_action( 'woocommerce_after_single_product_summary', 'some_custom_stuff', 30 );
    function some_custom_stuff()
    {
    echo '<p>Adding some custom content</p>';
    }
    do_action( 'woocommerce_after_single_product_summary' )

    This works, but how would I address, for example, just the content of the editor?

    Thank you!

    Mike

    Thread Starter cutu234

    (@cutu234)

    It won’t work like this. The single.php is the template for the standard post. We can use it for CPTs, but it will not contain the functionality for Woocommerce products. I’ve just tested it using the storefront theme.

    I can choose between templates, but the frontend will show just the editor content, but not elements like add-to-cart button etc. See the screenshots, please:

    No custom templates:

    With custom template:

    https://demo.my-blog-shop.de/produkt/neu/

    The product is now shown like a standard post and not like a product.

    • This reply was modified 2 months, 1 week ago by cutu234.
    Thread Starter cutu234

    (@cutu234)

    Hi Michael,

    deactivating all plugins in a live shop is a lot to ask. Please note, that this base64 content is in the database and not created dynamically. It seems to be super unlikely that any plugin might have some impact on this. I mean, the composer loads what’s in the database, doesn’t it?

    Anyway, the customer has already overwritten the messed up draft. So, we can close this for now.

Viewing 15 replies - 31 through 45 (of 847 total)