Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to show large image in checkout page right now it showing 31x31 size image in wpsc-shopping_cart_page and using <img src="<?php echo wpsc_cart_item_image(); ?> to call thumbnail image.

what should i do for that?

enter image description here

share|improve this question

closed as off-topic by Pieter Goosen, kaiser Nov 22 at 9:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers 3

I agree with Goran on editing the core files. It should not be done. But, if a user has dimensions in the name of the image, they will also be replaced and the image won't display with this regular expression. Instead, you can create a new function in your theme's functions.php file. Something like this:

function wpsc_cart_item_image2( $width = 95, $height = 95 ) {
    global $wpsc_cart;
    $cart_image = wpsc_the_product_thumbnail( $width, $height, $wpsc_cart->cart_item->product_id, "shopping_cart");
    if( is_ssl() )
        $cart_image = str_replace( 'http://', 'https://', $cart_image );
    return $cart_image;
}

Then, make sure you copy wpsc-shopping_cart_page.php to your theme directory and replace

wpsc_cart_item_image();
with
wpsc_cart_item_image2();
Or, use a regular expression that gets the last instance of an image size.

share|improve this answer

I suggest you not to hack core files because of updates. Rather transfer WPEC files to your theme folder and then in wpsc-shopping_cart_page.php file add following above image call

<?php
$imgurl = wpsc_cart_item_image();
$image = preg_replace('&(-[0-9]{1,4}x[0-9]{1,4})&is', '', $imgurl);
?>

then call original image with <?php echo $image; ?>

regards

share|improve this answer
up vote 1 down vote accepted

here is the solution i find myself with just 4 easy step

1. go to wp ecommerce plugin folder
2. find cart.class.php file
3. find wpsc_cart_item_image function
4. change $width and $height accordingly
share|improve this answer
1  
If I make the above changes - how do I ensure that it doesn;t get overwitten with an upgrade? –  user22824 Oct 23 '12 at 16:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.