price

Getting the correct variation price from order items in Woocommerce 3

房东的猫 提交于 2019-12-13 20:12:45
问题 Im trying to get the correct price for each item variation however it only seems to be getting the first price of that product variation. Not sure how to solve this. Code: $query = new WC_Order_Query( array( 'status' => 'on-hold', 'orderby' => 'date', 'order' => 'DESC', 'return' => 'ids', ) ); $order_ids = $query->get_orders(); foreach( $order_ids as $order_id ) { $order = new WC_Order($order_id); foreach ($order->get_items() as $item_id => $item_obj) { $_product = wc_get_product($item_obj[

Set a min unit displayed price for variable products in Woocommerce

送分小仙女□ 提交于 2019-12-12 19:24:50
问题 I'm building a webshop in WooCommerce for selling Medical Gloves. They are being sold by unit, by box or by palet. When you buy by box or palet, you get a lower unit price. I've been playing around for a while but I can't seem to get the configuration just how I want. Let me give an example first. Product A: Price per unit: €1,90. Price per unit when buying a box: €1,76 (120 units). Price per unit when buying a pallet: €1,63 (2880 units). What i would like is the following: - on the archive

Text after sale price showing FROM and TO dates in Woocommerce

浪子不回头ぞ 提交于 2019-12-12 18:32:20
问题 I am using Customs product price on sale displayed with date limit in Woocommerce 3+ to make a custom formatted price display on products on sale that have a limitation period. Now I am trying to include also the "from" date. How can I get and include the from date in this code? Any track is really useful and appreciated. 回答1: The following code will handle both on sale date from and on sale date to in your price custom display (require both from and to dates) : add_filter( 'woocommerce_get

Prestashop 1.6 - free shipping based on final total price

人盡茶涼 提交于 2019-12-11 12:01:55
问题 I am using prestashop 1.6. My site is offering "free shipping" for purchases over 80 bucks . My site is also having a promotion of "Buy 1 get 1 free". Now, one item can cost about 60 bucks and I insisted the customer to buy 2 products from the same category in order to be entitled for buy 1 get 1. If a customer buys one product, it should cost 60 bucks (no free shipping because final price < 80) If a customer buys 2 = 120 bucks but after the "buy 1 get 1 free" promotion, the final total price

JavaScript; How to set dot after three digits?

一曲冷凌霜 提交于 2019-12-11 08:18:16
问题 I have the following JavaScript code: var calculation = $('select[name=somevalue1] option:selected').data('calc')-($('select[name=somevalue1] option:selected').data('calc')/100*$('select[name=somevalue2] option:selected').data('calc'))-($('select[name=somevalue1] option:selected').data('calc')-($('select[name=somevalue1] option:selected').data('calc')/100*$('select[name=somevalue2] option:selected').data('calc')))/100*$('select[name=somevalue3] option:selected').data('calc'); $('#calculation'

Custom cart item price when applying coupon for a category in Woocommerce

妖精的绣舞 提交于 2019-12-11 05:08:46
问题 We have some products in shop , and we are giving some coupons to customer . product -> ABC price 10 coupon code is 'newcp' discount 20%; so when people add the product to cart price will be 10 . Then they apply coupon then original product price shown as 10 and calculate 20% from that and at the end the total will be 8 But now we need to change this as per specific condition When people apply product coupon newbc 1)if coupon is newcp , then change order_item_price as order_item_price +3 [

Change price location on single product pages

隐身守侯 提交于 2019-12-11 04:48:39
问题 This is something that has been doing my head in and I can't seem to find exactly what I want on here. I am trying to move the price on my product pages to display just above or beside the add to cart button. Page link for a product is here I have played around with this before, and managed to create a second price in the position I wanted, but still had the original price at the top and couldn't get rid of it. How can I achieve this? Thanks 回答1: This will work just for simple products as

Enable back price suffix to a function that display customized product prices in WooCommerce

删除回忆录丶 提交于 2019-12-11 04:27:12
问题 I am using "Enable sale price for logged users and regular price for unlogged users in Woocommerce" first function code, that hides sales price. That way I can use sales price and regular price for logged in vs none logged in users and it Works like a charm. The Problem I have is that it also kills the woocommerce_price_suffix field from the settings and I want to include it in my function, but don't know how. 回答1: The following will add back the price suffix: //Variable and simple product

Change all product prices from a specific product tag in Woocommerce 3

一笑奈何 提交于 2019-12-11 02:59:07
问题 I used a function to be able to markup all product automatically without having to use SQL or manually do it as they get re-uploaded and updated very frequently. The function works perfectly other than the has_term if statements. They work in the Wordpress backend and apply the pricing rules as soon as I add the tag, but when I try to add the product to cart it reverts back to the original price in the cart and checkout pages. If I remove that if statement it works with no issues. I need a

Catalog Price Rules “Apply Rules” programmatically

偶尔善良 提交于 2019-12-11 02:55:57
问题 I have created one Catalog Price Rule Programmatically it works fine. so my issue is, I need to do login with admin and need click button of "Apply Rules" other wise discount is not apply in magento store, so i need "Apply Rules" programmatically and i have no idea about it how to do. Any help or suggestion will be appreciated. 回答1: You can Apply Rules using the below code with Newly created Catalogrule ID $rule = Mage::getModel('catalogrule/rule')->load($ruleId); Mage::getResourceModel(