Erro in Disable Purchase During OFF Time

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.

From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Feature Request Erro in Disable Purchase During OFF Time

This topic contains 13 replies, has 4 voices, and was last updated by Avatar sumitrathaurrs 1 week, 5 days ago.

  • Author
    Posts
  • #76126
    Avatar
    Marcelo Ribeiro
    Participant

    error in store hours, the “Disable Purchase During OFF Time” function is not working. I set the store hours, but it is still possible to buy the product when the store is closed.

  • #76244
    WCFM Forum
    WCFM Forum
    Keymaster

    Hi,

    Kindly show me store hours setting screenshot.

    Thank You

  • #76308
    Avatar
    Marcelo Ribeiro
    Participant
    This reply has been marked as private.
  • #76370
    WCFM Forum
    WCFM Forum
    Keymaster

    Hi,

    Thanks for the details.

    But how you have set 24 hours format time for Store Hours? It’s not supported!

    Check this – https://www.loom.com/share/429f8656ccbd4704b40c842e7442ee0b

    Thank You

  • #76427
    Avatar
    Marcelo Ribeiro
    Participant

    I understand now but not mine is not exposed the AM PM

    Attachments:
    You must be logged in to view attached files.
  • #76432
    Avatar
    Marcelo Ribeiro
    Participant

    How do I get back to normal ?

  • #76453
    Avatar
    Marcelo Ribeiro
    Participant

    I changed the wordpress time format, in the settings is still 24 but in the display this is AM PM

    Attachments:
    You must be logged in to view attached files.
  • #77404
    WCFM Forum
    WCFM Forum
    Keymaster

    Please re-save store hours setting once for the vendor.

  • #139574
    Avatar
    sumitrathaurrs
    Participant

    store hours is not working for variable products…
    i am using OceanWP theme.

    • #139811

      Hello,

      Can you explain a little more what do you mean by “store hours is not working for variable products” ?
      We have already checked that if “Disable Purchase During OFF Time” is enabled then “Add to cart” button will not display (variable product as well).

      Thanks.

  • #139855
    Avatar
    sumitrathaurrs
    Participant
    This reply has been marked as private.
  • #139858
    Avatar
    sumitrathaurrs
    Participant
    This reply has been marked as private.
  • #139952

    Hello,

    Try this code in your theme’s functions.php –

    function woocommerce_template_single_add_to_cart() {
    	global $product,$WCFM, $WCFMmp;
    	 $product_id = $product->get_id();
    	if( $product_id ) {
    		$vendor_id = wcfm_get_vendor_id_by_post( $product_id );
    	}
    	if( $vendor_id ) {
    		$is_store_close = $WCFMmp->wcfmmp_store_hours->wcfmmp_is_store_close( $vendor_id );
    			if( !$is_store_close ) {
    				do_action( 'woocommerce_' . $product->get_type() . '_add_to_cart' );
    			}
    	} else {
    		do_action( 'woocommerce_' . $product->get_type() . '_add_to_cart' );
    	}	
    }

    Thanks.

  • #143462
    Avatar
    sumitrathaurrs
    Participant
    This reply has been marked as private.

You must be logged in to reply to this topic.