Results 1 to 10 of 14

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Visually Highlight/Flag "Always Free Shipping" products in the shopping cart

    I have my settings so that the free shipping image appears on product info pages for products that are configured to have "always free shipping". And that's perfect.. Works as expected..

    Here's the what I'm trying to do however...

    The "always free shipping" only applies to certain products. UPS is the primary shipping method for anything not specifically set to "always free shipping".

    How can I visually flag/mark the "always free shipping" products in the shopping cart/checkout pages so that it's CLEAR that the calculated shipping costs will apply to all other items in the shopping cart and NOT the items flagged "always free shipping". Ideally what I would like to do is to add an asterisk "*" next to each one of the "always free shipping" products and have some text below the products list that explains what the asterisk means.

    Any thoughts??
    Last edited by DivaVocals; 17 Jun 2014 at 03:21 PM. Reason: Include Zen Cart version..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  2. #2
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,740
    Plugin Contributions
    22

    Default Re: Visually Highlight/Flag "Always Free Shipping" products in the shopping cart

    If I'm understanding it correctly, you just want to check if cart contains any products that are marked as "always free shipping" and add a disclaimer if so - correct?

  3. #3
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Visually Highlight/Flag "Always Free Shipping" products in the shopping cart

    Quote Originally Posted by balihr View Post
    If I'm understanding it correctly, you just want to check if cart contains any products that are marked as "always free shipping" and add a disclaimer if so - correct?
    EXACTLY! and WHY you may be asking?? I don't want customers choosing UPS Next Day and expect that the entire order will be shipping that way.. In this particular case, the "always free shipping" items may in fact be shipped separately using a different carrier altogether (USPS Priority most likely).. We will include text in the order confirmation email, shipping policy and the product description for clarity.. We MAY use product attributes to allow customers to select a shipping "upgrade" for these items if they wish to pay the additional cost for expedited shipping.

    The disclaimer is a way of making sure that if the customer somehow misses the explanation in the shipping policy or the blurb in the product description which tells them this, they will know FOR SURE when they check out..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  4. #4
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,740
    Plugin Contributions
    22

    Default Re: Visually Highlight/Flag "Always Free Shipping" products in the shopping cart

    Quote Originally Posted by DivaVocals View Post
    EXACTLY! and WHY you may be asking??
    Well, honestly, I don't care.

    includes/modules/pages/shopping_cart/header_php.php

    Around line 59 find:
    Code:
    $flagAnyOutOfStock = false;
    and add after:
    Code:
    // BOF Free Shipping Flag 1/3
    $flagAnyFreeShipping = false;
    // EOF Free Shipping Flag 1/3
    Around line 130 find:
    Code:
    if (STOCK_CHECK == 'true') {
        $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']);
        if ($flagStockCheck == true) {
          $flagAnyOutOfStock = true;
        }
      }
    and add after:
    Code:
    // BOF Free Shipping Flag 2/3
      $flagFreeShipping = zen_get_product_is_always_free_shipping($products[$i]['id']) == true ? '*' : '';
      if(zen_not_null($flagFreeShipping)) $flagAnyFreeShipping = true;
      // EOF Free Shipping Flag 2/3
    Around line 161 find:
    Code:
    'flagShowFixedQuantity'=>$showFixedQuantity,
    and add after:
    Code:
    // BOF Free Shipping Flag 3/3
    'flagFreeShipping'=>$flagFreeShipping,
    // EOF Free Shipping Flag 3/3
    Next, includes/templates/YOUR_TEMPLATE/templates/tpl_shopping_cart_default.php
    Find:
    Code:
    <a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
    and replace with:
    Code:
    <a href="<?php echo $product['linkProductsName']; ?>"><span id="cartImage" class="back"><?php echo $product['productsImage']; ?></span><span id="cartProdTitle"><?php echo $product['productsName'] . '<span class="alert bold">' . $product['flagFreeShipping'] . '</span>' . '<span class="alert bold">' . $product['flagStockCheck'] . '</span>'; ?></span></a>
    Find:
    Code:
    <!--bof shopping cart buttons-->
    and add before:
    Code:
    <?php if($flagAnyFreeShipping) echo '<div id="freeShippingDisclaimer">some free shipping disclaimer here</div>'; ?>
    If you want some info on the checkout pages, I'd probably add a parameter in $_SESSION (set it includes/modules/pages/shopping_cart/header.php) and then just set an if-else in the checkout pages...

  5. #5
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Visually Highlight/Flag "Always Free Shipping" products in the shopping cart

    Or one could just query the shopping cart directly. As usual, many different ways to get the same information :-)

    Code:
    // Check against the database directly using the shopping cart
    $cart_includes_free_shipping_product = $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1');
    
    // Calculate totals and return number of items in the shopping cart w/ free shipping
    $cart_includes_free_shipping_product  = (count($_SESSION['cart']->free_shipping_items()) > 0);
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  6. #6
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,740
    Plugin Contributions
    22

    Default Re: Visually Highlight/Flag "Always Free Shipping" products in the shopping cart

    Quote Originally Posted by lhungil View Post
    Or one could just query the shopping cart directly. As usual, many different ways to get the same information :-)


    I was never really a fan of simple. If there's a complicated solution, I'll be the first to take it. I mean, why use "1+1" when you can use " (sin(45)^2)((4π) / π)" and get the same result... Now, if you'll excuse me, I'll be in the basement banging my head against the wall...

  7. #7
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Visually Highlight/Flag "Always Free Shipping" products in the shopping cart

    Quote Originally Posted by balihr View Post
    ... isn't it a bit of an overkill ... I might be missing something obvious here, but still - IMHO, a much simpler approach, and (possibly more important) understandable by most mortals...
    LOL, I definately have been enjoying reading your posts as of late. The humour (and possibly sarcasm) lately has been a very welcome beathe of fresh air.

    As for my reasons... I have an aversion to modifying core files... Mostly because I spent WAY too much time merging during my last few ZC upgrades...

    And since Zen Cart has an existing design pattern for just such a purpose, I figured "Why not"?

 

 

Similar Threads

  1. What is the mySQL command to reset "Always Free Shipping" NO
    By oavs in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 29 Jan 2014, 12:13 AM
  2. v150 "Always free shipping" becomes "not possible"
    By kalastaja in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 8 Mar 2013, 08:00 PM
  3. v139h Can I set all products "Always Free Shipping"?
    By zihaizi in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 12 Jul 2012, 02:12 PM
  4. "Always free shipping " option is change all item free shipping?
    By als88 in forum Built-in Shipping and Payment Modules
    Replies: 12
    Last Post: 23 Oct 2009, 04:32 AM
  5. Want to use "Always Free Shipping Products"
    By awaes786 in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 8 Jun 2008, 05:39 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