The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

How do I add a value to the $values array? (1 post)

  1. TimoVeld
    Posted 3 years ago #

    I'm trying to get my own custo`m value in the $values array, but I'm having some trouble to find out where the array is actually build.

    I think I need to edit class-wc-cart.php, but if I just add my variable to

    $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 );`

    I get an error. So I was wondering where the $values array is actually build, and how to add a custom value.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic