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]
- Flash Player Projector post 2020
- Swf Editor open source?
- Is there a way to convert SWF to HTML5
- How do you decompile a swf file
- What formats can be displayed with type=”application/x-shockwave-flash”
- 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]
- WP-e-Commerce and W3-Total-Cache integration problem [closed]
- Need Help Finding a WordPress E-Commerce Plugin That Utilises Custom Post Types [closed]
- WordPress 3.1: Videoplayer implemented?
- Hard-coded Audio Player
- Relative or Absolute Paths for Flash Video Player Files
- All permalinks go to products page with WP E-Commerce plugin?
- Is there any site where i can found good documentation of wp-ecommerce plugin?
- WP e-commerce: getting products by SKU
- How to show large image in checkout page using WP Ecommerce plugin [closed]
- modify a function filter
- MarketPress vs. other WP ecommerce solutions [closed]
- Help alphabetically sorting $terms from get terms(‘wpsc_product_category’
- WordPress Jquery Confliction with Plugin
- How can I force oEmbed to display fixed height & width dimensions?
- How do display simple page for printing product info? [closed]
- Where sales manager of WP-Commerce plugin?
- Custom MySQL Query with logic
- Send email on Job Dispatched from WP e-commerce [closed]
- How can I find out what items a user has purchased? [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]
- How to replace the twentyten image header with my flash banner?
- E-commerce for wordpress [closed]
- Can the WP e-Commerce Plugin Support a Large Number of Products? [closed]
- E commerce on WordPress [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
- Uploading flash flipbook to mu wordpress site
- Convert featured images into “product images”
- Hook functions for Wp e-commerce? [closed]
- changes after I save a post
- SQL query – get ids – Advanced Custom Fields / WPeC
- WP-ecommerce : Change the price before inserting it into the cart
- WP-eComerce Advance Meta Tag data in descending order [closed]
- product export and import using xml
- Widget content turns up before title
- GetShopped Ecommerce: hide checkout form from customer until shipping country selected [closed]
- Custom product fields in wp e-Commerce plugin [closed]
- WP E-Commerce creating categories programmaticaly [closed]
- Using Amazon Book Gallery Plugins in WordPress [closed]
- WP-e-commerce (getshopped) – Annoying permalink issue [closed]
- Is there existing plugins to “Click-to-Launch” embedded Flash / SWF content?
- 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
- WP E-Commerce Custom Meta > Serialized array
- 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