Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 删除“;从「;在电子商务中_Php_String_Wordpress_E Commerce - Fatal编程技术网

Php 删除“;从「;在电子商务中

Php 删除“;从「;在电子商务中,php,string,wordpress,e-commerce,Php,String,Wordpress,E Commerce,在Wordpress电子商务插件的产品页面中,无论只有一个价格,价格都列为“from…”。这给客户留下了不好的印象,因为这表明价格可能高于所列价格 我在PHP文件和语言文件中都搜索了这个“from”,但没有找到它。你们知道它在哪里吗?在产品模板.php文件行416中注释掉这一行 //$output = sprintf(__(' from %s', 'wpsc'), $output); 文件可在以下位置找到: wp-content\plugins\wp-e-commerce\wpsc-inclu

在Wordpress电子商务插件的产品页面中,无论只有一个价格,价格都列为“from…”。这给客户留下了不好的印象,因为这表明价格可能高于所列价格


我在PHP文件和语言文件中都搜索了这个“from”,但没有找到它。你们知道它在哪里吗?

产品模板.php文件行416中注释掉这一行

//$output = sprintf(__(' from %s', 'wpsc'), $output);
文件可在以下位置找到:

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

快乐编码

转到中product template.php的第416行

wp内容\插件\ wp-e-commerce\wpsc包括\

然而,与styks1987建议的注释掉整行内容不同,您只需删除“from”部分


如果您删除了整条产品线,那么如果产品只有一种尺寸,因此没有勾选变体,那么它根本不会显示价格。

WP电子商务的3.8.9版本包括一个过滤器,用于替换/删除“from”元素,更新安全补丁

$from_text = __( ' from %s', 'wpsc' );
$from_text = apply_filters( 'wpsc_product_variation_text', $from_text );
3.8.9中product-template.php的第436行


只需将此添加到当前活动主题文件夹中的functions.php文件:

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

切线,但不要使用WP电子商务。根据经验,这是我处理过的最困难的WP插件之一。除非你是附属于它,使用购物车66或其他适合的法案。
function wpsc_remove_variation_text( $from_text ) {
    $from_text = '%s';
    return $from_text;
}
add_filter( 'wpsc_product_variation_text', 'wpsc_remove_variation_text' );