Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • lanmangoo

    (@lanmangoo)

    It’s up to lightbox.
    Build your galleries page as category=Galleries and each gallery as category post. Then install Simple Lightbox then Appearance -> Lightbox ->
    Group items (for displaying as a slideshow) = checked
    Group items by Post (e.g. on pages with multiple posts) = checked
    Group gallery items separately = checked
    Group widget items separately = checked

    lanmangoo

    (@lanmangoo)

    Hi,

    I have solved the problem ?? In fact, I made a code that saves cart on server. Thus user can access his cart from anywhere.
    But you
    1) must be able to access your WP database,
    2) you should not to be afraid of looking at php ??

    Make table “custom_wp_wpsc_cart” (in your WP database) containing fields “user_ID” (bigint) and “wpsc_cart” (varchar as long as possible, for example 100000).
    Then copy this code at the begining of file plugins/wp-e-commerce/wpsc-theme/wpsc-cart_widget.php
    (If you don’t use cart widget you could try to copy this at the begining of a file you use. I just haven’t tried this code anywhere else, sorry).
    At the end of code you will find commented lines that refers to Save button – if you like to introduce one.
    Sorry if there’s something strange or needless. But it works for me ??

    <?php // FUNCTIONS FOR SAVING CART WITHOUT CHECKOUT ?>
    <?php
    function find_cart() {
    	global $user_ID, $wpdb;
    	$get_cart = $wpdb->get_row("SELECT * FROM custom_wp_wpsc_cart WHERE user_ID = " . $user_ID);
    	$found_cart = unserialize($get_cart->wpsc_cart);
    	return $found_cart;
    }
    
    function save_cart() {
    	global $wpsc_cart, $user_ID, $wpdb;
    	$saved_cart=serialize($wpsc_cart);
    	$is_cart=find_cart();
    	if ($is_cart) {
    		$wpdb->update('custom_wp_wpsc_cart',
    			array('wpsc_cart' => $saved_cart),
    			array( 'user_ID' => $user_ID ),
    			array('%s'),
    			array( '%d' )
    		);
    	}
    	else {
    		$wpdb->insert('custom_wp_wpsc_cart',
    			array('user_ID' => $user_ID,'wpsc_cart' => $saved_cart),
    			array('%d','%s')
    		);
    	}
    	$is_cart=find_cart();
    	return $is_cart;
    }
    
    global $wpsc_cart, $current_cart;
    if ($wpsc_cart && strpos(serialize($wpsc_cart),'sku') == false && (!isset($_POST['wpsc_ajax_action']) || isset($_POST['wpsc_ajax_action']) && $_POST['wpsc_ajax_action']!='empty_cart'))
    {
    	$wpsc_cart=find_cart();
    	$_SESSION['current_cart)']=$wpsc_cart;
    }
    if ($_SESSION['current_cart)'] && $_SESSION['current_cart)']!=$wpsc_cart)
    {
    	$_SESSION['current_cart)']=save_cart();
    }
    //if(isset($_POST['save_cart']))
    //	{ save_cart(); }
    ?>
    <?php // END FUNCTIONS FOR SAVING CART WITHOUT CHECKOUT ?>

    Put this code (to empty cart after checkout) in file plugins/wp-e-commerce/wpsc-includes/cart.class.php
    after line
    do_action('wpsc_save_cart_item', $cart_id, $this->product_id);

    // delete cart information from custom introduced db table
    global $user_ID;
    $wpdb->delete( 'custom_wp_wpsc_cart', array( 'user_ID' => $user_ID ), array( '%d' ) );

    plugins/wp-e-commerce/wpsc-theme/functions/wpsc-user_log_functions.php
    find function wpsc_user_profile_links
    here you can remove the line you don’t want to see

    $profile_tabs = apply_filters( ‘wpsc_user_profile_tabs’, array(
    ‘purchase_history’ => __( ‘Purchase History’, ‘wpsc’ ),
    ‘edit_profile’ => __( ‘Your Details’, ‘wpsc’ ),
    ‘downloads’ => __( ‘Your Downloads’, ‘wpsc’ )
    ) );

    for example

    $profile_tabs = apply_filters( 'wpsc_user_profile_tabs', array(
    	'purchase_history' => __( 'Purchase History', 'wpsc' ),
    	'edit_profile'     => __( 'Your Details', 'wpsc' )
    ) );

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 3 replies - 1 through 3 (of 3 total)