[Plugin: WP e-Commerce] $wpsc->set_item
-
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
- The topic ‘[Plugin: WP e-Commerce] $wpsc->set_item’ is closed to new replies.