orders

magento orders list query

前提是你 提交于 2019-12-30 01:38:09
问题 I want to select the list of all orders in Magento. This is required for me to show the list of all the orders from magento in another PHP application presently I'm working on. Also can some one write me the code using the Magento conventions such as Mage:: Im using Magento 1.4.2 version. Thanks, Mark 回答1: This code uses the "Magento way" and accesses the data through the Model layer which insulates you from changes in the table structure (e.g. flat vs EAV). Create a new PHP file containing

Add custom Product data dynamically as item meta data on the Order

风流意气都作罢 提交于 2019-12-29 08:08:09
问题 Is it possible to add a metadata on a product which is inside the Order? In this case, there would be one metadata but each product (in the order) would have different value. Example: Order 1: * Product 1 Sample Meta: Meta1 * Product 2 Sample Meta: Meta2 Thanks. Update1 : I'm now stuck on how would I grab the values from the woocommerce_add_cart_item_data filter. I was able to successfully add the meta data from there. I need to grab those values for me to use in this woocommerce_add_order

Set discount based on number of orders in WooCommerce

白昼怎懂夜的黑 提交于 2019-12-25 09:44:21
问题 In WooCommerce, how to set discount based on number of order? For example I would like to apply a discount based on customer orders: first order discount $50 second order discount $30 third order discount $10? I've search internet but not found any solution or plugins available. Thanks. 回答1: Here is a custom function hooked in woocommerce_cart_calculate_fees that will add to cart a custom discount based on customer orders count, this way: add_action('woocommerce_cart_calculate_fees' ,

Hide “free” orders in WooCommerce orders section from admin panel

北城以北 提交于 2019-12-25 09:25:03
问题 I have some events that are zero cost (free). But they are getting my orders page really full and confusing. Now in WooCommmerce orders admin panel, I want to hide all orders which have 0 as Price. Is there any hook or filter function available to achieve this? 回答1: You can remove Free order it by using parse_query filter with $pagenow global variable. add_filter('parse_query', 'wh_alterAdminPostList'); function wh_alterAdminPostList($query) { global $pagenow; if (is_admin() && $pagenow ==

Embed clickwork7 tracking code with the transaction ID in Woocommerce

喜你入骨 提交于 2019-12-25 02:16:35
问题 In Woocommerce, I was looking to get order ID just before payment, when the order is created. I found this answer below: Get the order ID in checkout page before payment process What I need is to pass in tracking script the transaction ID (as specified on the script) and I should be able to track in clickwork7 dashboard: <script type="text/javascript" src="https://clickwork7secure.com/p.ashx? o=45875&e=12995&f=js&t=TRANSACTION_ID"></script> But the transaction ID seems to be empty after a

Filter orders using a WP_Query from an array of orders IDs in WooCommerce

主宰稳场 提交于 2019-12-24 16:37:15
问题 I got an array of orders ID's and 'post__in' => $orders_ids to embed them in a WP_Query : $filters_orders = array( 'post_status' => 'processing', 'post_type' => 'shop_order', 'posts_per_page' => 10, 'post__in' => $orders_ids, 'orderby' => 'modified', 'order' => 'ASC' ); $loop = new WP_Query($filters_orders); while ($loop->have_posts()) { $loop->the_post(); $order = new WC_Order($loop->post->ID); <HERE_MY_CUSTOM_HTML_TABLE> } I am filtering "processing" order status only, but it doesn't work

Force display a zero fee in Woocommerce Orders and email notifications

人走茶凉 提交于 2019-12-24 13:35:40
问题 In Woocommerce, I am trying to get the display of a custom fee, when the fee amount is zero , to make it appear in the order detail table. Based on "Update fee dynamically based on radio buttons in Woocommerce checkout" answer code, I have manage to add a dynamic fee that is applied to cart and changes on customer delivery choice. Here is the working code that I have adapted for my needs: add_action( 'woocommerce_cart_calculate_fees', 'add_delivery_fee', 20, 1 ); function add_delivery_fee(

Woocommerce: Get order id after checkout page [duplicate]

て烟熏妆下的殇ゞ 提交于 2019-12-24 13:01:20
问题 This question already has answers here : How can I get the order ID in WooCommerce? (5 answers) Closed 9 months ago . I have purchased the Woocommerce Subscriptions plugin and i want to be able to get the order ID in checkout page. I want this, because when a subscription is about to end, an email with a payment link is sent to the customer and an order is automatically added. When customer clicks the link, it redirects to the checkout page in order to pay for the order. I need the order ID

WooCommerce order status hook not triggering

守給你的承諾、 提交于 2019-12-24 10:01:54
问题 I'm using this little function here to detect if an order is set into pending. This happens between the payment page and the payment provider notification: add_action( 'woocommerce_order_status_pending', 'status_pending' ); function status_pending( $related_job ) { error_log('Triggered'); } The problem is that I don't get any error log which shows me that the function work. But it becomes crazier. When I update the status via the dashboard from completed to pending, the log appears. So I've

Problem with woocommerce_add_order_item_meta

假如想象 提交于 2019-12-24 09:04:11
问题 i have spent the last 3 hours trying to fix a problem with a woocommerce deprecated hook and i'm going crazy because i have tried hundred different options to make it work, and it's not happening. This is the actual code, it suppose to save the value of custom fields. Any idea about how to make it work with a non obsolete hook? add_action('woocommerce_add_order_item_meta','save_in_order_item_meta', 10, 3 ); function save_in_order_item_meta( $item_id, $values, $cart_item_key ) { if( isset(