• Resolved Elsabe

    (@elsabelessing)


    I’ve migrated order information for a client and on their new site they had deleted some of the products that were originally there.

    In the ‘wp_ajax_pipdig_wc_find_products_ajax’ action it needs to check if the product exists else it gets a fatal error.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author pipdig

    (@pipdig)

    Hi @elsabelessing, good catch! We’ve just pushed update 1.7 to fix that now.

    Thread Starter Elsabe

    (@elsabelessing)

    Awesome thank you!

    Thread Starter Elsabe

    (@elsabelessing)

    @pipdig it needs to still display the product name so this would be a better solution:

    foreach ($order->get_items() as $item) {
    
        $product = wc_get_product($item->get_product_id());
    
        $sku_markup = '';
        if ($product) {
            $sku = $product->get_sku();
    
            if ($sku) {
                $sku_markup = ' ('.esc_html($sku).')';
            }
        }
    
        $output .= absint($item['quantity']).' &times; '.esc_html($item['name']).$sku_markup.'<br />';
    
    }
    Plugin Author pipdig

    (@pipdig)

    I realised after sending that update that we were a bit hasty…

    We’ll push another update shortly :]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue when products don’t exist’ is closed to new replies.