WordCamp Tokyo2016 LTに登壇します!



WordCamp Tokyo 2016 LT 登壇決定!

WordCamp Tokyoとは世界の約25%のサイトで使われているCMS(簡単に言うとブログのシステム)WordPressの国内最大規模のカンファレンスです。

LT(ライトニングトーク)という5分間のプレゼンでEasy Digital DownloadsというWordPressでダウンロード商品の販売ができるプラグインについて話してきます。


Store close without deactivate cart button. EDD Store Hours Plugin.

Easy Digital Downloads EDD store Hours Plugin is control your store open and close.

But this plugin deactivate cart button when close setting is active.

This is inconvenience when you want to test cart button , So I try to custom this plugin.

To be Cart button active even when store is closed

Paste the following code in functions.php of your wordpress theme.

This code can be active cart button even when store is closed.

remove_filter( 'edd_purchase_download_form', 'edd_store_hours_override_purchase_button', 200, 2 );
remove_action( 'edd_pre_add_to_cart', 'edd_store_hours_override_add_to_cart', 200, 2 );

Judgement store conditional using edd_store_hours_is_closed function

<?php if(edd_store_hours_is_closed()): ?>
<!-- This content is displayed when store is closed -->
<?php else: ?>
<!-- This content is displayed when store is open -->
<?php endif; ?>

If you use this method , you can store close without deactivate cart button.