stock

woocommerce stock notification priority

一世执手 提交于 2019-12-02 09:22:24
I am trying to arrange the order of the product summary such that price comes after stock notification which comes after short description. I am aware of the priorities as defined in content-single-product.php /** * woocommerce_single_product_summary hook. * * @hooked woocommerce_template_single_title - 5 * @hooked woocommerce_template_single_rating - 10 * @hooked woocommerce_template_single_price - 10 * @hooked woocommerce_template_single_excerpt - 20 * @hooked woocommerce_template_single_add_to_cart - 30 * @hooked woocommerce_template_single_meta - 40 * @hooked woocommerce_template_single

Modify code to get synthetic data that trends smoothly from bull to bear market cycles

a 夏天 提交于 2019-12-02 07:24:16
问题 I have this class that generates synthetic looking (stock) data and it works fine. However, I want to modify it so that NewPrice generates smooth trending data for say n-bars . I know that if I reduce the volatility, I get smoother prices. However, not sure how to guarantee that the data goes into alternating persistant trend either up/down. A sine wave looking thing, but with stock looking prices, i.e, no negative prices. Price = Trend + Previous Price + Random Component I am missing the

Allow backorders and notify customer for specific product categories in Woocommerce

廉价感情. 提交于 2019-12-02 06:07:51
IN woocommerce I'm trying to add some code in functions.php to allow backorder for specific product categories. But the code doesn't works. How can I allow backorders and notify customer for specific product categories in Woocommerce? Updated Try the following (where you will set your product category(ies) in the array for each function) : add_filter( 'woocommerce_product_is_in_stock', 'filter_product_is_in_stock', 10, 2 ); function filter_product_is_in_stock( $is_in_stock, $product ){ // Here set the products categories in the array (can be terms ids, slugs or names) $categories = array(

getFinancials (quantmod) and tq_get (tidy quant) not working?

六月ゝ 毕业季﹏ 提交于 2019-12-02 05:48:45
问题 I'm getting the same error in both quantmod and tinyquant for financials data. Can anyone see if this is reproducable? Is this a google finance server issue? None of the below functions have been working for me.I'm not sure if it's me or the server. tq_get("AAPL", get= "financials") [1] NA Warning message: x = 'AAPL', get = 'financials': Error in thead[x]:thead[x + 1]: NA/NaN argument and: getFin("AAPL") Error in thead[x]:thead[x + 1] : NA/NaN argument Can somebody help? 回答1: Yes I get the

getFinancials (quantmod) and tq_get (tidy quant) not working?

若如初见. 提交于 2019-12-01 23:39:46
I'm getting the same error in both quantmod and tinyquant for financials data. Can anyone see if this is reproducable? Is this a google finance server issue? None of the below functions have been working for me.I'm not sure if it's me or the server. tq_get("AAPL", get= "financials") [1] NA Warning message: x = 'AAPL', get = 'financials': Error in thead[x]:thead[x + 1]: NA/NaN argument and: getFin("AAPL") Error in thead[x]:thead[x + 1] : NA/NaN argument Can somebody help? Yes I get the same issue for the past couple of days as well. I think it may have to do with a change on the part of Google

Reduce stock only for specific order statuses and payment method in Woocommerce

那年仲夏 提交于 2019-12-01 07:38:00
问题 I'm working on a bit of custom Woocommerce functionality for a client. They use the BACS payment gateway to handle manual payments. However, the gateway currently reduces the stock too early for our needs, i.e., when the order is "On Hold". I would like to ONLY reduce the stock when the order is marked "Processing" or "Complete" (avoiding duplicate reductions). I have manged to prevent the stock from reducing itself while "on hold" with the following snippet: function wcs_do_not_reduce_onhold

Reduce WooCommerce Item Inventory By Attribute Value

ε祈祈猫儿з 提交于 2019-12-01 00:22:30
I have a setup with Woocommerce "Variable Products" where the only variation is 'size' attribute: 15 grams, 100 grams, 250 grams. What I want to do is use that variation amount to pass to the Woo wc-stock-functions, so that when a product variation '15 grams' is purchased, the overall stock goes down by 15, not 1. Inside Woo, there is file wc-stock-functions ( http://hookr.io/plugins/woocommerce/3.0.6/files/includes-wc-stock-functions/ ) - and this even gives a filter, woocommerce_order_item_quantity. I want to use this to multiply the inventory number by the # of grams, and to reduce

Allow backorders and notify customer for parent product categories in Woocommerce

99封情书 提交于 2019-11-29 17:19:44
With woocommerce, I used some code based on my previous thread: Allow backorders and notify customer for specific product categories in Woocommerce add_filter( 'woocommerce_product_is_in_stock', 'filter_product_is_in_stock', 10, 2 ); function filter_product_is_in_stock( $is_in_stock, $product ){ // Here set the products categories in the array (can be terms ids, slugs or names) $categories = array("clothing"); if( has_term( $categories, 'product_cat', $product->get_id() ) ){ $is_in_stock = true; } return $is_in_stock; } add_filter( 'woocommerce_product_backorders_allowed', 'filter_products

D3 json stock chart not displaying

僤鯓⒐⒋嵵緔 提交于 2019-11-29 12:59:02
Can't seem to properly fetch the data from JSON. My chart is not even able to be displayed. Any ideas on how i can fix this? <svg width="960" height="500"></svg> <script src="https://d3js.org/d3.v4.min.js"></script> <script> var svg = d3.select("svg"), margin = {top: 20, right: 20, bottom: 30, left: 50}, width = +svg.attr("width") - margin.left - margin.right, height = +svg.attr("height") - margin.top - margin.bottom, g = svg.append("g").attr("transform", "translate(" + margin.left + "," + margin.top + ")"); var parseTime = d3.timeParse("%d-%b-%y"); var x = d3.scaleTime() .rangeRound([0, width

Charts for stock analysis applications

孤人 提交于 2019-11-28 20:57:49
I'm trying to build a stock analysis application and it uses 3 kinds of charts Area Charts Candlestick Charts Combination Charts Currently i am doing this by using JQuery & Google charts and as u can see below its pretty awesome: But now , i was annotations on these charts . I've put up another question here on StackOverflow asking if something can be annotated on Google charts . But here , i'm asking if there are any other charts that i can use which supports these 3 types of charts AND allows me to annotate (draw shapes at positions) on them. please help :( I have to deliver this in a week !