Index: /changelog
===================================================================
--- /changelog	(revision 8211)
+++ /changelog	(revision 8212)
@@ -555,4 +555,5 @@
 - Feature: standard3.phtml (Slider und Zoom)
 - Feature: PHP 8.2 kompatibilitÃ€t
+- Feature: Exportprofil kann nun stÃŒndlich mit dem Wordpress Cron ausgefÃŒhrt werden
 - Bugfix: ProduktgruppenÃŒbersichtsseite funktioniert ohne Lagerbestand
 - Bugfix: user_views Templates werden aus dem Child-Theme geladen
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 8211)
+++ /controller/wpsg_ShopController.class.php	(revision 8212)
@@ -226,6 +226,6 @@
                 
             }
-		    
-		    die("-");
+
+            $this->callMods('wpsg_hourly_hook');
 		    
         } // public function wpsg_daily_hook()
Index: /lib/functions.inc.php
===================================================================
--- /lib/functions.inc.php	(revision 8211)
+++ /lib/functions.inc.php	(revision 8212)
@@ -1,4 +1,23 @@
 <?php
-	
+
+    function wpsg_strftime($format, $timestamp) {
+
+        if (class_exists('IntlDateFormatter')) {
+
+            $formatter = new \IntlDateFormatter(
+                "de-DE",
+                IntlDateFormatter::FULL,
+                IntlDateFormatter::NONE
+            );
+
+            $dateTime = new DateTime();
+            $dateTime->setTimestamp($timestamp);
+
+            return $formatter->format($dateTime);
+
+        } else return strftime($format, $timestamp);
+
+    }
+
 	/**
 	 * PrÃŒfen ob Ajax-Request vorliegt
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 8211)
+++ /mods/wpsg_mod_basic.class.php	(revision 8212)
@@ -141,5 +141,8 @@
 			
 		} // public function render()
-		
+
+        /** Wird stÃŒndlich vom Wordpress Cron aufgerufen */
+        public function wpsg_hourly_hook() { }
+
 		/** Initiiert das Modul / Wird nur aufgerufen wenn das Modul aktiv ist */
 		public function init() { }
Index: /mods/wpsg_mod_export.class.php
===================================================================
--- /mods/wpsg_mod_export.class.php	(revision 8211)
+++ /mods/wpsg_mod_export.class.php	(revision 8212)
@@ -94,6 +94,11 @@
         } // public function __construct()
 
-        public function install()
-        {
+        public function wpsg_hourly_hook() {
+
+            $this->cron(true);
+
+        }
+
+        public function install() {
 
             require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
@@ -124,4 +129,5 @@
 		   	  	xml_customertag TEXT NOT NULL COMMENT 'Tagname des Kunden Elements (Kundenexport)',
 		   	  	file_encoding INT(1) NOT NULL COMMENT 'Encoding der Datei',		   	  	
+		   	  	wp_cron INT(1) NOT NULL COMMENT '1 wenn der Cron stÃŒndlich mit dem wp_cron aufgefÃŒhrt werden soll',
 		   	  	PRIMARY KEY  (id)
 		   	) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
@@ -151,6 +157,5 @@
         } // public function install() 
 
-        public function settings_edit()
-        {
+        public function settings_edit() {
 
             $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_export/settings_edit.phtml');
@@ -526,4 +531,5 @@
                     case 'cron_interval': $col = 'cron_interval'; break;
                     case 'cron_path': $col = 'cron_path'; $_REQUEST['value'] = wpsg_sinput("text_field", $_REQUEST['value']); break;
+                    case 'wp_cron': $col = 'wp_cron'; $_REQUEST['value'] = intval($_REQUEST['value']); break;
                     case 'xml_roottag': $col = 'xml_roottag'; break;
                     case 'xml_ordertag': $col = 'xml_ordertag'; break;
@@ -653,11 +659,10 @@
 	    }
 	    
-        public function cron()
-        {
+        public function cron($wp_cron = false) {
 
             // Alle Profile laden, die automatisiert aufgerufen werden
             $arProfile = $this->db->fetchAssoc("
 				SELECT
-					EXP.`id`, EXP.`cron_interval`, EXP.`cron_lastrun`, EXP.`orderfilter`, EXP.`cron_path`, EXP.`filename`, EXP.`format`, EXP.`export_type`
+					EXP.`id`, EXP.`wp_cron`, EXP.`cron_interval`, EXP.`cron_lastrun`, EXP.`orderfilter`, EXP.`cron_path`, EXP.`filename`, EXP.`format`, EXP.`export_type`
 				FROM
 					`".WPSG_TBL_EXPORTPROFILE."` AS EXP 
@@ -666,6 +671,7 @@
 			");
 
-            foreach ($arProfile as $profil)
-            {
+            foreach ($arProfile as $profil) {
+
+                if ($profil['wp_cron'] !== '1' && $wp_cron === true) continue;
 
                 if ($profil['cron_lastrun'] == '0000-00-00') $cron_lastrun = 0;
Index: /views/mods/mod_export/profil.phtml
===================================================================
--- /views/mods/mod_export/profil.phtml	(revision 8211)
+++ /views/mods/mod_export/profil.phtml	(revision 8212)
@@ -94,5 +94,25 @@
                     <?php echo wpsg_drawForm_Text(__('Cron URL', 'wpsg'), '<a href="'.site_url().'/?wpsg_cron=1">'.site_url().'/?wpsg_cron=1</a>', false, array('noP' => false)); ?>
                 </fieldset>
-                    
+
+                <?php echo wpsg_drawForm_Checkbox('wp_cron', __('StÃŒndlich mit Wordpress Cron ausfÃŒhren', 'wpsg'), ($this->view['profil']['wp_cron']??'0') === '1'); ?>
+
+                <script>
+
+                    document.getElementById('wp_cron').addEventListener('change', (event) => {
+
+                        jQuery.ajax({
+                            url: '<?php echo $inlineEdit_url; ?>',
+                            data: {
+                                name: 'wp_cron',
+                                value: ((event.target.checked === true)?'1':'0')
+                            }
+                        })
+
+                       // console.log('<?php echo $inlineEdit_url; ?>');
+
+                    });
+
+                </script>
+
                 <?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
                 <fieldset id="wpsg_mod_export_orderfilter" style="display:<?php echo (($this->view['profil']['cron_interval'] !== wpsg_mod_export::CRON_ORDER)?'block':'none'); ?>;">                                                
@@ -109,5 +129,5 @@
                                             
                         <?php $arMonth = array('-1' => __('Alle', 'wpsg')); ?>
-                        <?php for ($i = 1; $i <= 12; $i ++) { $arMonth[str_pad($i, 2, '0', STR_PAD_LEFT)] = strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); } ?>
+                        <?php for ($i = 1; $i <= 12; $i ++) { $arMonth[str_pad($i, 2, '0', STR_PAD_LEFT)] = wpsg_strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); } ?>
                         
                         <?php $arYearCdate = array('-1' => __('Alle', 'wpsg')); ?>
