Support » Plugin: Giftable for WooCommerce » Gift Out Of Stock Notice

  • Resolved abluedeveloper

    (@abluedeveloper)


    Would it be possible to show all gift options but say 1 out of 3 gifts is out of stock to still show the product but inform the user the item is out of stock?

    I wanted to create an ad campaign to promote free gifts etc but only have like 10 to give away. I can use stock qnt to manage stock count which is great but I’d really like to let users know 1 of the gifts is out of stock instead of not showing them anything.

    And maybe customers would assume that the gift is still open. Which mean mad customers when they don’t get their free gift.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I also tried putting a little note in the plugin settings telling customers if they don’t see a gift it’s out of stock.

    But on some items Say I only want 1 gift open but it’s out of stock it hides the whole area so I can’t even tell the customers it’s out of stock.

    PS great plugin. Thanks for the effort into it.

    Plugin Author DecomTeam

    (@decomteam)

    Hi, @abluedevelope,
    For now, there isn’t a way to leave item/gift visible when its “out-of-stock”, also we don’t have plans to integrate that feature/option.

    – Maybe to add global notification about gifts, or sidebar with slider/carousel (in stock and out of stock items)

    [ Signature deleted ]

    Thanks for getting back so quick. I guess this is a corner case but I’d need to be able to inform customers if we’ve sold out of a gift.

    I was able to put together a fix for use case with a nice little table on my cart page’s sidebar.

    Orginal Code from https://stackoverflow.com/questions/32837586/how-to-display-stock-quantity-of-a-product-in-text-in-woocommerce

    I modified it so it would output text if the given item is out of stock.

    If anyone’s interested here’s the code, put it in your functions.php
    Usage is [product_stock id=”16235″] where the id is the wordpress id not product sku.

    
    
    add_shortcode('product_stock', 'product_stock');
    function product_stock( $atts ) {
      if ( ! $atts['id'] ) {
        return '';
      }
      $product = get_product($atts['id']);
      if ($product->stock < 1){
            return 'Gift Out Of Stock'; // Message to show if gift is out of stock.
      }
    else {
      return 'Only ' .  $product->stock . ' Left'; // prints 22, ie the qty of product 1592
      }
    }
    
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gift Out Of Stock Notice’ is closed to new replies.