Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Nov 2006
    Posts
    46
    Plugin Contributions
    0

    Default Combining free and non free shipping

    Free shipping is incorporated into the price of all the products (call them product A's) non our site. I have setup Free Shipping freeshipper to accomplish this and it works fine.

    We want to add a load of other products (B's) which if bought on their own without any of the original free shipping products (A'), will incur a shipping cost. But if one of each products is purchased (A + B), shipping is free.

    I did a search on the forums and came up with a thread where one person had the opposite problem, so I tried to follow the thread back from the end to the beginning to recreate this behavior but it has not worked out.

    Adding flatrate shipping for product B's works as a standalone cart item but doesn't disappear when a product A is added. I think that perhaps freeoptions might be the way forward but I do not want it to work as intended, i.e. giving people an option for a slower but free option. It would be much better if I could get it to work without giving an option.

    Does anyone have any thoughts or prior experiences to share?

    Many thanks,

    Dmuk

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,718
    Plugin Contributions
    6

    Default Re: Combining free and non free shipping

    Currently, there isn't a setting for this ...

    You could do some custom code and check if any products are marked as:
    product_is_always_free_shipping

    If so, and there is at least 1 product marked as product_is_always_free_shipping = 1 ... then have the custom code alter the settings on which shipping modules display and only show a Free Shipping module ...

    NOTE: You may need to make a separate free shipping module to accomplish this ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Nov 2006
    Posts
    46
    Plugin Contributions
    0

    Default Re: Combining free and non free shipping

    Thanks Linda.

    Time to perhaps dust off the old php skills! :)

    Is there a specific file or file(s) I should head to which might speed up my progress? A relative Zen newbie so it may take me as much time as creating the code!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,718
    Plugin Contributions
    6

    Default Re: Combining free and non free shipping

    Look in the shopping_cart.php class and find the function in_cart_check ...

    Learn how you can use this to determin if a product is in the shopping_cart based on a certain condition ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5
    Join Date
    Dec 2006
    Location
    Vermont
    Posts
    116
    Plugin Contributions
    0

    Default Turn off free shipping for "Wholesale" customers...

    I have made some modifications to my system to allow a second "wholesale" price for customers who have been approved as "retail" and items which have a wholesale price.

    I need to look at the customer record during checkout/shipping calculations in order to determine if free shipping should be DISabled.

    I cannot figure out why, but I can't access the TABLE_CUSTOMER, because there appears to be no "$_SESSION('customer_id') during the FREEOPTIONS.PHP processing.

    It errors out with a "PHP Fatal error: Call to a member function Execute() on a non-object in ...modules\shipping\freeoptions.php on line 80"

    Can somebody tell me how to get the customer info, using customer_id, in the freeoptions module?

    The code I'm TRYING to use unsuccessfully is here
    PHP Code:
    // RCC 6/10/2007 Add wholesale pricing - SKIP FREE SHIPPING FOR WHOLESALE CUSTOMERS
    // NOTE: removed next line for testing, to find why erroring out...
    //    if (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
          
    $customer_is_wholesale $db->Execute("select customers_whole from " TABLE_CUSTOMERS " where customers_id = '" $_SESSION['customer_id'] . "'");
          if (
    $customer_is_wholesale->RecordCount() > 0) {
              if (
    $customer_is_wholesale->fields['customers_whole'] == '1') {
               
    $this->enabled false;
               
    $this->ck_freeoptions_total false;
               
    $this->ck_freeoptions_weight false;
               
    $this->ck_freeoptions_items false;
            }
          }
    //    }
    // EOM RCC 
    Thanks!

  6. #6
    Join Date
    Jul 2007
    Posts
    94
    Plugin Contributions
    0

    Default Re: Combining free and non free shipping

    Quote Originally Posted by Ajeh View Post
    Currently, there isn't a setting for this ...

    You could do some custom code and check if any products are marked as:
    product_is_always_free_shipping

    If so, and there is at least 1 product marked as product_is_always_free_shipping = 1 ... then have the custom code alter the settings on which shipping modules display and only show a Free Shipping module ...

    NOTE: You may need to make a separate free shipping module to accomplish this ...
    Has anybody done this?

  7. #7
    Join Date
    Apr 2010
    Posts
    26
    Plugin Contributions
    0

    Default Re: Combining free and non free shipping

    Quote Originally Posted by ianhg View Post
    Has anybody done this?
    I'd like to know also. My cart is 1.3.8.a and I would like to not charge people shipping if they have bought an item that is "free shipping"

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,718
    Plugin Contributions
    6

    Default Re: Combining free and non free shipping

    You can test for that with:
    $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1')
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  9. #9
    Join Date
    Jul 2009
    Posts
    246
    Plugin Contributions
    0

    Default Re: Combining free and non free shipping

    Quote Originally Posted by Ajeh View Post
    You can test for that with:
    $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1')
    Hi Linda,
    I am very interested in thsi mod.
    Can you please expalin in details where I should add the code you wrote in order to not charge shipping if in the cart there are
    one product free shipping
    one product non free shipping
    The total of the two products is below the minimum order value set to have the free shipping.
    Thanks
    enzo

  10. #10
    Join Date
    Jul 2009
    Posts
    246
    Plugin Contributions
    0

    Default Re: Combining free and non free shipping

    I have tryed to hack on my own the file tpl_shopping_cart, but there is something wrong in what I do. If I save the hacked file and reload the page, the entire column were the shopping cart is disappears.
    I think that the problem I am having is in the syntax, but I do not know nothing about and I am trying to understand.
    Thanks for your help
    enzo

    This is the original code
    //Begin free shipping qualifier
    $free_ship_on = MODULE_SHIPPING_FREEOPTIONS_STATUS;

    if ($free_ship_on == 'True') {
    $free_limit = MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN;
    if ($_SESSION['cart']->count_contents() > 0) {
    $_SESSION['cart']->get_products();
    $basket_total = $_SESSION['cart']->show_total();
    if ($basket_total < $free_limit) {
    $diff_to_free = ($free_limit - $basket_total);
    $content .= '<span class="freeoptions">' . '<style="text-align: center; "><span style="font-size: small; "><span style="color: rgb(255, 0, 0); "><b>Aggiungendo prodotti per '. $currencies->format($diff_to_free) .' <style="text-align: center; "><span style="font-size: small; "><span style="color: rgb(255, 0, 0); "><b>avrai diritto alla spedizione gratuita!</b></span></span>' . '</span>';
    } else {
    $content .= '<span class="freeoptions">' . '<p style="text-align: center; "><span style="font-size: small; "><span style="color: rgb(255, 0, 0); "><b>Complimenti! Hai diritto alla spedizione gratuita!</b></span></span>' . '</span>';
    }
    } else {
    $content .= '<span class="freeshipping">' . 'Spedizione gratuita per ordini di ' . $currencies->format($free_limit) . ' or more.' . '</span>';
    }
    }
    //End of free shipping qualifier

    This is the hacked code
    //Begin free shipping qualifier
    $free_ship_on = MODULE_SHIPPING_FREEOPTIONS_STATUS;

    if ($free_ship_on == 'True') {
    $free_limit = MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN;
    if ($_SESSION['cart']->count_contents() > 0) {
    $_SESSION['cart']->get_products();
    $basket_total = $_SESSION['cart']->show_total();
    if $_SESSION['cart']->in_cart_check('product_is_always_free_shipping','1') {
    $content .= '<span class="freeoptions">' . '<p style="text-align: center; "><span style="font-size: small; "><span style="color: rgb(255, 0, 0); "><b>Complimenti! Hai diritto alla spedizione gratuita!</b></span></span>' . '</span>';
    {

    if ($basket_total < $free_limit) {
    $diff_to_free = ($free_limit - $basket_total);
    $content .= '<span class="freeoptions">' . '<style="text-align: center; "><span style="font-size: small; "><span style="color: rgb(255, 0, 0); "><b>Aggiungendo prodotti per '. $currencies->format($diff_to_free) .' <style="text-align: center; "><span style="font-size: small; "><span style="color: rgb(255, 0, 0); "><b>avrai diritto alla spedizione gratuita!</b></span></span>' . '</span>';
    } else {
    $content .= '<span class="freeoptions">' . '<p style="text-align: center; "><span style="font-size: small; "><span style="color: rgb(255, 0, 0); "><b>Complimenti! Hai diritto alla spedizione gratuita!</b></span></span>' . '</span>';
    }
    } else {
    $content .= '<span class="freeshipping">' . 'Spedizione gratuita per ordini di ' . $currencies->format($free_limit) . ' or more.' . '</span>';
    }
    }
    }
    //End of free shipping qualifier

 

 
Page 1 of 2 12 LastLast

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
  •