Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 如何在Woocommerce中向$values数组添加值?_Arrays_Woocommerce - Fatal编程技术网

Arrays 如何在Woocommerce中向$values数组添加值?

Arrays 如何在Woocommerce中向$values数组添加值?,arrays,woocommerce,Arrays,Woocommerce,我试图在$values数组中获取我自己的custo`m值,但是我很难找到数组的实际构建位置 我想我需要编辑class-wc-cart.php,但是如果我只是将变量添加到 $this->cart_contents[$cart_item_key] = apply_filters( 'woocommerce_add_cart_item', array_merge( $cart_item_data, array( 'product_id' => $pro

我试图在$values数组中获取我自己的custo`m值,但是我很难找到数组的实际构建位置

我想我需要编辑class-wc-cart.php,但是如果我只是将变量添加到

$this->cart_contents[$cart_item_key] = apply_filters( 'woocommerce_add_cart_item', array_merge( $cart_item_data, array(
                'product_id'    => $product_id,
                'variation_id'  => $variation_id,
                'variation'     => $variation,
                'quantity'      => $quantity,
                'data'          => $product_data
            ) ), $cart_item_key );
我犯了一个错误。所以我想知道$values数组实际上是在哪里构建的