wpsc_the_cart_item_key

Located in: cart.class.php
Version Introduced: 3.8

Description: This template tag is used to print out the cart item key (This is the array key that relates to the product in the cart array)

Note: This function just returns the cart key so to use this function you must use it with an echo to output the key to the browser. It must also be used within the cart loop
[php] <?php while (wpsc_have_cart_items()) : wpsc_the_cart_item(); ?>[/php]

Code Example:
[php highlight=”8″]
<?php while(wpsc_have_cart_items()): wpsc_the_cart_item(); ?>
<tr>
<td colspan=’2′ class=’product-name’><?php do_action ( "wpsc_before_cart_widget_item_name" ); ?><a href="<?php echo wpsc_cart_item_url(); ?>"><?php echo wpsc_cart_item_name(); ?></a><?php do_action ( "wpsc_after_cart_widget_item_name" ); ?></td>
<td><?php echo wpsc_cart_item_quantity(); ?></td>
<td><?php echo wpsc_cart_item_price(); ?></td>
<td class="cart-widget-remove"><form action="" method="post" class="adjustform">
<input type="hidden" name="quantity" value="0" />
<input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>" />
<input type="hidden" name="wpsc_update_quantity" value="true" />
<input class="remove_button" type="submit" />
</form></td>
</tr>
<?php endwhile; ?>

[/php]