WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
[Plugin: WP e-Commerce] Shopping Cart In Header not updating (3 posts)

  1. fateskimo
    Member
    Posted 2 years ago #

    Hi

    I've tried searching for ages but so far not found the answer so apologies if this has been asked before.

    I have moved the shopping cart into the header of my website and now it no longer automatically updates when you "add to cart".

    It does show when you refresh the page so I figure it's an Ajax thing. Has anyone any ideas where I can find this script and what I need to edit?

    Cheers

    http://wordpress.org/extend/plugins/wp-e-commerce/

  2. andherba
    Member
    Posted 2 years ago #

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still - use the pastebin ]

    Hello,
    I needed the same functionality. So what I did was to use the same classes for the div's containing the shopping cart. This is what I added to my header:

    <?php if(wpsc_cart_item_count() > 0): ?>
        <div class="shoppingcart">
    	<div class="shopping-cart-wrapper">
    	<div class="shoppingcart">
    		<table>
    			<tr class="cart-widget-total">
    				<td class="cart-widget-count">
    					<?php printf( _n('%d item', '%d items', wpsc_cart_item_count(), 'wpsc'), wpsc_cart_item_count() ); ?>
    				</td>
    				<td class="pricedisplay checkout-total" colspan='4'>
    					<?php _e('Total', 'wpsc'); ?>: <?php echo wpsc_cart_total_widget( false, false ,false ); ?>
    					<small><?php _e( 'excluding shipping and tax', 'wpsc' ); ?></small>
    				</td>
    			</tr>
    			<tr>
    				<td id='cart-widget-links' colspan="5">
    					<a>" title="<?php _e('Checkout', 'wpsc'); ?>" class="gocheckout"><?php _e('Checkout', 'wpsc'); ?></a>
    					<form action="" method="post" class="wpsc_empty_the_cart">
    						<input type="hidden" name="wpsc_ajax_action" value="empty_cart" />
    							<a>" class="emptycart" title="<?php _e('Empty Your Cart', 'wpsc'); ?>"><?php _e('Clear cart', 'wpsc'); ?></a>
    					</form>
    				</td>
    			</tr>
    		</table>
    	</div>
    	</div>
    	</div>
    <?php endif; ?>
  3. machelle
    Member
    Posted 1 year ago #

    Hi There

    Please could you help me. I also need to add the shopping cart to my header. I used the code above but it doesn't show. Why is that?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic