Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2005
    Posts
    96
    Plugin Contributions
    0

    Default Help needed to merge a file for attributes/dynamic dropdown

    Hi there everyone,

    I'm coming into this late into the game but as the problem was passed to me, the cart I'm working on has a problem. Either it doesn't pass the size/attribute with the product order, or it won't alter on out of stock items, depending on which file we use. I've traced the file down to /includes/templates/template_default/templates/tpl_modules_attributes.php.

    I have two copies. The copy of the file that we were using prior to the dynamic dropdown addon and the copy that the addon provides. One file passes the attributes to the cart correctly but will not show out of stock items, the other file has the exact opposite problem.

    Here is the file that was used prior to the dynamic dropdown addon:

    Code:
    <?php
    
    /**
    
     * Module Template
    
     *
    
     * Template used to render attribute display/input fields
    
     *
    
     * @package templateSystem
    
     * @copyright Copyright 2003-2005 Zen Cart Development Team
    
     * @copyright Portions Copyright 2003 osCommerce
    
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    
     * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $
    
     */
    
    ?>
    
    <div id="productAttributes">
    
    <?php if ($zv_display_select_option > 0) { ?>
    
    <h3 id="attribsOptionsText"><?php echo TEXT_PRODUCT_OPTIONS; ?></h3>
    
    <?php } // show please select unless all are readonly ?>
    
    
    
    <?php
    
        for($i=0;$i<sizeof($options_name);$i++) {
    
    ?>
    
    <?php
    
      if ($options_comment[$i] != '' and $options_comment_position[$i] == '0') {
    
    ?>
    
    <h3 class="attributesComments"><?php echo $options_comment[$i]; ?></h3>
    
    <?php
    
      }
    
    ?>
    
    
    
    <div class="wrapperAttribsOptions">
    
    <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
    
    <div class="back"><?php echo "\n" . $options_menu[$i]; ?></div>
    
    <br/>
    
    </div>
    
    
    
    
    
    <?php if ($options_comment[$i] != '' and $options_comment_position[$i] == '1') { ?>
    
        <div class="ProductInfoComments"><?php echo $options_comment[$i]; ?></div>
    
    <?php } ?>
    
    
    
    
    
    <?php
    
    if ($options_attributes_image[$i] != '') {
    
    ?>
    
    <?php echo $options_attributes_image[$i]; ?>
    
    <?php
    
    }
    
    ?>
    
    <br/>
    
    <?php
    
        }
    
    ?>
    
    
    
    
    
    <?php
    
      if ($show_onetime_charges_description == 'true') {
    
    ?>
    
        <div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
    
    <?php } ?>
    
    
    
    
    
    <?php
    
      if ($show_attributes_qty_prices_description == 'true') {
    
    ?>
    
        <div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . '&nbsp;' . '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
    
    <?php } ?>
    
    </div>
    Here is the file provided by the dynamic dropdown addon:

    Code:
    <?php
    
    /**
    
     * Module Template
    
     *
    
     * Template used to render attribute display/input fields
    
     *
    
     * @package templateSystem
    
     * @copyright Copyright 2003-2005 Zen Cart Development Team
    
     * @copyright Portions Copyright 2003 osCommerce
    
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    
     * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $
    
     */
    
    ?>
    
    <div id="productAttributes">
    
    <?php if ($zv_display_select_option > 0) { ?>
    
    <?php
    
    $products_attributes = $db->Execute("select count(distinct products_options_id) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = ". (int)$_SESSION['languages_id'] ."");
    
    
    
    
    
         if ($products_attributes->fields['total'] > 1)  {
    
        
    
          $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); 
    
         require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI . '.php');
    
          $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI;
    
    
    
         $pad = new $class($products_id);
    
         
    
         echo $pad->draw();
    
    
    
      }
    
      elseif ($products_attributes->fields['total'] > 0)  {
    
        
    
          $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); 
    
         require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE . '.php');
    
          $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE;
    
    
    
         $pad = new $class($products_id);
    
         
    
         echo $pad->draw();
    
      }
    
    
    
    
    
    ?>
    
    
    
    <?php
    
    if ($options_attributes_image[$i] != '') {
    
    ?>
    
    <?php echo $options_attributes_image[$i]; ?>
    
    <?php
    
    }
    
    ?>
    
    <br>
    
    <?php
    
        }
    
    ?>
    
    
    
    
    
    <?php
    
      if ($show_onetime_charges_description == 'true') {
    
    ?>
    
        <div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
    
    <?php } ?>
    
    
    
    
    
    <?php
    
      if ($show_attributes_qty_prices_description == 'true') {
    
    ?>
    
        <div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . '&nbsp;' . '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
    
    <?php } ?>
    
    </div>
    I've dropped them in a diff app, but I can't merge the files. They are so different that I'm not sure what content from the original file belongs in what if {} on the other file.

    Could someone help me get the important bits from both files into one? I'd be forever grateful.

  2. #2
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: Help needed to merge a file for attributes/dynamic dropdown

    I'm coming into this late into the game but as the problem was passed to me
    This looks like the mod you are using http://www.zen-cart.com/index.php?ma...roducts_id=953 if so, the readme file in the zip talks about your problem.

    This post might help http://www.zen-cart.com/forum/showth...ock+Attributes

    Skip
    • 446F63746F722057686F •

  3. #3
    Join Date
    Aug 2005
    Posts
    96
    Plugin Contributions
    0

    Default Re: Help needed to merge a file for attributes/dynamic dropdown

    Hi there Skip,

    I can't thank you enough for pointing me to the readme. It is indeed a "feature" of the addon. I guess it would have been smart of me to check the docs for features like this before investing hours on fixing it. :)

    Thanks again, you saved my sanity.

 

 

Similar Threads

  1. v151 Dynamic Dropdown on Home Page (not stock by attributes).
    By Axeman in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 29 May 2015, 05:37 PM
  2. v150 Please help... File merge with numinix CSS/JS loader
    By Miff in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 18 Feb 2012, 05:11 PM
  3. File Merge Help - Trying to install css/js mod
    By Miff in forum General Questions
    Replies: 0
    Last Post: 30 Nov 2011, 12:36 PM
  4. Dynamic drop downs for stock by attributes Help?
    By shahram in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 4 Jul 2011, 08:46 PM
  5. Dynamic Drop Downs for SBA, How do I set a Dropdown to sequenced_dropdown?
    By agent_44 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 9 Mar 2010, 02:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR