Support » Plugin: Pixel de Facebook para Woocommerce » Plugin Error

  • Resolved primalgabe

    (@primalgabe)


    Hi, we have started getting this error continuously:

    [09-Jun-2017 15:30:15 UTC] PHP Warning: implode(): Invalid arguments passed in /wp-content/plugins/pixel-de-facebook-para-wocommerce/fb-conf.php on line 109

    It’s coming from the following code. Error is in line #109

    <script>fbq('track', 'AddToCart', {content_type: 'product', content_ids: [<?php echo (isset($options['product_ref']) && $options['product_ref']) ? implode( ', ',$item) : implode( ', ',$sku); ?>], value: <?php echo $cart_total ?>, currency:'<?php echo $options['currency'];?>'});</script>
                    <?php
                                    }
                    }
                    
                    //INITIATECHECKOUT
                    if (!isset($options['initiate_checkout']) != '1' || $options['initiate_checkout'] ) { 
                    add_action( 'woocommerce_before_checkout_form', 'fb_initiatecheckout' );
                    function fb_initiatecheckout() {
                                    $options = get_option('pfb_woo_options');
                                    $cart_items = WC()->cart->cart_contents;
                                    $cart_total = WC()->cart->subtotal_ex_tax;
                                    $cart_prods = WC()->cart->get_cart();
                                    if($cart_items) foreach ($cart_items as $cart_item){ $item[] = "'".$cart_item['product_id']."'";}
                                    if($cart_prods) foreach($cart_prods as $entry){
                                                    global $product;
                                                    $product_variation_id = $entry['variation_id'];
                                                   if ($product_variation_id) { 
                                                    $prod = new WC_Product($entry['variation_id']);
                                                    } else {
                                                    $prod = new WC_Product($entry['product_id']);
                                                    }
                                                    $sku[] = "'".$prod->get_sku()."'";
                                                    }
                                    
                    ?>
    • This topic was modified 1 year, 9 months ago by  bdbrown.
    • This topic was modified 1 year, 9 months ago by  primalgabe.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Plugin Error’ is closed to new replies.