Page 11 of 24 FirstFirst ... 91011121321 ... LastLast
Results 101 to 110 of 237
  1. #101
    Join Date
    May 2007
    Location
    Los Angeles
    Posts
    89
    Plugin Contributions
    0

    Default Re: Free Gifts-Dangling Carrot support

    Quote Originally Posted by strelitzia View Post
    Fireflyz,

    I have noticed this bug in testing of the newest version, as well ....
    Thanks, for the reply Steve! I understand. You have already done a lot and I'm grateful for it. Hopefully someone will find a solution soon.

    Have a nice holiday!
    James

  2. #102
    Join Date
    Jan 2007
    Posts
    1,483
    Plugin Contributions
    10

    Default Re: Free Gifts-Dangling Carrot support

    I can't replicate this error in 1.3.8a or 1.3.7.1. If you remove the item that is above the threshold and they have a gift in the cart, both the above threshold item and the gift are removed, and there is no blank area.

    There is no way for the gift to be left in the cart with the modifications that I have done. I have just checked it with 1 item in cart above threshold and gift added, remove item and gift is automatically removed; 2 items in cart, 1 above and 1 below threshold, add gift, remove above threshold item and gift is automatically removed; add 1 item to cart, change quantity to get above threshold, add gift, change quantity below threshold and gift is automatically removed.

    There is no way that only the gift can be left in the cart, so there must be an error in the installation/merging and not in the code.

    There must be an error somewhere with your comparing and merging if you have followed my directions. This sounds like one of the bugs that is present in the current version in the downloads, the one I submitted hasn't been published yet. I would suggest to look through the files that you have compared/merged to find the error, you cannot simply use the files that are in the downloads section but must compare and merge until the latest version is published.

    Zen Cart and it's community are the best!!

  3. #103
    Join Date
    May 2007
    Location
    Los Angeles
    Posts
    89
    Plugin Contributions
    0

    Default Re: Free Gifts-Dangling Carrot support

    Quote Originally Posted by lankeeyankee View Post
    I can't replicate this error in 1.3.8a ...
    .. There is no way for the gift to be left in the cart with the modifications that I have done.
    Lankeeyankee,
    Thanks for the reply. The gift doesn't stay in the cart. Well, it is hard to tell when the page section showing the cart is blank. However, when I reload the page (click refresh on browser), the page loads completely and the gift is removed.

    Most people freak out and don't like to click refresh when in a cart.

    I installed this on 1.3.7 first and didn't do much after I upgraded to 1.3.8a. I guess I just wait for your version to show up in the download section and reinstall this mod.

    Thanks again!
    James

  4. #104
    Join Date
    May 2007
    Location
    Los Angeles
    Posts
    89
    Plugin Contributions
    0

    Default Re: Free Gifts-Dangling Carrot support

    MERGING QUESTION:

    OK, I decide to start from scratch and reinstall the mod, however, being PHPly challenged , I can't figure out how to merge these two blocks on tpl_shopping_cart_default.php without messing things up. Please help me out here, after you have finished laughing of course.

    Mod:
    Code:
    <?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'];
      }
    ?>
    My Template:
    Code:
    <?php
      echo zen_draw_hidden_field('products_id[]', $product['id']);    
      if ($product['flagShowFixedQuantity']) {
        echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br />' . $product['showMinUnits'];
      } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br />' . $product['showMinUnits'];
      }
    ?>
    I have a feeling this is where the problem is with my partial page load.

    Thanks in advance!!!

  5. #105
    Join Date
    Jan 2007
    Posts
    1,483
    Plugin Contributions
    10

    Default Re: Free Gifts-Dangling Carrot support

    Are you already using a customized tpl_shopping_cart_default?

    If so, post your file and I will merge it for you, it will only take a minute or two. I will make sure to make the code blocks clear in the next release so it's easier to identify.

    Zen Cart and it's community are the best!!

  6. #106
    Join Date
    May 2007
    Location
    Los Angeles
    Posts
    89
    Plugin Contributions
    0

    Default Re: Free Gifts-Dangling Carrot support

    Quote Originally Posted by lankeeyankee View Post
    Are you already using a customized tpl_shopping_cart_default?

    If so, post your file and I will merge it for you, it will only take a minute or two. I will make sure to make the code blocks clear in the next release so it's easier to identify.
    Thanks for the help Lankeeyankee!

    Yes, I'm using a modified template. I've already added parts of the mod to this file. Here is the code:

    Code:
    <?php
    /**
     * Page Template
     *
     * Loaded automatically by index.php?main_page=shopping_cart.<br />
     * Displays shopping-cart contents
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 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_shopping_cart_default.php 5414 2006-12-27 07:51:03Z drbyte $
     */
    ?>
    <div class="centerColumn" id="shoppingCartDefault">
    <?php
    
    
      if ($flagHasCartContents) 
      {
    
      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'); 
    
     echo zen_draw_form('cart_quantity', zen_href_link(FILENAME_SHOPPING_CART, 'action=update_product','SSL')); ?>
    <div id="cartInstructionsDisplay" class="content"><?php echo TEXT_INFORMATION; ?></div>
    
    <?php if (!empty($totalsDisplay)) { ?>
      <div class="cartTotalsDisplay important"><?php echo $totalsDisplay; ?></div>
      <br class="clearBoth" />
    <?php } 
      if ($flagAnyOutOfStock) { 
         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 
      } //endif flagAnyOutOfStock ?>
    
    <table  border="0" width="100%" cellspacing="0" cellpadding="0" id="cartContentsDisplay">
         <tr class="tableHeading">
            <th scope="col" id="scQuantityHeading" style="width:55px;"><?php echo TABLE_HEADING_QUANTITY; ?></th>
            <!--<th scope="col" id="scUpdateQuantity">&nbsp;</th>-->
            <th scope="col" id="scProductImage" style="width:55px;">&nbsp;</th>
            <th scope="col" id="scProductsHeading"><?php echo TABLE_HEADING_PRODUCTS; ?></th>
            <th scope="col" id="scUnitHeading" style="width:80px;">&nbsp;<?php echo TABLE_HEADING_PRICE; ?>&nbsp;</th>
            <th scope="col" id="scTotalHeading" style="width:80px;">&nbsp;<?php echo TABLE_HEADING_TOTAL; ?>&nbsp;</th>
            <th scope="col" id="scRemoveHeading" style="width:70px;">&nbsp;<?php echo TABLE_HEADING_REMOVE; ?></th>
         </tr>
             <!-- Loop through all products /-->
    <?php
      foreach ($productArray as $product) {
    ?>
         <tr class="<?php echo $product['rowClass']; ?>">
           <td class="cartQuantity">
    <?php
      echo zen_draw_hidden_field('products_id[]', $product['id']);    
      if ($product['flagShowFixedQuantity']) {
        echo $product['showFixedQuantityAmount'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br />' . $product['showMinUnits'];
      } else {
        echo $product['quantityField'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span><br />' . $product['showMinUnits'];
      }
    ?>
           </td>
    <!--     <td class="cartQuantityUpdate">
    <?php/*
      if ($product['buttonUpdate'] == '') {
        echo '' ;
      } else {
        echo $product['buttonUpdate'];
      }*/
    ?>
    </td>-->
    
    <?php
    if ($product['carrot'] == 1) {
    echo TEXT_GIFT_IN_CART;
     }elseif ($product['buttonUpdate'] == '') {
       echo '' ;
      } else {
        echo $product['buttonUpdate'];
      }
    ?>
           
            <td class="cartProductImage">
                <a href="<?php echo $product['linkProductsName']; ?>">
                    <?php echo $product['productsImage']; ?>
                </a>
            </td>
           <td class="cartProductDisplay">
    <a href="<?php echo $product['linkProductsName']; ?>"><span class="cartProdTitle"><?php echo $product['productsName'] . '<br /><span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
    <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>
           <td class="cartUnitDisplay"><?php echo $product['productsPriceEach']; ?></td>
           <td class="cartTotalDisplay"><?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_GREEN, 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>
    <br class="clearBoth" />
    <?php
    // show update cart button
      if (SHOW_SHOPPING_CART_UPDATE == 2 or SHOW_SHOPPING_CART_UPDATE == 3) {
    ?>
    
    <div class="buttonRow back" style="padding-top: 5px;"><?php echo zen_image_submit(BUTTON_IMAGE_UPDATE, BUTTON_UPDATE_ALT); ?></div>
    <br class="clearBoth" />
    <?php
      } else { // don't show update button below cart
    ?>
    <?php
      } // show checkout button
    ?>
    
    <!--eof shopping cart buttons-->
    </form>
    
    
    <?php
        switch (true) {
          case (SHOW_SHIPPING_ESTIMATOR_BUTTON == '1'):
    ?>
    
    <div class="buttonRow back" style="padding-top: 5px;"><?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
          break;
          case (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
            break;
          }
    ?>
     <!--BOF dangling carrot v1.0-->
     
                <?php 
            if ($gift_message) {
                echo '<div align="center"><span class="smallText">'.$gift_message.'</span></div><p>';
            }
            for ($i=0, $n=sizeof($freebie); $i<$n; $i++) {
                if ($gift_exists > 0) {
                    $link = TEXT_REMOVE_GIFT;
                } else {
                    $link = $freebie[$i]['link'];
                }
                echo '<table width="100%" align="center" cellspacing="1" bgcolor="#FFFFFF">
                <tr> <br>
                  <td class="smallText" bgcolor="#F0F6D5">  
                         <a href="' . zen_href_link(FILENAME_PRODUCT_INFO, 'products_id='.$freebie[$i]['id'], 'NONSSL') . '">' . zen_image(DIR_WS_IMAGES . $freebie[$i]['image'], $freebie[$i]['name'], GIFTS_IMAGE_WIDTH, GIFTS_IMAGE_WIDTH, 'align="left"' )  . '</a>' 
                         . $freebie[$i]['message'].'
                   <br><b>'.$freebie[$i]['name'].'</b>
                   <br> ' . TEXT_MAX_1_GIFT . '
                         <br>'.$link.'
                  </td>
                </tr>
                </table>';                        
            }
            if ($freebie[0]['name']) {
                
            ?>
                    
       <?php
       }
       ?>
       <!--EOF dangling carrot v2.0--> 
    <?php
      }
      
       if($flagHasCartContents < 1) 
      {
    ?>
    
    <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) 
    {
    
           if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_FEATURED_PRODUCTS') 
          { 
    /**
     * display the Featured Products Center Box
     */
             require($template->get_template_dir('tpl_modules_featured_products.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_featured_products.php'); 
         } 
    
          if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_SPECIALS_PRODUCTS') 
        { 
      
      /**
     * display the Special Products Center Box
     */
    require($template->get_template_dir('tpl_modules_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_specials_default.php');
         } 
    
         if ($show_display_shopping_cart_empty->fields['configuration_key'] == 'SHOW_SHOPPING_CART_EMPTY_NEW_PRODUCTS') 
        { 
      
    /**
     * display the New Products Center Box
     */
    
    require($template->get_template_dir('tpl_modules_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_whats_new.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));
          }
    
    $show_display_shopping_cart_empty->MoveNext();
      
    } // !EOF
    
    
    //include(DIR_WS_MODULES . 'show_google_components.php');  
        }
    ?>
    <!-- * BEGIN GOOGLE CHECKOUT * -->
     <?php
      // ** GOOGLE CHECKOUT **
        include(DIR_WS_MODULES . 'show_google_components.php');  
      // ** END GOOGLE CHECKOUT **
     ?>
    <!-- * END GOOGLE CHECKOUT * -->
    <!-- ** BEGIN PAYPAL EXPRESS CHECKOUT ** -->
    
      <?php  // only display EC option if cart contents >0 and value >0
    if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') && MODULE_PAYMENT_PAYPALWPP_STATUS == 'True' && $_SESSION['cart']->count_contents() > 0 && $_SESSION['cart']->total > 0) {
    ?>
        <hr style="border: 0.1px dashed rgb(182, 181, 192);">
        <?php echo TEXT_PAYPAL_EXPRESS_OFFER.TEXT_PAYPAL_EXPRESS_NOTE;?>
        <br />
    <?php
      include(DIR_FS_CATALOG . DIR_WS_MODULES . 'payment/paypal/tpl_ec_button.php');
    }
    
    ?>
    <!-- ** END PAYPAL EXPRESS CHECKOUT ** -->
    <br class="clearBoth" />
    
    </div>
    cheers, mate!

  7. #107
    Join Date
    Mar 2005
    Posts
    123
    Plugin Contributions
    0

    Default Re: Free Gifts-Dangling Carrot support

    okay, I've got the admin sorted out and working - thanks for that :)

    now I have some problems with the cart functionality...

    Firstly if you add an item to the cart and then add a free gift it works fine, but removing the original product does not remove the free gift???? I have looked through this thread and applies all the code changes suggested.

    Next - when a free gift is added to the cart I expected the option to "add a free gift" to disapear but it doesn't? Should this mod remove the list if free gifts from the shopping cart page once a gift is selected?

    I am adding this to a heavily modded zencart install so it's possible I have missed some code merges, if someone can suggest what code does what (in what file) then I can compare those files again...

    Thanks

    Tony

  8. #108
    Join Date
    Mar 2005
    Posts
    123
    Plugin Contributions
    0

    Default Re: Free Gifts-Dangling Carrot support

    I forgot to ask... Is there a way of displaying the free gifts on a page so customers can see what the gifts are??????

  9. #109
    Join Date
    Jan 2007
    Posts
    1,483
    Plugin Contributions
    10

    Default Re: Free Gifts-Dangling Carrot support

    Quote Originally Posted by Fireflyz View Post
    Thanks for the help Lankeeyankee!

    Yes, I'm using a modified template. I've already added parts of the mod to this file. Here is the code:
    Please post your original version without any of the carrot modifications, this way I am starting from a known working file.

    Zen Cart and it's community are the best!!

  10. #110
    Join Date
    Jan 2007
    Posts
    1,483
    Plugin Contributions
    10

    Default Re: Free Gifts-Dangling Carrot support

    Quote Originally Posted by twdhosting View Post
    okay, I've got the admin sorted out and working - thanks for that :)

    now I have some problems with the cart functionality...

    Firstly if you add an item to the cart and then add a free gift it works fine, but removing the original product does not remove the free gift???? I have looked through this thread and applies all the code changes suggested.

    Next - when a free gift is added to the cart I expected the option to "add a free gift" to disapear but it doesn't? Should this mod remove the list if free gifts from the shopping cart page once a gift is selected?

    I am adding this to a heavily modded zencart install so it's possible I have missed some code merges, if someone can suggest what code does what (in what file) then I can compare those files again...

    Thanks

    Tony
    I might have forgotten to include this in my previous instructions (and the zip I emailed to Strelitzia - sorry mate!!). I have attached the includes/modules/pages/shopping_cart/main_template_vars.php here. This will take care of the gift being left in the cart when the cart total is changed and drops below the threshold. Please let me know if this works now.

    The other gifts are left there in case the person changes their mind and wants to swap the gift for another one. You should see the message displaying something of this sort in the remaining gifts.

    If you enable the sidebox then people can see the gifts. Also, they can click on the gifts on the shopping cart page. I went a step further and created a new category called Free Gifts so that people can access it through the categories menu.
    Attached Files Attached Files

    Zen Cart and it's community are the best!!

 

 
Page 11 of 24 FirstFirst ... 91011121321 ... LastLast

Similar Threads

  1. Free Gifts - Dangling Carrot installation question
    By simpledomaining in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 26 Oct 2011, 03:27 PM
  2. Dangling carrot
    By strelitzia in forum All Other Contributions/Addons
    Replies: 13
    Last Post: 8 Dec 2009, 10:43 PM
  3. Dangling Carrot - lost my admin
    By tonyb in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 5 Nov 2008, 11:19 PM
  4. Dangling Carrot Mod
    By strelitzia in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 5 Oct 2008, 11:13 PM

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