- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
遇到产品随机显示的客户网站问题
"This product is currently out of stock and unavailable."
问题是我们没有开启库存跟踪,所有产品都应该一直有库存。
当我进入 WordPress 管理员并单击产品的更新按钮(不更改任何内容)然后消息消失并且“添加到购物车”按钮按原样显示。不幸的是,这个问题将来会在这些项目上重复出现,要修复它,我必须再次更新产品(在 WooCommerce 设置中单击更新也可以暂时解决问题)。
我需要找到一种方法来永久解决此问题,以免它自行恢复。
网站详情:
我的尝试
_manage_stock
并将其设置为 no
(在我们的一些工作产品中观察到)0
(正如在我们拥有的一些工作产品中所观察到的)variable.php
中的 $available_variations
变量和class-wc-ajax.php
和 class-wc-product-variable.php
.在调试时,我注意到在工作的产品中,$available_variations
变量包含 2 个填充了产品信息的数组,但是在没有工作的产品上,它是一个空数组(导致variable.php
显示的缺货消息)。单击更新按钮,然后跟踪变量正确显示信息。
老实说,在这一点上我很茫然。我认为问题出在任何一个类的某个地方,但我无法判断。
还有其他人对此有疑问吗?解决这个问题的任何方法,这样我就不必继续为这个客户更新产品了。
链接到缺货的产品(发布时)http://highlandsministriesonline.org/product/basement-tapes/resentment-in-the-church-135/
链接到正确显示的产品http://highlandsministriesonline.org/product/basement-tapes/bt0111-church-at-corinth-i/
错误日志我在产品变体类中添加了一个错误日志。结果如下:
对于带有“缺货”消息的产品,日志中不会显示任何内容。
功能正常的产品示例:
WC_Product_Variation Object
(
[variation_id] => 1310
[parent] => WC_Product_Variable Object
(
[children] => Array
(
[0] => 1311
[1] => 1310
)
[total_stock] =>
[id] => 1308
[post] => WP_Post Object
(
[ID] => 1308
[post_author] => 1
[post_date] => 2012-04-03 14:29:42
[post_date_gmt] => 2012-04-03 18:29:42
[post_content] => This audio presentation on homeschooling is a Basement Tape conversation on homeschooling.
<h2>What are The Basement Tapes?</h2>
<em>The Basement Tapes</em> are conversations between Dr. R.C. Sproul Jr., Rev. Laurence Windham, their friends and special guests, on subjects related to the “good life,” a simple, separate, and deliberate life, lived out for the glory of God and for the building of His Kingdom.
You might even say that the Basement Tapes serve to help us develop a Christian worldview. Started in 2002, we now have over #140 conversations on all areas of life that we are seeking to think biblically about so that we might take dominion over them for the King and His kingdom.
<strong>Format: Available in both CD and MP3</strong>
<strong>Length: Sixty minutes</strong>
[post_title] => Basement Tape #109: Homeschooling Redux
[post_excerpt] => It's been 108 weeks since we last talked about the subject of homeschooling our children. Our tykes have grown into teenagers. What have we learned in the past nine years? What has changed? What remains the same is that homeschooling means discipleship; passing down your most important convictions to your children and teaching them our holy religion.
[post_status] => publish
[comment_status] => open
[ping_status] => closed
[post_password] =>
[post_name] => bt0109-homeschooling-reducks
[to_ping] =>
[pinged] =>
[post_modified] => 2014-07-07 11:08:46
[post_modified_gmt] => 2014-07-07 15:08:46
[post_content_filtered] =>
[post_parent] => 0
[guid] => http://50.57.190.158/?post_type=product&p=1308
[menu_order] => 0
[post_type] => product
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
[product_type] => variable
)
[variation_data] => Array
(
[attribute_pa_audio-options] => mp3-download
)
[variation_has_length] =>
[variation_has_width] =>
[variation_has_height] =>
[variation_has_weight] =>
[variation_has_stock] =>
[variation_has_sku] => 1
[variation_shipping_class] =>
[variation_shipping_class_id] =>
[variation_has_tax_class] =>
[variation_has_downloadable_files] => 1
[id] => 1308
[post] => WP_Post Object
(
[ID] => 1308
[post_author] => 1
[post_date] => 2012-04-03 14:29:42
[post_date_gmt] => 2012-04-03 18:29:42
[post_content] => This audio presentation on homeschooling is a Basement Tape conversation on homeschooling.
<h2>What are The Basement Tapes?</h2>
<em>The Basement Tapes</em> are conversations between Dr. R.C. Sproul Jr., Rev. Laurence Windham, their friends and special guests, on subjects related to the “good life,” a simple, separate, and deliberate life, lived out for the glory of God and for the building of His Kingdom.
You might even say that the Basement Tapes serve to help us develop a Christian worldview. Started in 2002, we now have over #140 conversations on all areas of life that we are seeking to think biblically about so that we might take dominion over them for the King and His kingdom.
<strong>Format: Available in both CD and MP3</strong>
<strong>Length: Sixty minutes</strong>
[post_title] => Basement Tape #109: Homeschooling Redux
[post_excerpt] => It's been 108 weeks since we last talked about the subject of homeschooling our children. Our tykes have grown into teenagers. What have we learned in the past nine years? What has changed? What remains the same is that homeschooling means discipleship; passing down your most important convictions to your children and teaching them our holy religion.
[post_status] => publish
[comment_status] => open
[ping_status] => closed
[post_password] =>
[post_name] => bt0109-homeschooling-reducks
[to_ping] =>
[pinged] =>
[post_modified] => 2014-07-07 11:08:46
[post_modified_gmt] => 2014-07-07 15:08:46
[post_content_filtered] =>
[post_parent] => 0
[guid] => http://50.57.190.158/?post_type=product&p=1308
[menu_order] => 0
[post_type] => product
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
[product_type] => variation
[product_custom_fields] => Array
(
[_sku] => Array
(
[0] => BT0109MP3
)
[_price] => Array
(
[0] => 3
)
[_sale_price] => Array
(
[0] =>
)
[_weight] => Array
(
[0] =>
)
[_length] => Array
(
[0] =>
)
[_width] => Array
(
[0] =>
)
[_height] => Array
(
[0] =>
)
[_stock] => Array
(
[0] =>
)
[_thumbnail_id] => Array
(
[0] => 0
)
[_virtual] => Array
(
[0] => yes
)
[_downloadable] => Array
(
[0] => yes
)
[_download_limit] => Array
(
[0] =>
)
[_downloadable_files] => Array
(
[0] => a:1:{s:32:"a0a87d43e69ed9de646ba479c252c9fb";a:2:{s:4:"name";s:29:"109-Homeschooling-Reducks.mp3";s:4:"file";s:113:"http://highlandsministriesonline.org/wp-content/uploads/woocommerce_uploads/2012/04/109-Homeschooling-Reducks.mp3";}}
)
[_regular_price] => Array
(
[0] => 3
)
[_sale_price_dates_from] => Array
(
[0] =>
)
[_sale_price_dates_to] => Array
(
[0] =>
)
[_download_expiry] => Array
(
[0] =>
)
[attribute_pa_audio-options] => Array
(
[0] => mp3-download
)
)
[sku] => BT0109MP3
[downloadable_files] => a:1:{s:32:"a0a87d43e69ed9de646ba479c252c9fb";a:2:{s:4:"name";s:29:"109-Homeschooling-Reducks.mp3";s:4:"file";s:113:"http://highlandsministriesonline.org/wp-content/uploads/woocommerce_uploads/2012/04/109-Homeschooling-Reducks.mp3";}}
[downloadable] => yes
[virtual] => yes
[sale_price_dates_from] =>
[sale_price_dates_to] =>
[price] => 3
[regular_price] => 3
[sale_price] =>
[total_stock] => 0
[dimensions] =>
)
可能的后续步骤如果我无法解决此问题,我的下一个想法是编写一个脚本,该脚本将每晚通过并更新网站上的每个产品(因为临时修复似乎有效至少我们的 24 个)。虽然如果我可以节省一些时间,我宁愿不要其他人能够永久解决这个问题。
2014 年 10 月 23 日更新
尽管尝试了以下答案,但此问题仍然存在。我创建了一个日志插件,希望能帮助跟踪缺货消息的频率,并希望能帮助将消息与网站上发生的任何操作关联起来。它目前是针对这个特定网站定制的,但我正在开发一个版本来与大家分享,这样即使我找不到答案,也有人可以。
最佳答案
我遇到了同样的问题,我想我已经解决了。我使用 CSV 导入/导出套件来导出我的所有变体。您会注意到 stock 设置为 0
,而它的值应该是 null
。
你有两个选择:
关于php - WooCommerce 产品在实际上没有缺货时显示 “Out of stock” 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24639288/
所以我一直在寻找一种方法,当数量字段大于 0 时,将库存可用性更改回有库存。当您将数量设置为 0 并保存产品时,系统已经自动将库存可用性更改为缺货.当您将数量设置为大于 0 并保存产品时,我想要一种将
我对 Java 非常陌生,我试图理解为什么这段代码的 Magic 类的 main 方法的输出是“TT”。我们的教授说我们不必理解这个方法的含义,只要回答输出即可。 代码是这样的。 public cla
Magento 2:获取产品库存数量和其他库存信息 如何在magento 2中获取产品库存数量和信息 最佳答案 如果我们查看 StockItemRepository 类 get方法需要参数 $stoc
我有声明(或类似的) std::map &stocks; 贯穿我的代码。 Eclipse 不喜欢这样并产生“无效的模板参数”错误。 库存声明为: class Stock { public:
在 Admin Woocommerce 产品页面上,对于可变产品,在“变体”设置中,对于所有产品变体,我希望默认启用 Manage Stock 选项,并使用 Stock Quantity 选项设置为
我一直在学习向Gtk进行开发,并且在线上的大多数示例都建议使用Gtk.stock图标。但是,使用它会产生警告,表明它已被弃用,我找不到这些图标的替代品。 代码示例为: open_button:
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 9年前关闭。 Improve this que
在 GWT Stock Watch 教程中,它似乎每 4 秒轮询一次服务器以获取新数据。这是 GWT 的标准工作方式还是可以使用推送类型技术,以便在服务器上引发新事件时调用客户端代码? 最佳答案 这是
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
我似乎在我的系列数据散列中可以拥有的数据点数量受到某种限制。我正在像这样创建我的数据哈希: var data_hash = []; var limit = 1000; for(var i = 0; i
股票初始值为 1 流量为0.1 Stock1 初始值为 0。 当我运行模拟时,我意识到股票的值(value)低于 0(获得负值)。当 Stock 的值达到零时如何停止流动。 最佳答案 一个应该有一个非
我在程序中执行用户定义方法时遇到问题,如果有人能帮助我就好了 package Ex_9_2; public class TestStock { public static String price;
例如,当我想在普通消息应用程序中将图像附加到文本消息时,我会看到一个熟悉的系统对话框,其中显示相机、图库和其他图像内容提供程序。 我想在我自己的应用程序中使用它。我看到很多库允许用户在 Gallery
我正在开发自行车库存。我将Cycles cid,title, desc etc存储在CYCLE表中,并在另一个STOCK(sid,cid,qty)中存储库存。现在我知道自行车可以有多种颜色(黑色、红色
#include #include #include using namespace std; class Product { string title; string sirN
题目地址:https://leetcode.com/problems/online-stock-span/description/ 题目描述 Write a class StockSpanner
我需要将“ # in stock ”文本更改为“ # Deals left ”。 我将以下代码添加到 function.php 文件中,但这会删除实际数字。 add_filter( 'woocomme
我无法从 Alpha Vantage TIME_SERIES_DAILY、TIME_SERIES_DAILY_ADJUSTED 或 TIME_SERIES_INTRADAY 获取任何 NASDAQ 数
http://en.wikipedia.org/wiki/MetaStock 有人知道如何将 metastock 数据格式转换为 ASCII/CSV 格式吗? 任何示例代码(c++/c#)都会有很大帮
我是一名优秀的程序员,十分优秀!