anahitipoint
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] is_on_sale() function did not work in cart sectionI mean that what i need to do with the price when variable product?
How do i get the active variation id and its price?
Thanks!
Forum: Plugins
In reply to: [WooCommerce] is_on_sale() function did not work in cart sectionSeems i found a way for simple products
<?php if($_product->is_on_sale() && $_product->is_type('simple')){ ?> <div class="sale_price_viewinpercentage"> <div class="productItem_sale_percentage_wrap"> <span class="productItem_sale_triangle"></span> <p class="sale_percentage_number"> <?php $percentage = round((($_product->regular_price - $_product->sale_price ) / $_product->regular_price ) * 100); echo $price . sprintf( __('%s', 'woocommerce' ), $percentage . '<span class="main_sale_percentage_sign">%</span></p>'); ?> </div> <div class="triangles_wrap"> <div class="left_triangle"></div> <div class="right_triangle"></div> </div> </div> <?php } ?>
But i don’t know what to do for the variable product.
Any idea?
Forum: Plugins
In reply to: [WooCommerce] is_on_sale() function did not work in cart sectionYes it is in cart.php so in context of a cart item for sure.
So how i can check and add the sale price percentage in cart section?
Thanks in advance.
Hey it is not a custom code.
I just need to get active variation price per avaliable product variations so i can do some calculations with current sale and regular price.
Is there a way to get active variation price?
Thanks!
If it sends the email to billing info field so it will be a plce where that field is specified.
can you help me to find that place where the email is sent to billing_email field please?
Thanks!
Forum: Plugins
In reply to: [WooCommerce] How i can get Loggedin user Order All details with product infoEven when am using the following
$order = wc_get_order($orderItem->ID); echo '<pre>'; var_dump($order->shipping); echo '</pre>';
Am getting nothing.
I tried with get_formatted_shipping_address() i see it but it is missing one field which i added in custom way.
Forum: Plugins
In reply to: [WooCommerce] How i can get Loggedin user Order All details with product infoI tried the following
$ordertwo = new WC_Order($orderItem->ID); var_dump($ordertwo->shipping);
I also tried with formatted_shipping_address but it returns empty
Am i doing anything wrong?
Thanks in advance.
Forum: Plugins
In reply to: [WooCommerce] How i can get Loggedin user Order All details with product infoThat ok i figured out.
Am trying to get the shipping address per order but am confused where that data is stored? How i can get that data billing, shipping info of the user per order?
Thanks in advance.
Forum: Plugins
In reply to: [WooCommerce] How i can get Loggedin user Order All details with product infowhat about getting the date? how i can get it without time?
Forum: Plugins
In reply to: [WooCommerce] How i can get Loggedin user Order All details with product infoHere is my current code
<?php $customer_orders = get_posts(array( 'numberposts' => -1, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => 'shop_order', 'post_status' => array_keys(wc_get_order_statuses() ), )); $loop = new WP_Query($customer_orders); foreach ($customer_orders as $orderItem){ $order = wc_get_order($orderItem->ID); echo '<div class="orderItem"><div class="order_date"><span>Order Placed</span> <br/> '.$orderItem->post_date_gmt.'</div>'; foreach ($order->get_items() as $key => $lineItem) { //echo '<pre>'; //var_dump($lineItem); //echo '</pre>'; echo '<div class="order_total">'.$lineItem['line_total'].'</div>'; } echo '</div>'; } ?>
Forum: Plugins
In reply to: [WooCommerce] How i can get Loggedin user Order All details with product infoI understand why it was duplicating. I need to get the total summary but within the provided array i only see _line_total but it is not the total.
How i can get the total price for the order?
Also i wanna get order date without time and in d/m/y format – i tried $orderItem->post_date and it returns with time also not in the format which i putted in Wp menu->General->Tiemzone. Why?
Thanks in advance.
Forum: Plugins
In reply to: [WooCommerce] How i can get Loggedin user Order All details with product infoYes i see. Now i customised my code like this but something is wrong
foreach ($customer_orders as $orderItem){ $order = wc_get_order($orderItem->ID); foreach ($order->get_items() as $key => $lineItem) { // echo '<pre>'; // var_dump($lineItem); // echo '</pre>'; echo '<div class="orderItem"><div class="order_date"><span>Order Placed</span> <br/> '.$orderItem->post_date_gmt.'</div> <div class="order_total">'.$lineItem['_line_total'].'</div></div>'; } }
It did not display the total when echoing. Also i get double order items as i think i have foreach in foreach. So how i can combine this all please?
Thanks in advance.
Forum: Plugins
In reply to: [WooCommerce] How i can get Loggedin user Order All details with product infoI had done the following
<?php $customer_orders = get_posts(array( 'numberposts' => -1, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(), 'post_type' => 'shop_order', 'post_status' => array_keys(wc_get_order_statuses() ), )); $loop = new WP_Query($customer_orders); foreach ($customer_orders as $orderItem){ $order = wc_get_order($orderItem->ID); echo '<pre>'; var_dump($order); echo '</pre>'; echo '<div class="orderItem"><div class="order_date"><span>Order Placed</span> <br/> '.$orderItem->post_date_gmt.'</div> <div class="order_total">'.$order->line_total.'</div></div>'; } ?>
But still can’t get the Order Details like Products, quanitiy, totals etc.
What am i missing pls?
Many thanks!
Hi,
Please any idea how i can solve this and add that custom created email field so what email will be used within that field order info will be sent to that email?
Thanks in advance.
Cause per my design I don’t have Billing info, form.
Am displaying Only the Shipping form and that’s why i added the email field and need to send an email to user depending on that field.
Is that possible to add?
Am i doing something wrong?
Thanks in advance.