Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: HELP Zones Shipping (Extra Cost For Large Items)

    Is this products_attributes_id 8 the only Attribute on this Product?
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  2. #2
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: HELP Zones Shipping (Extra Cost For Large Items)

    No, it also has a products_attributes_id of '7'

    No Frame - products_attributes_id 7 (options_values_id 2)
    With Frame - products_attributes_id 8 (options_values_id 1)

    Only some products have a frame option

    It is products 'With Frame' that need to be classed as oversized

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: HELP Zones Shipping (Extra Cost For Large Items)

    Would something like this work for you?
    Code:
    /* Method to calculate the number of items in a cart based on an attribute option_id and option_values_id combo */
    // example: $_SESSION['cart']->in_cart_check_attrib_quantity(1, 16)
    
      function in_cart_check_attrib_quantity($check_option_id, $check_option_values_id) {
    //    global $db;
        // if nothing is in cart return 0
        if (!is_array($this->contents)) return 0;
    
        // compute total quantity for field
        $in_cart_check_qty = 0;
    
        $chk_products = $this->get_products();
        for ($i=0, $n=sizeof($chk_products); $i<$n; $i++) {
          foreach ($chk_products[$i]['attributes'] as $option => $value) {
            if ($option == $check_option_id && $value == $check_option_values_id) {
    //          echo 'Attribute FOUND FOR $option: ' . $option . ' $value: ' . $value . ' quantity: ' . $chk_products[$i]['quantity'] . '<br><br>';
              $in_cart_check_qty += $chk_products[$i]['quantity'];
            }
          }
        }
        return $in_cart_check_qty;
      }
    I have an idea to expand a similar function with more flexibility in the future but I am still giving it a think ...
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,303
    Plugin Contributions
    1

    Default Re: HELP Zones Shipping (Extra Cost For Large Items)

    Quote Originally Posted by Ajeh View Post
    Would something like this work for you?
    Code:
    /* Method to calculate the number of items in a cart based on an attribute option_id and option_values_id combo */
    // example: $_SESSION['cart']->in_cart_check_attrib_quantity(1, 16)
    
      function in_cart_check_attrib_quantity($check_option_id, $check_option_values_id) {
    //    global $db;
        // if nothing is in cart return 0
        if (!is_array($this->contents)) return 0;
    
        // compute total quantity for field
        $in_cart_check_qty = 0;
    
        $chk_products = $this->get_products();
        for ($i=0, $n=sizeof($chk_products); $i<$n; $i++) {
          foreach ($chk_products[$i]['attributes'] as $option => $value) {
            if ($option == $check_option_id && $value == $check_option_values_id) {
    //          echo 'Attribute FOUND FOR $option: ' . $option . ' $value: ' . $value . ' quantity: ' . $chk_products[$i]['quantity'] . '<br><br>';
              $in_cart_check_qty += $chk_products[$i]['quantity'];
            }
          }
        }
        return $in_cart_check_qty;
      }
    I have an idea to expand a similar function with more flexibility in the future but I am still giving it a think ...

    I think that is exactly what I needed, the couple of checks I've made seem to work well - I'll test more once I've fully set up my shipping and hopefully give some feedback/suggestions for your future design.

    This last bit of help was all I needed to finalise my shipping costs (until I find something else!) so thank you very much.

    I've sent the Team a coffee and donut.

    Cheers

    Simon

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v150 One shipping cost for some items then flat rate for 2 or more
    By annav in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 27 Jun 2013, 06:02 PM
  2. Increase Shipping Cost for Larger Items
    By mned in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 20 Aug 2010, 02:45 PM
  3. Different shipping cost for some items?
    By Treasuresbycaz in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 1 Jan 2009, 09:36 PM
  4. Same shipping cost for up to X items, then increment shipping after that
    By infinitecreature in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 4 Dec 2008, 07:03 AM
  5. Shipping cost for 7 different zones ??
    By Xam in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 9 Apr 2008, 02:16 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