Ankündigung

Einklappen
Keine Ankündigung bisher.

Merge-Problem

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Merge-Problem

    Ich bin gerade beim mergen der geänderten Dateien. In der Datei GEAENDERTE DATEIEN\includes\templates\DEINTEMPLATE\templates\ tpl_shopping_cart_default.php ergibt sich nun ein Problem, bei dem ich nicht recht weiß, was ich tun soll. Denn ich habe auch Stock by Attributes bei mir installiert, und da ergibt sich nun ein Konflikt.

    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: sba.jpg
Ansichten: 1
Größe: 14,8 KB
ID: 104122

    Falls auf der Grafik nicht erkennbar, hier noch mal als Code:

    Code:
           <td class="cartQuantity">
    <?php
    if ($product['carrot'] == 1) {
    //
     }elseif ($product['flagShowFixedQuantity'] ) {
        echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      }
    ?>
           </td>
           <td class="cartQuantityUpdate">
    <?php
    if ($product['carrot'] == 1) {
    echo TEXT_GIFT_IN_CART;
     }elseif ($product['buttonUpdate'] == '') {
       echo '' ;
      } else {
        echo $product['buttonUpdate'];
      }
    ?>
    
           </td>
           <td class="cartProductDisplay">
    <a href="<?php echo $product['linkProductsName']; ?>"><span class="cartImage back"><?php echo $product['productsImage']; ?></span><span class="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
    <br class="clearBoth" />
    Und das ist der Code in der verwendeten Datei:

    Code:
           <td class="cartQuantity">
    <?php
        // START "Stock by Attributes"
         if( $product['lowproductstock'] AND STOCK_CHECK == 'true' ) {
             echo $product['quantityField']           . '<br /><span class="alert bold">***' . '</span><br /><br />' . $product['showMinUnits'];
         }
          elseif ( $product['flagShowFixedQuantity'] ) {
        echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
      }
    ?><br />
            <span class="alert bold"><?php echo $product['flagStockCheck'];?></span><br />
            <br /><?php echo $product['showMinUnits']; ?>
           </td>
    
           <td class="cartQuantityUpdate"><?php echo $product['buttonUpdate']; ?></td>
    <?php } ?>
    
    
    
           <td class="cartProductDisplay">
    
    <a href="<?php echo $product['linkProductsName']; ?>"><span class="cartImage back"><?php echo $product['productsImage']; ?></span><span class="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
    <?php 
        // START "Stock by Attributes"
        if ( (STOCK_SHOW_LOW_IN_CART == 'true') && $product['flagStockCheck'] ) {
                echo '<span class="alert bold">';
                    echo PWA_STOCK_AVAILABLE . '&nbsp;';
                    echo ((isset($product['stockAvailable'])) ? $product['stockAvailable']: 0);//shows attribute stock
                echo '</span>';
             //}
        }
        //for products without attribute
        if( empty($product['attributes']) && STOCK_SHOW_LOW_IN_CART == 'true' && $product['lowproductstock'] ){
            //if( $product['lowproductstock'] && ($product['quantityField'] > $product['stockofproduct']) ){
                echo '<span class="alert bold">';
                    echo '&nbsp;***&nbsp;' . PWA_STOCK_AVAILABLE . '&nbsp;';
                    echo ((isset($product['stockofproduct'])) ? $product['stockofproduct']: 0);//shows product stock (with NO attribute)
                echo '</span>';
            //}
        }
        // END "Stock by Attributes"
    ?>
    <br class="clearBoth" />
    Ist es möglich, beide Module zu integrieren, also das bereits installierte SBA und die zu installierende Freebies? Denn in allen anderen Files gibt es keine Konflikte, nur in dieser Datei. Was muss ich da ändern?

    #2
    Tja, offenbar gibt es für den Konflikt keine Lösung. Dann gibt es eben keine freebies.

    Kommentar


      #3
      Nur weil sich nicht jemand binnen ein paar Tagen die Arbeit macht, Dir die Arbeit abzunehmen und eine fertig angepasste Datei zu posten, heisst das nicht, dass diese beiden Module nicht kombinierbar wären.
      Ich verstehe nicht ganz, was Du mit "Konflikt" meinst. Es geht immer darum, die Zusatzfunktionen, die ein Modul mitbringt in die bestehende Datei zu übernehmen.
      Wenn das zu kompliziert ist, dann musst Du jemanden beauftragen solche Dinge vorzunehmen und kannst es eben nicht selbst.
      Dieses Forum kann es nicht leisten, für all diese möglichen Kombinationen fertige Dateien bereitzustellen, dazu ist das alles viel zu individuell und hängt ja auch vom verwendeten Template ab.

      Ich habe das in anderen ähnlichen Threads schon öfter gemacht, daher mach ichs hier auch nochmal, aber solche Dinge sind wirklich weit jenseits eines kostenlosen Supports in einem Forum Hilfe zur Selbsthilfe.

      Ohne das getestet zu haben sollte eine includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php für Stock by Attributes, die zusätzlich die beiden Freebies Funktionen enthält ca. so aussehen
      Code:
      <?php
      /**
       * Page Template
       *
       * Loaded automatically by index.php?main_page=shopping_cart.<br />
       * Displays shopping-cart contents
       *
       * @package templateSystem
       * @copyright Copyright 2003-2019 Zen Cart Development Team
       * @copyright Portions Copyright 2003 osCommerce
       * @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
       * @version $Id: tpl_shopping_cart_default.php for SBA and Free Gifts 2019-01-30 20:07:39Z webchills $
       */
      ?>
      <div class="centerColumn" id="shoppingCartDefault">
      <?php
        if ($flagHasCartContents) {
      ?>
      
      <?php
        if ($_SESSION['cart']->count_contents() > 0) {
      ?>
      <div class="forward"><?php echo TEXT_VISITORS_CART; ?></div>
      <?php
        }
      ?>
      
      <h1 id="cartDefaultHeading"><?php echo HEADING_TITLE; ?></h1>
      
      <?php if ($messageStack->size('shopping_cart') > 0) echo $messageStack->output('shopping_cart'); ?>
      
      <?php echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product', $request_type), 'post', 'id="shoppingCartForm"'); ?>
      <div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION; ?></div>
      
      <?php if (!empty($totalsDisplay)) { ?>
        <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
      <?php } ?>
      
      <?php  if ($flagAnyOutOfStock) { ?>
      
      <?php    if (STOCK_ALLOW_CHECKOUT == 'true') {  ?>
      
      <div class="messageStackError"><?php echo OUT_OF_STOCK_CAN_CHECKOUT; ?></div>
      
      <?php    } else { ?>
      <div class="messageStackError"><?php echo OUT_OF_STOCK_CANT_CHECKOUT; ?></div>
      
      <?php    } //endif STOCK_ALLOW_CHECKOUT ?>
      <?php  } //endif flagAnyOutOfStock ?>
      
      <table id="cartContentsDisplay">
           <tr class="tableHeading">
              <th scope="col" id="scQuantityHeading"><?php echo TABLE_HEADING_QUANTITY; ?></th>
              <th scope="col" id="scUpdateQuantity">&nbsp;</th>
              <th scope="col" id="scProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
              <th scope="col" id="scUnitHeading"><?php echo TABLE_HEADING_PRICE; ?></th>
              <th scope="col" id="scTotalHeading"><?php echo TABLE_HEADING_TOTAL; ?></th>
              <th scope="col" id="scRemoveHeading">&nbsp;</th>
           </tr>
               <!-- Loop through all products /-->
      <?php
        foreach ($productArray as $product) {
      ?>
           <tr class="<?php echo $product['rowClass']; ?>">
      
      <?php if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' ) {
            // 
            } else { ?>
      
             <td class="cartQuantity">
      <?php
      if ($product['carrot'] == 1) {
      //
      
       }elseif ( $product['lowproductstock'] AND STOCK_CHECK == 'true' ) {
               echo $product['quantityField']           . '<br /><span class="alert bold">***' . '</span><br /><br />' . $product['showMinUnits'];
           }
            elseif ( $product['flagShowFixedQuantity'] ) {
          echo $product['showFixedQuantityAmount'];
        } else {
          echo $product['quantityField'];
        }
      ?><br />
              <span class="alert bold"><?php echo $product['flagStockCheck'];?></span><br />
              <br /><?php echo $product['showMinUnits']; ?>
             </td>
      
             <td class="cartQuantityUpdate">
             
             
            <?php
      if ($product['carrot'] == 1) {
      echo TEXT_GIFT_IN_CART;
       }elseif ($product['buttonUpdate'] == '') {
         echo '' ;
        } else {
          echo $product['buttonUpdate'];
        }
      ?>
      
      <?php } ?>
      
      
      
             <td class="cartProductDisplay">
      
      <a href="<?php echo $product['linkProductsName']; ?>"><span class="cartImage back"><?php echo $product['productsImage']; ?></span><span class="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
      <?php 
          // START "Stock by Attributes"
          if ( (STOCK_SHOW_LOW_IN_CART == 'true') && $product['flagStockCheck'] ) {
              
                  echo '<span class="alert bold">';
                  
                      echo PWA_STOCK_AVAILABLE . '&nbsp;';
                      echo ((isset($product['stockAvailable'])) ? $product['stockAvailable']: 0);//shows attribute stock
                  
                  echo '</span>';
               //}
          }
          //for products without attribute
          if( empty($product['attributes']) && STOCK_SHOW_LOW_IN_CART == 'true' && $product['lowproductstock'] ){
              //if( $product['lowproductstock'] && ($product['quantityField'] > $product['stockofproduct']) ){
                  echo '<span class="alert bold">';
                  
                      echo '&nbsp;***&nbsp;' . PWA_STOCK_AVAILABLE . '&nbsp;';
                      echo ((isset($product['stockofproduct'])) ? $product['stockofproduct']: 0);//shows product stock (with NO attribute)
                  
                  echo '</span>';
              //}
          }
          // END "Stock by Attributes"
      ?>
      <br class="clearBoth" />
      <?php
        echo $product['attributeHiddenField'];
        if (isset($product['attributes']) && is_array($product['attributes'])) {
        echo '<div class="cartAttribsList">';
        echo '<ul>';
          reset($product['attributes']);
          foreach ($product['attributes'] as $option => $value) {
      ?>
      
      <li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>
      
      <?php
          }
        echo '</ul>';
        echo '</div>';
        }
      ?>
             </td>
      
      <?php if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' ) { ?>
      
             <td class="cartQuantity">
      <?php
        if ($product['flagShowFixedQuantity']) {
          echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
        } else {
          echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br /><br />' . $product['showMinUnits'];
        }
      ?>
             </td>
             <td class="cartQuantityUpdate"><?php echo $product['buttonUpdate']; ?></td>
      
      <?php  } else {
      
        }  ?>
      
      
             <td class="cartUnitDisplay"><?php if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' or $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ) {echo '<b class="hide">' . TABLE_HEADING_PRICE . '&#58;&nbsp;&nbsp;</b>'; } ?><?php echo $product['productsPriceEach']; ?></td>
             <td class="cartTotalDisplay"><?php if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' or $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ) {echo '<b class="hide">' . TABLE_HEADING_TOTAL . '&#58;&nbsp;&nbsp;</b>'; } ?><?php echo $product['productsPrice']; ?></td>
             <td class="cartRemoveItemDisplay">
      <?php
        if ($product['buttonDelete']) {
      ?>
               <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, 'action=remove_product&product_id=' . $product['id']); ?>"><?php echo zen_image($template->get_template_dir(ICON_IMAGE_TRASH, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_TRASH, ICON_TRASH_ALT); ?></a>
      <?php
        }
        if ($product['checkBoxDelete'] ) {
          echo zen_draw_checkbox_field('cart_delete[]', $product['id']);
        }
      ?>
            </td>
           </tr>
      <?php
        } // end foreach ($productArray as $product)
      ?>
             <!-- Finished loop through all products /-->
      </table>
      
      <div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $cartShowTotal; ?></div>
      <br class="clearBoth" />
      
      <!--bof shopping cart buttons-->
      <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_CHECKOUT, BUTTON_CHECKOUT_ALT) . '</a>'; ?></div>
      <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_CONTINUE_SHOPPING, BUTTON_CONTINUE_SHOPPING_ALT) . '</a>'; ?></div>
      <?php
      // show update cart button
        if (SHOW_SHOPPING_CART_UPDATE == 2 or SHOW_SHOPPING_CART_UPDATE == 3) {
      ?>
      <div class="buttonRow back"><?php echo zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT); ?></div>
      <?php
        } else { // don't show update button below cart
      ?>
      <?php
        } // show update button
      ?>
      <!--eof shopping cart buttons-->
      </form>
      
      <br class="clearBoth" />
      <?php
          if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1') {
      ?>
      
      <div class="buttonRow back"><?php echo '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_SHIPPING_ESTIMATOR) . '\')">' .
       zen_image_button(BUTTON_IMAGE_SHIPPING_ESTIMATOR, BUTTON_SHIPPING_ESTIMATOR_ALT) . '</a>'; ?></div>
      <?php
          }
      ?>
      
      <!-- ** BEGIN PAYPAL EXPRESS CHECKOUT ** -->
      <?php  // the tpl_ec_button template only displays EC option if cart contents >0 and value >0
      if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True') {
        include(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/paypal/tpl_ec_button.php');
      }
      ?>
      <!-- ** END PAYPAL EXPRESS CHECKOUT ** -->
      
      <?php
            if (SHOW_SHIPPING_ESTIMATOR_BUTTON == '2') {
      /**
       * load the shipping estimator code if needed
       */
      ?>
            <?php require(DIR_WS_MODULES . zen_get_module_directory('shipping_estimator.php')); ?>
      
      <?php
            }
      ?>
      <?php
        } else {
      ?>
      
      <h2 id="cartEmptyText"><?php echo TEXT_CART_EMPTY; ?></h2>
      
      <?php
      $show_display_shopping_cart_empty = $db->Execute(SQL_SHOW_SHOPPING_CART_EMPTY);
      
      while (!$show_display_shopping_cart_empty->EOF) {
      ?>
      
      <?php
        if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_FEATURED_PRODUCTS') { ?>
      <?php
      /**
       * display the Featured Products Center Box
       */
      ?>
      <?php require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); ?>
      <?php } ?>
      
      <?php
        if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_SPECIALS_PRODUCTS') { ?>
      <?php
      /**
       * display the Special Products Center Box
       */
      ?>
      <?php require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php'); ?>
      <?php } ?>
      
      <?php
        if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_NEW_PRODUCTS') { ?>
      <?php
      /**
       * display the New Products Center Box
       */
      ?>
      <?php require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.php'); ?>
      <?php } ?>
      
      <?php
        if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_UPCOMING') {
          include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_UPCOMING_PRODUCTS));
        }
      ?>
      <?php
        $show_display_shopping_cart_empty->MoveNext();
      } // !EOF
      ?>
      <?php
        }
      ?>
      </div>

      Kommentar


        #4
        Zitat von webchills Beitrag anzeigen
        Nur weil sich nicht jemand binnen ein paar Tagen die Arbeit macht, Dir die Arbeit abzunehmen und eine fertig angepasste Datei zu posten, heisst das nicht, dass diese beiden Module nicht kombinierbar wären.
        Ich verstehe nicht ganz, was Du mit "Konflikt" meinst. Es geht immer darum, die Zusatzfunktionen, die ein Modul mitbringt in die bestehende Datei zu übernehmen.
        Ich wollte einfach nur einen Tipp, webchills. Scheinbar hat der Screenshoot nicht deutlich gemacht, wo es hakt. Eigentlich nur an einer Zeile. Im Original des Moduls steht diese Zeile:

        Code:
        if ($product['carrot'] == 1) {
        //
         }elseif ($product['flagShowFixedQuantity'] ) {
        In meiner bestehenden Datei ist dieser Eintrag:

        Code:
            if( $product['lowproductstock'] AND STOCK_CHECK == 'true' ) {
                 echo $product['quantityField']           . '<br /><span class="alert bold">***' . '</span><br /><br />' . $product['showMinUnits'];
             }
              elseif ( $product['flagShowFixedQuantity'] ) {
        Für mich war eben nicht ganz klar, ob ich den Befehl aus der Moduldatei eintragen soll, oder diesen Befehl in der bestehenden Datei unter elseif gesetzt wird. Dein Beispiel hat mir Klarheit verschafft, mehr wollte ich auch gar nicht. Trotzdem danke.

        Kommentar

        Info zu diesem Forenarchiv:
        Mit Release von 1.5.7 wurde die deutsche Zen Cart Version auf eine reine DIY-Lösung umgestellt.
        Für einen Support via Forum stehen keine personellen und zeitlichen Ressourcen mehr zur Verfügung.
        Dieses Supportforum bleibt im Nur-Lesen-Modus als Wissensarchiv noch online verfügbar.
        PM Funktionalität, Registrierung und Posten neuer Beiträge sind deaktiviert.
        Zugriff auf Anhänge in den Postings ist auch ohne Registrierung/Einloggen möglich.
        FAQ und Downloadbereich des Forums wurden in die neue umfangreiche Knowledgebase auf der zen-cart-pro.at Website übernommen.

        Das Development der deutschen Zen Cart Version geht wie bisher auf Github weiter.
        Wir werden auch weiterhin neue Versionen bereitstellen und die Onlinedokumentation/Knowledgebase aktualisieren.
        Fehler in der Software können auf Github als Issues gemeldet werden.
        Follow us
        aktuelle version
        Zen Cart 1.5.7g deutsch
        vom 12.12.2023
        [Download]
        Lädt...
        X