Index: /changelog
===================================================================
--- /changelog	(revision 7578)
+++ /changelog	(revision 7579)
@@ -264,2 +264,3 @@
 #4.1.5
 - Bugfix: Korrekte Nounce ÃberprÃŒfung beim Sprung von der BestellÃŒbersicht in ein Produkt
+- Feature: Produktartikel - Positionsspalte in Backend sichtbar und sortierbar
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7578)
+++ /controller/wpsg_ShopController.class.php	(revision 7579)
@@ -2049,5 +2049,6 @@
 			$produkt = $this->cache->loadProduct($produkt_id);
 			
-			if ($loadDisabled === false && wpsg_isSizedInt($produkt['disabled'])) return array();
+			// Im Backend muss die loadArray durchlaufen werden, da die Pos Spalte fÃŒr die Sortierung benÃ¶tigt wird
+			if ($loadDisabled === false && wpsg_isSizedInt($produkt['disabled']) && !is_admin()) return array();
 			
 			if (!wpsg_isSizedArray($produkt)) throw new \wpsg\Exception('Produkt (ID:'.$produkt_id.') konnte nicht geladen werden.');
Index: /model/wpsg_product.class.php
===================================================================
--- /model/wpsg_product.class.php	(revision 7578)
+++ /model/wpsg_product.class.php	(revision 7579)
@@ -20,6 +20,5 @@
 		 * LÃ€dt die Daten des Produkts
 		 */
-		public function load($product_id, $loadedData = false)
-		{
+		public function load($product_id, $loadedData = false) {		 
 
 			parent::load($product_id);
@@ -27,6 +26,5 @@
 			$this->data = $this->db->fetchRow("SELECT P.* FROM `".WPSG_TBL_PRODUCTS."` AS P WHERE P.`id` = '".wpsg_q($product_id)."' ");
 
-			if ($this->shop->isOtherLang())
-			{
+			if ($this->shop->isOtherLang()) {
 
 				$trans_produkt = $this->db->fetchRow("
@@ -704,4 +702,10 @@
 		}
 		
+		public function getMenuOrder() {
+			
+			return $this->loadedData['menu_order'];
+			
+		}
+		
 		/* Statische Funktionen */
 
@@ -980,8 +984,7 @@
 			else $strQueryORDER = " P.`id` ";
 
-            if ($bJoinPost)
-            {
+            if ($bJoinPost) {
                 
-                $strQueryJOIN .= " LEFT JOIN `".$GLOBALS['wpsg_sc']->prefix."posts` AS PP ON (PP.`wpsg_produkt_id` = P.`id`) ";
+                $strQueryJOIN .= " LEFT JOIN `".$GLOBALS['wpsg_sc']->prefix."posts` AS PP ON (PP.`wpsg_produkt_id` = P.`id` AND PP.`post_type` = '".wpsg_q($GLOBALS['wpsg_sc']->get_option('wpsg_mod_produktartikel_pathkey'))."' ) ";
                 
             }
Index: /mods/wpsg_mod_produktartikel.class.php
===================================================================
--- /mods/wpsg_mod_produktartikel.class.php	(revision 7578)
+++ /mods/wpsg_mod_produktartikel.class.php	(revision 7579)
@@ -106,6 +106,5 @@
         }
     
-        public function be_ajax()
-        {
+        public function be_ajax() {
 
             if (wpsg_isSizedString($_REQUEST['do'], 'setWPMLPathKey'))
@@ -126,6 +125,5 @@
                 $arProductIDs = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_PRODUCTS."` ", "id");
     
-                if (wpsg_isSizedArray($arProductIDs))
-                {
+                if (wpsg_isSizedArray($arProductIDs)) {
     
                     // Ich lÃ¶sche alle Posts zu denen es die Produkte nicht mehr gibt
@@ -145,7 +143,5 @@
                     $this->shop->addBackendMessage(__('Zuordnungen werden neu aufgebaut. Bitte schlieÃen Sie die Seite nicht bis der Vorgang abgeschlossen ist.', 'wpsg'));
     
-                }
-                else
-                {
+                } else {
     
                     $this->shop->update_option('wpsg_mod_produktartikel_rebuild', null);
@@ -157,7 +153,5 @@
                 $this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_produktartikel');
     
-            }
-            else if (wpsg_isSizedString($_REQUEST['do'], 'rebuild'))
-            {
+            } else if (wpsg_isSizedString($_REQUEST['do'], 'rebuild')) {
     
             	ob_start();
@@ -179,6 +173,5 @@
                     $_REQUEST['wpsg_produktartikel_menuorder'] = wpsg_getStr($post_data['menu_order'], '');
     
-                    if (wpsg_isSizedInt($product_data['lang_parent']))
-                    {
+                    if (wpsg_isSizedInt($product_data['lang_parent'])) {
     
                         $_REQUEST['wpsg_lang'] = $product_data['lang_code'];
@@ -186,7 +179,5 @@
                         $this->produkt_save_translation($product_data['lang_parent'], $product_data['id']);
     
-                    }
-                    else
-                    {
+                    } else {
     
                         $this->produkt_save($product_data['id']);
@@ -846,5 +837,6 @@
                     'url' => get_permalink($post_id),
                     'comment_status' => $comment_status,
-                    'arCat' => $arCat
+                    'arCat' => $arCat,
+					'menu_order' => $post_data['menu_order']
                 ));
     
@@ -1031,16 +1023,33 @@
     
             $post_id = $this->db->fetchOne("
-                    SELECT
-                        `id`
-                    FROM
-                        `".$this->shop->prefix."posts`
-                    WHERE
-                        `wpsg_produkt_id` = '".wpsg_q($product_id)."' AND
-                        `post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
-                ");
+				SELECT
+					`id`
+				FROM
+					`".$this->shop->prefix."posts`
+				WHERE
+					`wpsg_produkt_id` = '".wpsg_q($product_id)."' AND
+					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."'
+			");
+            
+            // SÃ€ubern und sicherstellen, das es nur einen Post je Produkt gibt
+			$arPostDoubleIDs = $this->db->fetchAssocField("
+				SELECT 
+					`id` 
+				FROM 
+					`".$this->shop->prefix."posts` 
+				WHERE
+					`wpsg_produkt_id` = '".wpsg_q($product_id)."' AND
+					`post_type` = '".wpsg_q($this->shop->get_option('wpsg_mod_produktartikel_pathkey'))."' AND
+					`id` != '".wpsg_q($post_id)."' 
+			");
+			 
+			foreach ($arPostDoubleIDs as $double_post_id) {
+				
+				\wp_delete_post($double_post_id);
+				
+			}			
     
             if (wpsg_isSizedInt($post_id) && $update !== true) return $post_id;
-            else
-            {
+            else {
     
                 // Hier wird der CustomPost Type angelegt
@@ -1430,3 +1439,2 @@
     } // class wpsg_mod_produktartikel extends wpsg_mod_basic
 
-?>
Index: /views/produkt/index.phtml
===================================================================
--- /views/produkt/index.phtml	(revision 7578)
+++ /views/produkt/index.phtml	(revision 7579)
@@ -159,4 +159,7 @@
                         <th class="manage-column column-title wpsg_pic_col"></th>
                         <th class="wpsg_order" data-order="name"><?php echo __("Name", 'wpsg'); ?></th>
+						<?php if ($this->hasMod('wpsg_mod_produktartikel')) { ?>
+						<th class="wpsg_order" data-order="pos"><?php echo __('Pos.', 'wpsg'); ?></th>
+						<?php } ?>
                         <th class="wpsg_order" data-order="anr"><?php echo __("Artikelnummer", 'wpsg'); ?></th>
     					                
@@ -256,10 +259,9 @@
                             </div>
                         </td>
-                        <td><?php echo wpsg_hspc($d['anr']); ?></td>
-                        <?php /* if ($this->hasMod('wpsg_mod_produktartikel') && $this->get_option('wpsg_mod_produktartikel_positionnumber') == '1') { ?>
-                        	<td>
-                        	<?php  ?>
-                        	</td>                     	
-                        <?php } */ ?>
+						<?php if ($this->hasMod('wpsg_mod_produktartikel')) { ?>
+						<td class="wpsg_pos" data-order="pos">
+							<?php echo $oProduct->getMenuOrder(); ?>
+						</td>
+						<?php } ?>                        
 						<?php if ($this->hasMod('wpsg_mod_produktartikel') && $this->get_option('wpsg_mod_produktartikel_gtin') == '1') { ?>
 							<td><?php echo wpsg_hspc($d['gtin']); ?></td>
