skip to Main Content

I was wondering if is there any simple solution to a problem that we face.

  • I am managing an underwear website and we have single packs and packs of 3. Many new customers are ordering the 3 packs and if the size doesn’t fit they want to return. All returns are disposed so it’s quite a loss that we want to prevent.

So what we’d like to do is to show a specific message to people who added the 3 packs in cart without making any previous purchases. Saying that we suggest they try a single pack first to see if the size will fit.

What is the best way to go around this.

All help is much appreciated.

Thanks

3

Answers


  1. pack of three is your variation of the same product. Like how you will identify that this is single or this is pack of three

    I supposed that you have created the variation of that product. So check on cart page that is there any variation product of three is added in cart if yes then add a message on cart that please try the one piece first

    Login or Signup to reply.
  2. From a UX point of view, would it be better to display this on the product page when they’re choosing to purchase 1 or a pack of 3? If the customer receives this message at the cart stage then they will have to go back into the product and amend their order.

    You could display it on the product page using something like this:

        add_action( 'woocommerce_before_variations_form', 'underwear_size_notice' );
      
        function underwear_size_notice() {
        global $product;
        if ( ! is_user_logged_in() ) return;
        $current_user = wp_get_current_user();
        if ( ! wc_customer_bought_product( $current_user->user_email, $current_user->ID, $product->get_id() ) ) 
        echo '<div class="size_notice">If this is your first time purchasing our underwear we would recommend a single pack so you can check the size is a correct fit.</div>';
    }
    
    Login or Signup to reply.
  3. function show_notification_for_subscription(){
    global $woocommerce;
    $cat_check = false;
    foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
      $product = wc_get_product( $cart_item['product_id'] );
      if ( $product->get_type()=='variation') {
         $cat_check = true;
         break;
      }
    }
    if ( $cat_check ) {
       $subscription_notification = 'add your message here';
           echo '<div class="checkout-subs-notification">'.$subscription_notification.'</div>';
    }
     }
    add_action('woocommerce_before_checkout_form','show_notification_for_subscription',10);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search