Daniel
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Storefront] Missing files / 404s in last version 4.4.0I can also confirm that 4.4.1 resolves this issue! ??
Forum: Themes and Templates
In reply to: [Storefront] Missing files / 404s in last version 4.4.0The files were indeed missing from the assets/js folder. I resolved it by downloading the previous version and replacing the assets/js folder with the older one which contained the missing files.
Problem solved!Forum: Themes and Templates
In reply to: [Storefront] Missing files / 404s in last version 4.4.0Same here! The hero is not expanding or showing type as a result: https://testlab.dreamhosters.com
This is a bare theme, no plugins, but woocommerce.Thanks to the awesome help of Moksha, here’s the code to add product dimensions to the invoice…
Here's the code for your refernce: function add_product_dimensions( $product_name, $item ) { $product_id = $item['product_id']; $product = $item->get_product(); if ($product->has_dimensions()) { $dimensions = wc_format_dimensions( $product->get_dimensions(false) ); echo $product_name; echo '<br><strong>Dimensions: </strong>' . $dimensions; } else { echo $product_name; } } add_filter( 'wcdn_order_item_name', 'add_product_dimensions', 10, 2 );
- This reply was modified 1 year, 9 months ago by Daniel.
Thanks to the help of ChatGDP I was able to get the dimensions to print, but I’d like them to appear with each product rather than up by the weight… Is this possible?
Here’s the code I used:function invoice_custom_field( $fields, $order ) { $new_fields = array(); // print_r($order); if( get_post_meta( $order->get_id(), '_cart_weight', true ) ) { $new_fields['_cart_weight'] = array( 'label' => 'Order Weight', 'value' => get_post_meta( $order->get_id(), '_cart_weight', true ) ); } $items = $order->get_items(); foreach ($items as $item) $product = $item->get_product(); $dimensions = wc_format_dimensions( $product->get_dimensions(false) ); $fields[] = array( 'label' => 'Dimensions', 'value' => $dimensions, ); } return array_merge( $fields, $new_fields ); } add_filter( 'wcdn_order_info_fields', 'invoice_custom_field', 10, 2 );
Here’s how it shows:
Please help! ??
Hey Moksha,
Thanks again for your help with the cart weight, but I’m still working on displaying the “dimensions”, or at least the “width” of each product.
Using your sample code below I’ve tried the fields “dimensions” and “_dimensions” and also “width” and “_width”, and none seem to show up on the invoice after submitting a new order.
Am I using the wrong fields, or is something else missing?function invoice_custom_field( $fields, $order ) { $new_fields = array(); // print_r($order); if( get_post_meta( $order->get_id(), '_cart_weight', true ) ) { $new_fields['_cart_weight'] = array( 'label' => 'Order Weight', 'value' => get_post_meta( $order->get_id(), '_cart_weight', true ) ); } if( get_post_meta( $order->get_id(), '_dimensions', true ) ) { $new_fields['_dimensions'] = array( 'label' => 'Dimensions', 'value' => get_post_meta( $order->get_id(), '_dimensions', true ) ); } return array_merge( $fields, $new_fields ); } add_filter( 'wcdn_order_info_fields', 'invoice_custom_field', 10, 2 );
Thanks again for your help!! ??</img>
DanielMoksha! You sir are a ROCK STAR! ?? Thank you so much!! ??
- This reply was modified 1 year, 10 months ago by Daniel.
Hi Moksha,
I included the code I used above in functions.php
That code will put the total cart weight of new orders underneath the billing info.Is there a hook I can use so that it would display underneath the email in the invoice instead?
- This reply was modified 1 year, 10 months ago by Daniel.
Hi Moksha,
I have posted here to help the community, but I can send you an email if you prefer.
As mentioned in my original post, replacing ‘your_meta_field_name’ with ‘width’ did not work in this case.
Thanks!
DanielHello and thanks for your reply.
I’m not saying that excerpts CAN’T be translated. The problem is that they HAVE to be translated, manually.
It does not seem to automatically generate an excerpt from the translated post, but rather creates a new string for it.
Is this something you guys are aware of?If it helps I was able to display the weight as meta on the admin/order page with:
add_action( 'woocommerce_after_order_itemmeta', 'zlp_show_weight_admin_order_item_meta', 10, 3 ); function zlp_show_weight_admin_order_item_meta( $item_id, $item, $product ) { // Only "line" items and backend order pages if( ! ( is_admin() && $item->is_type('line_item') ) ) return; // IF PRODUCT OR IT'S VARIATION HAS WEIGHT if($product->get_weight()){ ?> get_weight())." ".get_option('woocommerce_weight_unit'); ?> <?php } }
Forum: Plugins
In reply to: [Contact Form 7] noticeSame here! Forms are all messed up too with big gaps between each line. Hoping for a quick fix soon!
Forum: Plugins
In reply to: [LiteSpeed Cache] Page Caching Not DetectedThis is what I was looking for! Look forward to the update!
Thanks!
Forum: Plugins
In reply to: [WooCommerce] Orders going from “Pending Payment” to “Complete”Figured it out. It’s because there was no actual product added to the order, only fees — hence nothing to process.
I created a generic product for custom orders… Problem solved,
Forum: Plugins
In reply to: [WooCommerce] Orders going from “Pending Payment” to “Complete”PS: I’m using “WooCommerce Stripe Gateway”