开发者

Removing "from" in WP eCommerce

In the prod开发者_开发百科uct page listing on Wordpress' eCommerce plugin, the prices are listed as "from.." no matter if there's only one price. This gives a bad impression to the customer because it signals that the price will probably be above what is listed.

I have searched for this "from" in both the PHP files and language files but haven't found it. Do any of you know where it is?


The 3.8.9 release of WP e-Commerce includes a filter for replacing/removing the 'from' element, update safe fix.

$from_text = __( ' from %s', 'wpsc' );
$from_text = apply_filters( 'wpsc_product_variation_text', $from_text );

Line #436 of product-template.php in 3.8.9

...

function wpsc_remove_variation_text( $from_text ) {
$from_text = '%s';
return $from_text;
}
add_filter( 'wpsc_product_variation_text', 'wpsc_remove_variation_text' );


Comment out this line in your product-template.php file line 416

//$output = sprintf(__(' from %s', 'wpsc'), $output);

File can be found at

wp-content\plugins\wp-e-commerce\wpsc-includes\

Happy coding!


You go to line 416 of the product-template.php in

wp-content\plugins\wp-e-commerce\wpsc-includes\

However, instead of commenting out the entire line, like styks1987 suggested, you just remove the part that says ' from '.

If you remove the entire line, then if the product comes in one size and the variations are thus not ticked, it does not show a price at all.


Just add this to functions.php file that is inside your currently active theme folder:

function wpsc_remove_variation_text( $from_text ) {
    $from_text = '%s';
    return $from_text;
}
add_filter( 'wpsc_product_variation_text', 'wpsc_remove_variation_text' );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜