Benjamin Pau
Forum Replies Created
-
Is it possible?
Hi Yordan, thank you for your patience with me so far. I think I may have created a misunderstanding, please give me the chance to rectify this.
- The customer is not able to select the shipping method.
- The flat rate option is selected by default if the Minimum Order Amount is not achieved.
- I intend to pull the Minimum Order Amount for Free Shipping of the Shipping Zone where the customer is based.
I’ve modified the code snippet given to the one below to suit my purpose.
add_action( 'woocommerce_checkout_create_order', 'save_free_shipping_amount_based_on_zone' ); function save_free_shipping_amount_based_on_zone( $order ) { $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping_method = reset( $chosen_shipping_methods ); // Get the first selected method // Get the customer's shipping zone $customer_shipping_zone = WC_Shipping_Zones::get_zone_matching_package( array( 'destination' => $order->get_shipping_address(), ) ); // Find the free shipping method within the customer's zone $free_shipping_method = null; foreach ( $customer_shipping_zone->get_shipping_methods() as $method ) { if ( $method->id !== $chosen_shipping_method ) { // Skip the chosen method if ( $method->id === 'free_shipping' ) { // Check for Free Shipping specifically $free_shipping_method = $method; break; } } } // If a free shipping method is found in the zone, get its minimum amount if ( $free_shipping_method ) { $min_amount = $free_shipping_method->settings['min_amount']; $order->update_meta_data( '_free_shipping_min_amount', $min_amount ); $order->save(); } }
Unfortunately I am unable to display the Minimum Order Amount with the updated second half of the code snippet that you have provided.
/** * PDF Invoices & Packing Slips for WooCommerce: * Show the free method minimum amount (if exists) before the document notes */ add_action( 'wpo_wcpdf_before_document_notes', 'wpo_wcpdf_free_shipping_min_amount', 10, 2 ); function wpo_wcpdf_free_shipping_min_amount ( $document_type, $order ) { if ( $document_type == 'invoice' ) { $min_amount = wc_price( $order->get_meta( '_free_shipping_min_amount' ) ); echo "<p>Free shipping minimum order amount: {$min_amount}</p>"; } }
Please advise where I have gone wrong. Thanks in advance Yordan.
- This reply was modified 11 months ago by Benjamin Pau.
I’ve installed the plugin Store Toolkit for WooCommerce and didn’t found the meta key _free_shipping_min_amount created and saved to the test order.
Hi Yordan, thanks for your help in advance. I’ve tried the code snippets provided above but unfortunately the amount returned is 0. Seems like the updated code snippet to display the statement and amount is working. The free delivery amount data saved within the order is not for some reason.
Pardon me, I assumed it was the field name that I’ve set as “availability”. According to the doc link that you have shared in your reply. I have installed the plugin Store Toolkit for WooCommerce. I went into my own order but I can’t seem to find anything related to my custom field “availability” in the Order Items Meta section…
Hi Yordan,
I’ve tried using the below. But nothing is displayed.
/** * Add product availability */ add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_product_custom_field', 10, 3 ); function wpo_wcpdf_product_custom_field ( $document_type, $item, $order ) { if ( $document_type == 'invoice' ) { if (empty($item['product'])) return; $field_name = 'availability'; $availability = $item['product']->get_meta($field_name,true,'edit'); if (!empty($availability)) { echo '<div class="product-availability">Availability: '.$availability.'</div>'; } } }
I have different shipping zones with different Minimum Order Amount required for free shipping. I intend to pull those in regards to the location of the user as WooCommerce has determined with the Flat Rate shipping set in table. Is there a way to do this?
Forum: Plugins
In reply to: [SEO that Matters] Meta Title & Description FieldsYes you certainly have! Thank you very much for your help!
Hi Tobias,
Thanks for the code! It works!
Regards,
BenHi Tobias,
I have tried using
@media screen and (max-width: 768px) { .tablepress tr { margin-top: 20px; } }
in the CSS section of Elementor Pro in my Single Products template but seems like it is not working.
Regards,
BenHi Tobias,
Unfortunately my site is blocked off for visitors/bots that are outside of my country with Cloudflare. Is it okay that I post a screen shot of what I mean?
The top picture is on desktop and the bottom is on mobile. I want to separate the rows on mobile with some spacing to differentiate the specification based on volume of the bin.
Best regards,
Benjamin PauThanks for the reply Tobias! It works!
I have another question. What do I need to do to separate the stacked rows while in mobile using your Responsive Extension plugin?
Best regards,
Ben- This reply was modified 2 years, 2 months ago by Benjamin Pau.
Thanks for the reply @tobiasbg ! Guess I’ll have to make use of horizontal header instead.
I have one more question that I would like to ask. How can I stylize the table name? I have tried using
.tablepress-table-name .tablepress-table-name-id-1
but my CSS doesn’t work on it.
Forum: Plugins
In reply to: [NP Quote Request for WooCommerce] Add To Quote Button Not DisplayingSeems like the problem is solved with the button showing up when JS Combine External & Inline option is enabled as shown here.
Forum: Plugins
In reply to: [NP Quote Request for WooCommerce] Add To Quote Button Not DisplayingTried to exclude the JS related while enabling the JS Minify & Combine via the Tuning settings found in Litespeed Cache > Page Optimization > Tuning but the problem persists. Tried to exclude the CSS too as shown in the picture here but nothing changed.
Not sure if I have done it wrong, I’m not good at this but I can try. Would appreciate if anyone could point out where I have gone wrong in this if I had. Thanks in advance.