Home Forums Plugins Add to Wishlist Support [Resolved] Fatal Error on Wishlist Page

Welcome to our community support forums! We're here to help - but if you have an urgent request for a Pro Plugin, you will get a prioritised response through our Premium Support page.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9080
    tnunemac
    Participant

    I’m trying to use Add to Wishlist v1.8.5 with WP eCommerce v3.8.7.6.2. When I add a product to the wishlist, then view the wishlist, I get the following fatal error:

    Fatal error: Call to undefined function wpsc_vl_product_price() in […]/wp-content/plugins/wp-e-commerce-add-to-wishlist/templates/store/wpsc-account_wishlist.php on line 35

    A full search of all Add to Wishlist files doesn’t turn up a function declaration for wpsc_vl_product_price(). Please advise?

    #9105
    jackharrybill
    Participant

    Again I have had to add a hack to make this work… in includes/common.php the plugin states that this function is going to be added, but glancing through the code it isn’t, so I added the following lines

    if( !function_exists( ‘wpsc_vl_product_price’ ) ) {
    function wpsc_vl_product_price($id) {
    return “”;
    }
    }

    *They do nothing* so no price will be returned, but it stops the plugin crashing… hopefully these bugs will be fixed soon?

    #9117
    amy_oneal
    Participant

    I also have this problem, a real fix would be good that actually does something

    #9121
    jackharrybill
    Participant

    I have actually created a fix that works but it was a hack and I can’t offer support if it doesn’t work

    in common.php replace the above code with

    if( !function_exists( ‘wpsc_vl_product_price’ ) ) {

    function wpsc_vl_product_price($product_id) {
    $args = array (
    ‘post_type’ => ‘wpsc-product’,
    ‘p’ => $product_id
    );
    $products = new WP_Query($args);
    while ( $products->have_posts() ) : $products->the_post();
    $price = get_product_meta( get_the_ID(), ‘price’, true );
    $special_price = get_product_meta( get_the_ID(), ‘special_price’, true );
    if ( ($special_price > 0) && (($price – $special_price) > 0) ){$theprice = $special_price;}else{$theprice = $price;}
    endwhile;
    // Reset Post Data
    wp_reset_postdata();
    return $theprice;
    }
    }

    and in wpsc-account_wishlist.php within the templates/store folder replace line 35 to 39 inclusive (I think) with

    product_id )); ?>

    #9122
    jackharrybill
    Participant

    should be

    product_id )); ?>

    #9123
    jackharrybill
    Participant

    Bugger, won’t let me post the code… try replacing the line at 37 with

    echo wpsc_currency_display(wpsc_vl_product_price( $favourite->product_id ));

    within the php tags

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Fatal Error on Wishlist Page’ is closed to new replies.