Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter yleniavernucci

    (@yleniavernucci)

    Solved with this temporary solution: https://www.ads-software.com/support/topic/stops-working-after-update-from-version-1-to-2-0-1/

    I keep waiting for the fix.
    Thank you

    Thread Starter yleniavernucci

    (@yleniavernucci)

    I managed to resolve the error by modifying the code like this:

    public function add_addons_data_in_order_items(array $formatted_meta, WC_Order_Item $order_item) {
        $addons_data = $order_item->get_meta('_ywapo_meta_data');
    
        foreach ($formatted_meta as $meta_id => $meta) {
            if (str_starts_with($meta->key, 'ywapo-addon')) {
                $key_values = str_replace("ywapo-addon-", "", $meta->key);
    
                if ($addons_data) {
                    $is_admin = is_admin();
                    $is_email = did_action('woocommerce_email_header') === (did_action('woocommerce_email_footer') + 1);
    
                    $hide_on_emails = 'yes' === get_option('yith_wapo_hide_options_in_order_email', 'no');
    
                    if ($is_email && $hide_on_emails) {
                        return $formatted_meta; // Se hai una funzione specifica per gestire questa logica, sostituiscila qui.
                    }
    
                    foreach ($addons_data as $data_key => $option) {
                        foreach ($option as $key => $value) {
                            // Controllo
    
                            if ($key && is_array($value) && isset($value['addon_id']) && isset($value['option_id'])) {
                                $addon_id = $value['addon_id'];
                                $option_id = $value['option_id'];
    
                                $addons_key = $addon_id . '-' . $option_id;
    
                                if (isset($formatted_meta[$meta_id]->display_key) && $addons_key === $key_values) {
                                    $formatted_meta[$meta_id]->display_key = $value['display_label']; // Format display key
                                    $formatted_meta[$meta_id]->display_value = $value['display_value']; // Format display value.
                                }
                            }
                        }
                    }
                }
            }
        }
    
        return apply_filters('yith_wapo_addon_option_in_order_items', $formatted_meta, $order_item, $this);
    }
    

    Now how do I make it stable for the next update?

    Thread Starter yleniavernucci

    (@yleniavernucci)

    HI,
    thanks for replying.
    How can I help you reproduce the problem? The simplest thing would be to show you the website and let you try it: I could tell you which products to add to the cart and you would see the error yourself. In the meantime I’ll show you a screenshot…

    https://i.postimg.cc/k47Nbqwp/Senza-titolo-1.jpg

    In the mentioned file, the code on lines 1280 and 1281 is this:

    foreach?(?$addons_data?as?$data_key?=>?$option?)?{
    
    ????????????????????????????foreach?(?$option?as?$key?=>?$value?)?{
    
    ????????????????????????????????if?(?$key?&&?''?!==?$value?)?{
    
    ????????????????????????????????????$addon_id?=?$value['addon_id'];
    
    ????????????????????????????????????$option_id?=?$value['option_id'];
    
    ????????????????????????????????????$addons_key?=?$addon_id?.?'-'?.?$option_id;
    
    ????????????????????????????????????if?(?isset(?$formatted_meta[$meta_id]->display_key?)?&&?$addons_key?===?$key_values?)?{
    
    ????????????????????????????????????????$formatted_meta[$meta_id]->display_key?=?$value['display_label'];?//?Format?display?key
    
    ????????????????????????????????????????$formatted_meta[$meta_id]->display_value?=?$value['display_value'];?//?Format?display?value.
    
    ????????????????????????????????????}
    
    ????????????????????????????????}
    
    ????????????????????????????}
    
    

    Thank you in advance

    Thread Starter yleniavernucci

    (@yleniavernucci)

    Hi,
    After updating to 4.7, I solved the problem of the order status, but I got a new one.

    After updating, I get many errors in the product details after checkout. Here are some examples:
    Warning: Illegal string offset ‘addon_id’ in /home/customer/www/myshop.it/public_html/wp-content/plugins/yith-woocommerce-product-add-ons/includes/class-yith-wapo.php on line 1280

    (sorry for the double post, I wasn’t able any longer to edit the first one)

    Thread Starter yleniavernucci

    (@yleniavernucci)

    Thanks so much for replying!
    I did further tests and followed your instructions.
    I found that the low stock notification mail is sent but not received.
    However, I get all other Woocommerce notification mails correctly.
    But I also discovered that WordPress service mails (for example the one for changing the administration email) are NOT delivered.
    So:

    • order email from Woocommerce: correctly delivered
    • low stock emails: NOT delivered
    • some WordPress notification emails: NOT delivered

    Do you have any idea how this is possible?
    Do low stock mails use a different delivery system than order mails?
    How can I fix it according to you?
    Thank you in advance!

    Thread Starter yleniavernucci

    (@yleniavernucci)

    Grazie mille, era stata una segnalazione errata ricevuta anche da me.

    Thread Starter yleniavernucci

    (@yleniavernucci)

    The Plugin was Pixel Your Site.
    I thought it could avoid the Facebook Pixel to be blocked and when I saw it got blocked by ginger, I thought it was ok.
    But it wasn’t ??
    —————————

    ITA: Il Plugin era Pixel Your Site. Pensavo che avrebbe potuto essere un problema, ma credevo lo sarebbe stato per IL BLOCCO del PIxel di FB. Quando ho visto che ginger lo bloccava, pensavo fosse tutto ok. Invece no, comunque andava in conflitto. Disinstallato.

    Thread Starter yleniavernucci

    (@yleniavernucci)

    Solved- There was a conflict with another plugin

Viewing 8 replies - 1 through 8 (of 8 total)