this is a simple function that will add an item to the cart. you could tie this to an ajax call and pass whatever POST vars you want, obviously product id, quantity, etc..
function my_add_to_cart(){
global $wpsc_cart;
$product_id = 1;
$args = array();
$args['quantity'] = 1;
$args['variation_values'] = null;
$args['provided_price'] = null;
$args['comment'] = null;
$args['time_requested'] = null;
$args['custom_message'] = null;
$args['file_data'] = null;
$args['is_customisable'] = false;
$args['meta'] = null;
$state = $wpsc_cart->set_item( $product_id, $args );
}
Related Posts:
- How to Match Orders to User Sessions in WPeC
- wp-e-commerce plugin – custom payment option
- WP ecommerce – How do I change the product image for each product variation?
- wp-e-commerce plugin – Second Test Gateway payment option [closed]
- How to edit products page of wp ecommerce plugin?
- Permalink issue only with numbers [closed]
- Code not looping over all products of a given category
- How to change the layout of a product page
- style being attatched to tag from outside of style sheets
- wp_reset_query equivalent for WP Ecommerce
- Arrays not working on a WP-Ecommerce product page [closed]
- Existing Ecommerce plugins with Custom Post Types [closed]
- Limit the number of results from wpsc_start_category_query
- How to sell an album for download
- Can WP ecommerce collect card info without charging?
- WPSC how do i output product per category on one page (wpsc-product-page)
- How to charge shipping in WP e-commerce based on a variant? [closed]
- WP-E Commerce: How to let user leave a personal message/instruction with each product from the products page [closed]
- Why does the first page of one category redirect to empty page 4?
- WP Ecommerce, Gold Cart and pagination
- How to organize products by collections with collections description?
- How to randomly generate products pop-up on click in store
- WP e-Commerce hook after creating order?
- WP E-commerce and Display Fancy Purchase Notifications
- insert order number into wp ecommerce order confirmation email
- Switching off shipping in WP-eCommerce
- Change how WP e-Commerce calculates price total at checkout [closed]
- In what files I can change country names of wp-ecommerce plugin? [closed]
- how to get extra info from checkout in wp-ecommerce
- how to get tax percentage in wp-ecommerce
- Sell photos through WordPress [closed]
- Where the variations are stored in the database when using wp-e-commerce plugin? [closed]
- Swf Editor open source?
- Is there a way to convert SWF to HTML5
- How do you decompile a swf file
- ipconfig in command it shows “ipconfig is not recognized as internal or external command””
- Extract images from .swf viewer?
- Workaround for Your Flash settings will be kept until you quit Chrome
- Large Uploads in WordPress
- shortcode outputs first before the page content [duplicate]
- Graphing libraries for WordPress [closed]
- WordPress eCommerce plugin for books
- What are WooCommerce starter themes? [closed]
- Need Help Finding a WordPress E-Commerce Plugin That Utilises Custom Post Types [closed]
- WordPress 3.1: Videoplayer implemented?
- Hard-coded Audio Player
- Is there any site where i can found good documentation of wp-ecommerce plugin?
- WP e-commerce: getting products by SKU
- modify a function filter
- MarketPress vs. other WP ecommerce solutions [closed]
- Help alphabetically sorting $terms from get terms(‘wpsc_product_category’
- How can I force oEmbed to display fixed height & width dimensions?
- How do display simple page for printing product info? [closed]
- Custom MySQL Query with logic
- Send email on Job Dispatched from WP e-commerce [closed]
- Use flash on a wordpress site as a widget
- Bulk Custom Menu and Wp-Ecommerce
- WP e-commerce: How to select the shipping costs calculation method according to delivery location
- How-To add Custom field in WordPress wp-ecommerce Categories?
- wp e-commerce group product by category [closed]
- E-commerce for wordpress [closed]
- Can the WP e-Commerce Plugin Support a Large Number of Products? [closed]
- Making tags appear as an Unordered list instead of a ‘cloud’
- WordPress plugin Post Creation [closed]
- wp e-commerce – theme problem – why won’t it load wpsc-single_product.php? [closed]
- How to show Best Selling WP E-Commerce Products
- Ecommerce Single Product Next Product Link
- Convert featured images into “product images”
- Hook functions for Wp e-commerce? [closed]
- changes after I save a post
- WP-ecommerce : Change the price before inserting it into the cart
- product export and import using xml
- Widget content turns up before title
- Custom product fields in wp e-Commerce plugin [closed]
- WP E-Commerce creating categories programmaticaly [closed]
- WP-e-commerce (getshopped) – Annoying permalink issue [closed]
- WP-e-commerce (getshopped) Hebrew language files – where can I get them? [closed]
- How to show SWF, where Flash is available, and gracefully fallback to MP4 video for iOS devices?
- Unable to upload new file as a product
- From where wp ecommerce is loading plugin theme files?
- Flash Intro is embedded in a html, how do I integrate as my first page
- WP E-Commerce WPEC 3.8 Sort Categories
- Can Shopp or WP ecommerce create something as extensive as these sites? Other recommended solutions?
- Link a button to woofunnels model
- Add sub variations in product page
- WordPress – estimate used product
- How to add wpmode in Flash Embed Code in WordPress Site?
- Getshopped (WP-e-commerce): show all protucts on one admin page for drag-and-drop ordering [closed]
- How can I show a .swf file?
- WP Ecommerce: Display the “Order Notes” as column in the Sales Log [closed]
- wp e-commerce single-product template giving 404
- Multiple while loops not functioning [closed]
- Single file upload
- Call a Simple JQuery from within Flash
- How to adjust the Cartpress e-commerce plugin?
- making users able to add their own products wp e-commerce [closed]
- WPeC – Adding conditional logic to purchases [closed]
- Shipping charge by country & product weight? [closed]
- Wp eCommerce meta information search [closed]
- Good practical way to do loop within loop to show child custom type using a template code