WooCommerce Product Scheduler integration – 2

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate WooCommerce Product Scheduler integration – 2

Viewing 8 reply threads
  • Author
    Posts
    • #14540
      Lourenco.cf
      Participant

      Original thread – http://wclovers.com/forums/topic/woocommerce-product-scheduler-integration/

      I resolved to open the topic with the same subject, to divulge to everyone how easily I resolved.

      Add one ACF data picker field, for end date.
      Next add to the fuctions.php a cron scheduler, some like these..
      When read the date from the custom acf field, put the product in draft.. our can delete… our something.
      Easy.

      
      // expire products on date field.
      if (!wp_next_scheduled('expire_posts')){
        wp_schedule_event(time(), 'daily', 'expire_posts'); // this can be hourly, twicedaily, or daily
      }
      
      add_action('expire_posts', 'expire_posts_function');
      
      function expire_posts_function() {
      	$today = date('Ymd');
      	$args = array(
      		'post_type' => array('product'), // post types you want to check
      		'posts_per_page' => -1 
      	);
      	$posts = get_posts($args);
      	foreach($posts as $p){
      		$expiredate = get_field('end_date', $p->ID, false, false); // get the raw date from the db
      		if ($expiredate) {
      			if($expiredate < $today){
      				$postdata = array(
      					'ID' => $p->ID,
      					'post_status' => 'draft'
      				);
      				wp_update_post($postdata);
      			}
      		}
      	}
      }
      

      You can tweak the code to publish the product to…
      Only add another field “start date”.

      Thank you

    • #14544
      WCfM Forum
      Guest

      Hi,

      Again I don’t know how to say you thanks for this!!

      I am sorry because old post automatically closed after certain time.

      It’s pleasure for me to have a user like you.

      Thank you very much mate !!

      Shhiv

    • #14551
      memtimintursun
      Participant

      This is reply for the closed topic; http://wclovers.com/forums/topic/questions-before-but-this/

      Whatever I do, it doesn’t work. I did many times what you said.

      I am almost giving up this if this doesn’t work for me.

    • #14560
      WCfM Forum
      Guest

      Hi,

      I am sorry as topics are automatically closed for a certain period inactivity!!

      Please tell me what kind of issues you are now facing?

      What can I do for you ?

      Thank You

    • #14567
      memtimintursun
      Participant

      EbayImport shows on menu, when you click it, not found page. but it was working on 3.17 version, after you updated to 3.20 version, it’s gone, no more working. when I am asking, you saying same things, it should work, do this, that. but with out you saying it, I did already tried those steps. but it’s not working.

      shortly, is there possible to include custom menu and for that menu addon from woocommerce?

      I want to give this possibilities only for paid memebers. however, even I can’t integrate it in the free version, what is point to buy ultimate version, if it doesn’t work?

      for that reason, I am almost giving up.

    • #14576
      WCfM Forum
      Guest

      Hi,

      I am not sure why it’s not working for you!!

      But if such things not working for WCFM then it’s all add-ons are going to be useless.

      WCFM only offers five main menus – Product, Order, Coupon and Settings

      But all other menu items are added externally using add-ons, you can check any of our demos.

      I want to resolve this for you, if you can share a demo access with me then I will take a look in depth of this.

      Thank You

    • #14584
      memtimintursun
      Participant

      Did you mean “demo admin” or “demo vendor”?

    • #14586
      WCfM Forum
      Guest

      Demo admin prferred!!

      Thanks for your cooperation ..

    • #14629
      WCFM Forum
      Keymaster

      Hi @memtimintursun,

      I am closing this thread as it’s context something else.

      Please share your site access not here, at mail – wclovers.contact@gmail.com

      Looking forward to hear from you soon.

      Thank You

Viewing 8 reply threads
  • The topic ‘WooCommerce Product Scheduler integration – 2’ is closed to new replies.