Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 70
  1. #51
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    131
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    That works :) Thanks so much Linda :)

    Now I just have one last question...

    I have two different drop-shipping rates for different products (say A for $15 and B for $35), and then use Per Item for the products I stock.

    So, when a customer has any number of drop-ship A in their cart, Flat Rate #1 at $15 will be the only option available. The same goes for each of the other products - Flat Rate #2 at $35, Per Item at $6, etc.

    I want to have just one shipping method as the only option, no matter what a customer has in their cart, but this next part is confusing me as to how to get it to work:

    If a customer buys one of each of the drop-shipped items (A and B), Flat Rate #2 ($35) would be the only option.

    And if a customer buys either of the drop-shipped items (A or B), combined with products I stock, then the respective shipping rate would show. For example, if a customer buys an item from A as well as items I stock, the shipping would be Flat Rate #1 at $15. If item A was changed to B, then the shipping would be #2 at $35.

    How would I get all this into the code?

    Again - thanks so much for your help. I REALLY appreciate it :)

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    If you were to add this code into the quote section of the Item Rate item shipping module:
    Code:
        // check if manufacturer 1 or 2 is in cart
          if (IS_ADMIN_FLAG == false) {
            global $cart;
            $chk_manufacturers_id1 = $_SESSION['cart']->in_cart_check('manufacturers_id', '1');
            $chk_manufacturers_id2 = $_SESSION['cart']->in_cart_check('manufacturers_id', '2');
            $chk_manufacturers_id = $chk_manufacturers_id1 + $chk_manufacturers_id2;
          }
    You would know how many items are from manufacturers_id 1 and from manufacturers_id 2 ...

    The Item Rate is using the number of items in the cart ...

    If you were to subtract from the number of items about to be calculated the $chk_manufacturers_id you would then just be charging the Item Rate for all products not in 1 and 2 ... just under this code in item.php

    Code:
          // adjusted count for free shipping
          $item_total_count = $total_count - $_SESSION['cart']->free_shipping_items();
    then, you can add in the extra charge for the Flat Rate amount to this calculation based on $chk_manufacturers_id1 >= 1 add $15.00 and $chk_manufacturers_id2 >= 1 add $35 ... by adjusting the code in this section:
    Code:
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
                                                         'cost' => (MODULE_SHIPPING_ITEM_COST * $item_total_count) + MODULE_SHIPPING_ITEM_HANDLING)));
    So Flat Rate should only be used for manufacturers_id 1 and 2 and the amounts altered to $15 or $35 or both ... otherwise, Flat Rate should not show if there are other products in the cart ...

    Item Rate should be altered to not show when only products are from manufacturers_id 1 and 2 ...

    Item Rate should be altered to reduce the item count based on anything from manufacturers_id 1 and 2 ... and add the additional charges for manufacturers_id 1 and 2 ...

    Note: in theory, this could all be done in Item Rate item as the Item Rate would be 0 when only products are from manufacturers_id 1 and 2 ... and then the calculations for manufacturers_id 1 and 2 would be used ... providing you write the code correctly ...
    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.5]
    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!

  3. #53
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    131
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Well, I added the codes into the modules, but now the shipping estimate shows two Per Item methods, instead of Flat Rate, when I have manufacturers 1 and/or 2 in the cart (the one that should be Flat Rate is showing at $0).

    The Per Item module (the one that's supposed to show) is fine when I have products from any other manufacturer in the cart, and it is the only option available.

    I'm thinking it has something to do with this part you mentioned:

    Quote Originally Posted by Ajeh View Post
    If you were to subtract from the number of items about to be calculated the $chk_manufacturers_id you would then just be charging the Item Rate for all products not in 1 and 2 ... just under this code in item.php

    Code:
          // adjusted count for free shipping
          $item_total_count = $total_count - $_SESSION['cart']->free_shipping_items();
    I don't quite understand what you mean by this... am I supposed to add a piece of coding here?

    Thanks again,
    Tija

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    If you only used the Item Rate item shipping module ... you would do the calculation for the two manufacturers_id in it ...

    NOTE: based on where the code is you do not need to test for if in the admin or not ...

    Change the quote function to:
    Code:
    // class methods
        function quote($method = '') {
          global $order, $total_count;
    
        // check if manufacturer 1 or 2 is in cart
            global $cart;
            $chk_manufacturers_id1 = $_SESSION['cart']->in_cart_check('manufacturers_id', '1');
            $chk_manufacturers_id2 = $_SESSION['cart']->in_cart_check('manufacturers_id', '2');
            $chk_manufacturers_id = $chk_manufacturers_id1 + $chk_manufacturers_id2;
    
       // calculate charges for manufacturers 1 or 2
            $extra_manufacturers_charge = 0.00;
            if ($chk_manufacturers_id1 > 0) {
              $extra_manufacturers_charge += 15;
            }
    
            if ($chk_manufacturers_id2 > 0) {
              $extra_manufacturers_charge += 35;
            }
    
          // adjust count for manufacturers
          // adjusted count for free shipping
          $item_total_count = $total_count - $chk_manufacturers_id1 - $chk_manufacturers_id2 - $_SESSION['cart']->free_shipping_items();
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
                                                         'cost' => $extra_manufacturers_charge + (MODULE_SHIPPING_ITEM_COST * $item_total_count) + MODULE_SHIPPING_ITEM_HANDLING)));
    This way, there is only one shipping method handling everything ...
    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.5]
    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!

  5. #55
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    131
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Well, that works for the two separate drop-ship prices, but this part doesn't seem to be working:

    Code:
          // adjust count for manufacturers
          // adjusted count for free shipping
          $item_total_count = $total_count - $chk_manufacturers_id1 - $chk_manufacturers_id2 - $_SESSION['cart']->free_shipping_items();
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
                                                         'cost' => $extra_manufacturers_charge + (MODULE_SHIPPING_ITEM_COST * $item_total_count) + MODULE_SHIPPING_ITEM_HANDLING)));
    When I have the two different manufacturers in the cart, the shipping adds together - so it comes to $50 instead of $35 for the combined drop-ship items, and just adds the Per Item rate onto those rates for drop-ship products combined with products I stock.

    Any ideas?

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Could you post the whole quote portion of the item.php file so that we can see what you are using right now?

    NOTE: this is the only portion of the code that should be changed and the only shipping module that should be installed ...
    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.5]
    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!

  7. #57
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    131
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Hopefully this is the correct part of the code... I'm not familiar with PHP at all

    Code:
    // class methods
        function quote($method = '') {
          global $order, $total_count;
    
        // check if manufacturer 1 or 2 is in cart
            global $cart;
            $chk_manufacturers_id1 = $_SESSION['cart']->in_cart_check('manufacturers_id', '1');
            $chk_manufacturers_id2 = $_SESSION['cart']->in_cart_check('manufacturers_id', '2');
            $chk_manufacturers_id = $chk_manufacturers_id1 + $chk_manufacturers_id2;
    
       // calculate charges for manufacturers 1 or 2
            $extra_manufacturers_charge = 0.00;
            if ($chk_manufacturers_id1 > 0) {
              $extra_manufacturers_charge += 15;
            }
    
            if ($chk_manufacturers_id2 > 0) {
              $extra_manufacturers_charge += 35;
            }
    
          // adjust count for manufacturers
          // adjusted count for free shipping
          $item_total_count = $total_count - $chk_manufacturers_id1 - $chk_manufacturers_id2 - $_SESSION['cart']->free_shipping_items();
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
                                                         'cost' => $extra_manufacturers_charge + (MODULE_SHIPPING_ITEM_COST * $item_total_count) + MODULE_SHIPPING_ITEM_HANDLING)));
    
          if ($this->tax_class > 0) {
            $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
          }
    
          if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
    
          return $this->quotes;
        }
    NOTE: this is the only portion of the code that should be changed and the only shipping module that should be installed ...
    I haven't altered any other part of the code and it is the only module installed except for Zone Rates, as I ship internationally.

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    What charges do you get if you add 1 product from manufacturers_id 1?

    What charges do you get if you add 2 product from manufacturers_id 1?

    What charges do you get if you add 1 product from manufacturers_id 2?

    What charges do you get if you add 2 product from manufacturers_id 2?

    What charges do you get if you add 1 product from manufacturers_id 1 and 1 product from manufacturers_id 2?
    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.5]
    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!

  9. #59
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    131
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    what charges do you get if you add 1 product from manufacturers_id 1?
    $15

    what charges do you get if you add 2 product from manufacturers_id 1?
    $15

    what charges do you get if you add 1 product from manufacturers_id 2?
    $35

    what charges do you get if you add 2 product from manufacturers_id 2?
    $35

    what charges do you get if you add 1 product from manufacturers_id 1 and 1 product from manufacturers_id 2?
    $50

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Okay so that part is working fine to charge the correct amounts based on those two manufacturers_id values ...

    Now, you should have your Item Rate setup to charge a certain amount per item when you add a Product to the order that is not in manufacturers_id 1 or 2 ...

    If you add 1 Product to the order that is not in manufacturers_id 1 or 2 what is the amount?

    If you add 2 Product to the order that is not in manufacturers_id 1 or 2 what is the amount?

    If you add 1 Product to the order that is not in manufacturers_id 1 or 2 and add 1 Product from manufacturers_id 1 what is the amount?

    If you add 2 Product to the order that is not in manufacturers_id 1 or 2 and add 1 Product from manufacturers_id 1 what is the amount?
    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.5]
    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!

 

 
Page 6 of 7 FirstFirst ... 4567 LastLast

Similar Threads

  1. How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?
    By MarleneF in forum Built-in Shipping and Payment Modules
    Replies: 36
    Last Post: 31 Aug 2011, 04:15 PM
  2. Flat rate for 1 category, Per Item for all others
    By Znak in forum Built-in Shipping and Payment Modules
    Replies: 19
    Last Post: 18 Aug 2011, 03:09 PM
  3. Multiple zone/flat rate and added cost per pound?
    By AmyCapolupo in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 14 Jul 2011, 09:21 AM
  4. How Can I Set a Flat Rate for shipping on 1 item and rest by weight ?
    By vividbreeze in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Jan 2010, 05:26 AM
  5. Flat Rate for some products, ship by weight for other products
    By caspar in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 28 Mar 2007, 01:12 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