如何让 Javascript 在 WP-Ecommerce Javascript 上工作以进行产品输入?
我们已经安装了 Wordpress (3.2.1) 和 WP ecommerce (3.8.6.1) 版本,我注意到在产品编辑器(管理界面内)中有很多不再工作的小工具,我相信它已经与 Javascript 冲突有关。
不再工作的小工具有:
并非产品输入页面上方的所有媒体按钮列表均可见
唯一的媒体按钮可见的应该在厚盒中启动媒体浏览器;然而它并没有这样做,它只是在同一个窗口中打开媒体浏览器,对于不懂技术的人来说几乎无法使用。
视觉选项卡按钮根本不可选,只能选择 HTML
“Howdy {user}”消息和所有其他内容drop-downs通常是一个下拉菜单;但这不再有效。
这些错误不会出现在其他页面上,只会出现在产品编辑器页面上。
我尝试过:
注释掉 /wp-e-commerce/wpsc-admin/admin.php 中的每个 JS 文件,看看它是否有任何区别
使用 Firebug 浏览并尽可能禁用每个 JS 文件,以查看其效果。
但是,我仍然无法找到问题出在哪里,或者如何解决它。
我正在使用全新安装的 Wordpress 和最新下载的 WP-Ecommerce。唯一活跃的插件是 WP-Ecommerce
对此的任何帮助都会很棒。谢谢。
问题的图片如下。
[出于安全目的删除图像]
更新:9 月 23 日 @ 13:15 BST
我引用的 admin.js 文件位于: /wpsc-admin/js/admin.js
在 admin.js 文件中,Chrome 的开发人员工具抱怨错误:
jQuery("a.thickbox").livequery(function(){
tb_init(this);
admin.js:458 Uncaught ReferenceError: tb_init is not defined
});
另外,它报告了这些错误:
post-new.php:997 Uncaught ReferenceError: switchEditors is not defined
post-new.php:998 Uncaught ReferenceError: switchEditors is not defined
我也相信 /wpsc-admin/includes/display-item-functions。 php 文件与错误/问题有关。
如果我注释掉以下所有 JavaScript 就会突然起作用。
function wpsc_filter_delete_text( $translation, $text, $domain ) {
// If I comment this out the JS works.
// If left uncommented the JS does not work
/*
if ( 'Delete' == $text && isset( $_REQUEST['post_id'] ) && isset( $_REQUEST["parent_page"] ) ) {
$translations = &get_translations_for_domain( $domain );
return $translations->translate( 'Trash' ) ;
}
return $translation;
*/
}
我将继续调查,看看问题出在哪里。
We have installed version of Wordpress (3.2.1) and WP e-commerce (3.8.6.1) and I have noticed that in the product editor (within the admin interface) has a lot of gadgets that no longer work and I believe it has to do with a Javascript conflict.
The gadgets that no longer work are:
Not all the list of media buttons above the product entry page are visible
The only media button that is visible should launch the media browser in a thickbox; however it does not do this, it simply opens the media browser in the same window and is pretty un-usable for non-tech savvy people.
The Visual tab button is not selectable at all, only HTML is selectable
The "Howdy {user}" message and all the other drop-downs is usually a drop-down menu; but this no longer works.
These bugs do not appear on other pages, and only on the product editor page.
I have attempted to:
Comment out every JS file inside /wp-e-commerce/wpsc-admin/admin.php and seeing if it makes any difference
Use Firebug to go through and disable each JS file as and where possible to see what effect it has.
However, I am still unable to find where the problem is, or how to fix it.
I am using a clean install of Wordpress and the latest download of WP-Ecommerce. The only plugin active is WP-Ecommerce
Any help on this would be great. Thanks.
A picture of the issues are below.
[IMAGE REMOVED FOR SECURITY PURPOSES]
Update: 23 Sep @ 13:15 BST
The admin.js file I refer to is in:
/wpsc-admin/js/admin.js
In the admin.js file, Chrome's Developer Tools are complaining of an error:
jQuery("a.thickbox").livequery(function(){
tb_init(this);
admin.js:458 Uncaught ReferenceError: tb_init is not defined
});
Also, it reports these errors:
post-new.php:997 Uncaught ReferenceError: switchEditors is not defined
post-new.php:998 Uncaught ReferenceError: switchEditors is not defined
I also believe the /wpsc-admin/includes/display-item-functions.php file has something to do with the bug/issue.
If I comment out the following all the Javascript suddenly works.
function wpsc_filter_delete_text( $translation, $text, $domain ) {
// If I comment this out the JS works.
// If left uncommented the JS does not work
/*
if ( 'Delete' == $text && isset( $_REQUEST['post_id'] ) && isset( $_REQUEST["parent_page"] ) ) {
$translations = &get_translations_for_domain( $domain );
return $translations->translate( 'Trash' ) ;
}
return $translation;
*/
}
I am going to continue my investigation to see where the problem is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信我已经解决了问题。
虽然上述解决方案确实有效,但它会产生一个问题,即其他小工具(例如变体)将无法再按预期工作。
经过大量的尝试、错误和拉扯头发后,我升级到最新版本(3-8-7-rc1)并再次尝试,这确实有效,但并不适合所有情况/场合。
显然,根据论坛帖子< /a> 我在Getshopped网站上创建的,这是一个内存分配问题。如果您查看“编辑产品”页面的源代码,您会发现在输出“产品下载”元框时它突然被切断。
不管怎样,升级似乎暂时解决了这个问题。
谢谢。
I believe I have resolved the problem.
Whilst the above solution does work, it creates a problem where other gadgets like the variations will not work anymore as intended.
After a lot of trial and error and pulling of hair, I upgraded to the latest version (3-8-7-rc1) and tried again, this does work but isn't ideal for all instances/occasions.
Apparantly, according to the forum thread I created on the Getshopped website, it is a memory allocation issue. If you view the source of the Edit Product page, you’ll see that it’s suddenly cut off when outputting the 'Product Download' metabox.
Anyway, upgrading seems to have solved the problem for now.
Thanks.