WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
[Plugin: WP e-Commerce] $wpsc->set_item (3 posts)

  1. netbrana
    Member
    Posted 2 years ago #

    Hi, can you please someone help me? I try to develop plugin for wp e-commerce but if I used global $wpsc_cart, nothing happened. Please see code below.


    function LucToCart($product_id, $parameters) {
    global $wpsc_cart;
    $state = $wpsc_cart->set_item($product_id, $parameters);
    }
    if(!empty($_GET['lucproducts'])) {
    foreach($_GET['lucproducts'] as $lucproducts){

    $product_id = (int)$lucproducts;
    $default_parameters = array();
    $default_parameters['variation_values'] = null;
    $default_parameters['quantity'] = 1;
    $default_parameters['provided_price'] = null;
    $default_parameters['comment'] = null;
    $default_parameters['time_requested'] = null;
    $default_parameters['custom_message'] = null;
    $default_parameters['file_data'] = null;
    $default_parameters['is_customisable'] = false;
    $default_parameters['meta'] = null;

    $provided_parameters = array();
    $parameters = array_merge( $default_parameters, (array)$provided_parameters );
    LucToCart($product_id, $parameters);
    }
    }

    Thank you

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

  2. netbrana
    Member
    Posted 2 years ago #

    I tried use action wpsc_set_cart_item but nothing happend. My code:
    do_action('wpsc_set_cart_item' , $product_id , $parameters , $this);

  3. iskh
    Member
    Posted 1 year ago #

    Go for the import option and add meta items.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic