/**
  * Add Menu Cart to menu
  * 
  * @return menu items including cart
  */
 public function submenu_items()
 {
     global $wpsc_cart, $options;
     $get_cart = wpsc_cart_item_count();
     $submenu_items = '';
     //see jigoshop/widgets/cart.php
     if (count($get_cart) > 0) {
         //foreach ( $get_cart as $cart_item_key => $values ) {
         while (wpsc_have_cart_items()) {
             wpsc_the_cart_item();
             //$_product = $values['data'];
             if (wpsc_cart_item_count() > 0) {
                 global $wpsc_cart, $options;
                 $item_thumbnail = '<img src=' . wpsc_cart_item_image() . '>';
                 $item_name = wpsc_cart_item_name();
                 $item_quantity = wpsc_cart_item_quantity();
                 $item_price = wpsc_cart_item_price();
                 // Item permalink
                 $item_permalink = wpsc_cart_item_url();
                 $submenu_items[] = array('item_thumbnail' => $item_thumbnail, 'item_name' => $item_name, 'item_quantity' => $item_quantity, 'item_price' => $item_price, 'item_permalink' => $item_permalink);
             }
             //}
         }
     } else {
         $submenu_items = '';
     }
     return $submenu_items;
 }
예제 #2
0
        ?>
		
		<tr class="product_row">
			<td class="firstcol"><img src='<?php 
        echo wpsc_cart_item_image(48, 48);
        ?>
' alt='<?php 
        echo wpsc_cart_item_name();
        ?>
' title='<?php 
        echo wpsc_cart_item_name();
        ?>
' /></td>
			<td class="firstcol">
			<a href='<?php 
        echo wpsc_cart_item_url();
        ?>
'><?php 
        echo wpsc_cart_item_name();
        ?>
</a>
			</td>
			<td>
				<form action="<?php 
        echo get_option('shopping_cart_url');
        ?>
" method="post" class="adjustform">
					<input type="text" name="quantity" size="2" value="<?php 
        echo wpsc_cart_item_quantity();
        ?>
"/>
        ?>
            </div>
         <?php 
    }
    ?>
         </td>

         <td class="wpsc_product_name wpsc_product_name_<?php 
    echo wpsc_the_cart_item_key();
    ?>
">
			<?php 
    do_action("wpsc_before_checkout_cart_item_name");
    ?>
            <a href="<?php 
    echo esc_url(wpsc_cart_item_url());
    ?>
"><?php 
    echo wpsc_cart_item_name();
    ?>
</a>
			<?php 
    do_action("wpsc_after_checkout_cart_item_name");
    ?>
         </td>

         <td class="wpsc_product_quantity wpsc_product_quantity_<?php 
    echo wpsc_the_cart_item_key();
    ?>
">
            <form action="<?php 
		<td><?php echo __('Product', 'wpsc'); ?>:</td>
		<td><?php echo __('Quantity', 'wpsc'); ?>:</td>
		<?php if(wpsc_uses_shipping()): ?>
			<td><?php echo __('Shipping', 'wpsc'); ?>:</td>
		<?php endif; ?>
		<td><?php echo __('Price', 'wpsc'); ?>:</td>
		<td></td>
	</tr>
	<?php while (wpsc_have_cart_items()) : wpsc_the_cart_item(); ?>
	
	<?php  //this displays the confirm your order html	?>
		
		<tr class="product_row">
			<td class="firstcol"><img src='<?php echo wpsc_cart_item_image(48,48); ?>' alt='<?php echo wpsc_cart_item_name(); ?>' title='<?php echo wpsc_cart_item_name(); ?>' /></td>
			<td class="firstcol">
			<a href='<?php echo wpsc_cart_item_url();?>'><?php echo wpsc_cart_item_name(); ?></a>
			</td>
			<td>
				<form action="<?php echo get_option('shopping_cart_url'); ?>" method="post" class="adjustform">
					<input type="text" name="quantity" size="2" value="<?php echo wpsc_cart_item_quantity(); ?>"/>
					<input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
					<input type="hidden" name="wpsc_update_quantity" value="true"/>
					<input type="submit" value="<?php echo __('Update', 'wpsc'); ?>" name="submit"/>
				</form>
			</td>
			<?php if(wpsc_uses_shipping()): ?>
			<td><span class="pricedisplay" id='shipping_<?php echo wpsc_the_cart_item_key(); ?>'><?php echo wpsc_cart_item_shipping(); ?></span></td>
			<?php endif; ?>
			<td><span class="pricedisplay"><?php echo wpsc_cart_item_price(); ?></span></td>
			<td>