quimo72
Forum Replies Created
Viewing 8 replies - 1 through 8 (of 8 total)
-
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Customize Packing SlipsOk thanks
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Customize Packing SlipsOk thanks. For the other request?
It’s a big improvement. Thanks a lot.
Hi Marco, thanks.
I used this:$variations = $product->get_available_variations(); for ($j = 0; $j < count($variations); $j++) { $dummy = wc_get_product($variations[$j]['variation_id']); if ($dummy->is_on_sale()) { $discount_price = $discount->kuantokusta_product_node_variation_current_price($dummy->get_price(), $product, $dummy); $discount_price = number_format((float)$discount_price, 2, ',', '') . get_woocommerce_currency_symbol(); break; } }
- This reply was modified 6 years ago by quimo72.
I used this approach:
$discount = new WC_Taxonomy_Discounts_Webdados(); $variations = $product->get_available_variations(); for ($j = 0; $j < count($variations); $j++) { $dummy = wc_get_product($variations[$j]['variation_id']); if ($dummy->is_on_sale()) { $discount_price = $discount->kuantokusta_product_node_variation_current_price($dummy- $discount_price = number_format((float)$discount_price, 2, ',', ''); break; } }
It’s correct?
It would be convenient to invoke a function to display the discounted price of a variant based on the ID of a product. Thanks.
Is there a way (a class method) to get the discounted price of a product?
How can I get the variation price with the discount applied?
Actually I use this code:$variations = $product->get_available_variations(); for ($j = 0; $j < count($variations); $j++) { $dummy = wc_get_product($variations[$j]['variation_id']); if ($dummy->is_on_sale()) { $this->data[$i]['badge'] = 'shoppaua_on_sale'; /* show the badge on the template */ $this->data[$i]['discounted_price'] = ???? break; } }
$dummy->sale_price
returns “”
Viewing 8 replies - 1 through 8 (of 8 total)