Created
November 17, 2016 16:41
-
-
Save rayflores/8911f685fdaf5419208cfd67b3dcbcba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $i=1; | |
| foreach (WC()->cart->cart_contents as $item) { | |
| if ( isset( $cart_item[ 'composite_data' ] ) && ! empty( $cart_item[ 'composite_parent' ] ) ) { | |
| return $cart_item_class . ' item-' . $i + 10; | |
| } elseif ( isset( $cart_item[ 'composite_data' ] ) && ! empty( $cart_item[ 'composite_children' ] ) ) { | |
| return $cart_item_class . ' item-' . $i + 20; | |
| } else { | |
| return $cart_item_class . ' item-' . 200 + $i; | |
| } | |
| $i++; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment