0

need an insight from one of you good fellows.

Issue.

Woocommerce shop which on occasion gets multiple orders from the same customer on the same day. Customer pays full shipping charge on the first order. I have added a shipping method called (combine shipping) at $0 charge for following orders.

The issue that I face now is that random clients are selecting this (combine shipping) method in order to get free shipping "one wishes lol".

It consumes precious time as I have to advise them that they have selected the wrong shipping option.

I'm seeking a solution to this.

The perfect scenario would be:

When a customer selects the (combine shipping method). A dropdown field appears with the following field(s) for customer to complete:

  1. Order ID (placeholder text that states: what order ID to combine it with)

Conditions where:

  • Presumably, the customer is "logged-in" to the website and a record of the previous "Processing Status" order where paid "shipping method" is true are able to be displayed.

If filled field(s) does not match.

  • A message that states it does not match.

I hope this makes sense :)

I look forward to hear any options.

Cheers.

Gus Alves
  • 9
  • 4
  • _"I'm seeking a solution to this."_ - _"I look forward to hear any options."_ - Your question is [off-topic](https://stackoverflow.com/help/on-topic) because it is too broad, unclear, incomplete or is likely to be answered with opinions rather than facts and citations. It should be updated so it will lead to fact-based answers. For what it's worth, get started with [Extra carrier field for shipping methods in WooCommerce cart and checkout](https://stackoverflow.com/a/63195406/11987538) answer code and then modify your question with your code attempt and where you get stuck on – 7uc1f3r May 11 '22 at 19:31
  • Thanks for that. First timer here. Will do some improvement. – Gus Alves May 11 '22 at 22:51
  • After rereading your question. Isn't it an option to just hide the shipping method for customers who don't have a previous order? so to apply somewhat the reverse of what you describe – 7uc1f3r May 12 '22 at 10:22
  • This may be a good approach indeed. however how could apply "customers who don't have a previous order" in code? – Gus Alves May 22 '22 at 05:03
  • By using `wc_get_customer_order_count()`, get total orders by customer OR `wc_get_customer_last_order()`, get info about customer’s last order - and based on the result (which will be negative) continue – 7uc1f3r May 22 '22 at 05:10

0 Answers0