disable expire items for some categories
-
Hy there,
I custom your plugin for add the possibility for poeple to wrote product categories you want to apply the expire time.I don’t know if you want add this to the main plugin, but for me it’s very usefull.
Maybe it’s not the most elegant method and code for that but it’s works so I offert that to anybody need it.I just add in class-woocommerce-cart-stock-reducer.php this lines:
Line 37: $this->expire_cat = $this->get_option( 'expire_cat' ); Line 499: $item_id = $product->id; if ( has_term( array($this->expire_cat ), 'product_cat', $item_id ) ) { $this->expire_items = 'yes'; }else{ $this->expire_items = 'no'; } Line 1033: 'expire_cat' => array( 'title' => __( 'Expire Category', 'woocommerce-cart-stock-reducer' ), 'type' => 'text', 'description' => __( 'witch category you will with expire time', 'woocommerce-cart-stock-reducer' ), 'desc_tip' => true, 'placeholder' => '12, 15, 17', 'default' => '' ),
Maybe that can help some peoples and maybe you will find a most elegant code for that.
Thanks a lot for your plugin
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘disable expire items for some categories’ is closed to new replies.