Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33
  1. #1
    Join Date
    Feb 2012
    Posts
    427
    Plugin Contributions
    0

    Default Offer flat rate for 1 item...?

    Hello,
    I have had a look around but am still unsure...

    I charge for shipping based on amount purchased. However, I have a couple of items where I want ONLY a flat rate option for the product.
    Can anyone help me with this?

    I currently have zones turned on with 4 different zones. I have just turned on flat rate to see if there were settings/ options to assign it to a product but there arent. So currently I have those 2 turned on.

    The items that are getting charged this are the jewellery items rather than the supplies so no matter what they will incur this charge as they are packaged in little boxes etc so when someone buys supplies and jewellery, they are charged £1 per jewellery item and then the supplies are a much cheaper rate. Otherwise they would get charged £.50 for a necklace as my postage is charged on cost. I was doing it when i was using paypal buttons on my current site.

    Hope this makes sense

    Adding the amount onto the item, how do i then actually assign it as a free postage for that product?

    I also need a separate shipping for the jewellery to make it cheaper for the customer, however if I put free shipping but add the cost onto the item, people from other countries will be buying a product with uk priced shipping which will lose me money. So the free shipping route will not work. I really need to just assign a flat rate to the jewellery items. Is there a way to do this?

    Thanks
    A

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

    Default Re: Offer flat rate for 1 item...?

    You have Products that shipping works with the Zone Rate zones shipping module based on Price, correct?

    You have other Products that you want to charge a Flat Rate for ... correct?

    On the Products that you want to charge a Flat Rate for:

    1 Are they all in the same master_categories_id or in a few master_categories_id

    2 If there is just 1 of these in the cart, what do you want to charge for the shipping

    3 If there are 4 of these in the cart, what do you want to charge for the shipping

    4 If there is quantity 3 of one of these Products in the cart, what do you want to charge for the shipping
    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. #3
    Join Date
    Feb 2012
    Posts
    427
    Plugin Contributions
    0

    Default Re: Offer flat rate for 1 item...?

    All the ones that need flat rate are in the same major catagories.

    If someone selects a supply in needs to be charged on zones, if it is jewellery it needs to be a flat rate. If someone orders from each, there shipping needs to be a charge for supplies and an extra £1.50 for the jewellery. if you get what I mean. Because jewellery is charged at £10 a necklace I don't want that getting charged zones as it will push up the postage price a lot.

    A

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

    Default Re: Offer flat rate for 1 item...?

    So if I buy 1 product from the jewellery master_categories_id 12, for example, it is $1.50 for shipping ...

    And, if I buy 12 products from the jewellery master_categories_id 12, for example, it is $1.50 for shipping ... correct?

    And you understand that the master_categories_id is the immediate categories_id that the Product belongs to ... correct?
    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. #5
    Join Date
    Feb 2012
    Posts
    427
    Plugin Contributions
    0

    Default Re: Offer flat rate for 1 item...?

    Correct, also, I need to have an option for this flat rate to have country options, £1.50 for uk, £2 for rest of world.
    It is getting a little complicated isn't it! I currently can set postage options per product using paypal buttons and this is what I would like to kind of do

    Thanks
    A

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

    Default Re: Offer flat rate for 1 item...?

    Add to each of the Zone Rates:
    0.00:0.00,

    so that it can handle when only the 319 category products are in the cart ...

    Then, change the function quote in th:
    /includes/modules/shipping/zones.php

    to read:
    Code:
    // class methods
        function quote($method = '') {
          global $order, $shipping_weight, $shipping_num_boxes, $total_count;
          $dest_country = $order->delivery['country']['iso_code_2'];
          $dest_zone = 0;
          $error = false;
    
        $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
    
    // bof: separate flat charge for master_categories_id 319
          global $cart;
          $products = $_SESSION['cart']->get_products();
          $chk_cost = 0.00;
          $chk_count = 0;
          $extra_charge = 0.00;
          // calculate cost of master_categories_id 319
          for ($i=0, $n=sizeof($products); $i<$n; $i++) {
            // calculate price and quantity master_categories_id 319
    //echo 'Product id: ' . $products[$i]['id'] . ' master: ' . $products[$i]['category'] . '<br>';
            if ($products[$i]['category'] == 319) {
              $chk_cost += $products[$i]['final_price'];
              $chk_count += $products[$i]['quantity'];
            }
          }
    
    // set extra_charge_amount for UK - GB
          if ($chk_count > 0) {
            $extra_charge_amount = 1.50;
          }
          for ($i=1; $i<=$this->num_zones; $i++) {
            $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
            $countries_table = strtoupper(str_replace(' ', '', $countries_table));
            $country_zones = preg_split("/[,]/", $countries_table);
            if (in_array($dest_country, $country_zones)) {
              $dest_zone = $i;
              break;
            }
            if (in_array('00', $country_zones)) {
              $dest_zone = $i;
    // change extra_charge_amount for rest of the world
              if ($chk_count > 0) {
                $extra_charge_amount = 2.00;
              }
              break;
            }
          }
    
          // reduce order total by master_categories_id 319
          $order_total_amount -= $chk_cost;
          // if  master_categories_id 319 are in the cart build extra charge
          if ($chk_count > 0) {
            $extra_charge = $extra_charge_amount;
          }
          // if only master_categories_id 319 set total to 0.00
          if ($chk_count == $total_count) {
    //        $order_total_amount = 0.00;
          }
    //echo ' Order Total: ' . $order_total_amount . ' reduced order by: ' . $chk_cost . ' extra charge: ' . $extra_charge . '<br>';
    // eof: separate flat charge for master_categories_id 319
    
          if ($dest_zone == 0) {
            $error = true;
          } else {
            $shipping = -1;
            $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);
    
            $zones_table = preg_split("/[:,]/" , $zones_cost);
            $size = sizeof($zones_table);
            $done = false;
            for ($i=0; $i<$size; $i+=2) {
              switch (MODULE_SHIPPING_ZONES_METHOD) {
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Weight'):
                  if (round($shipping_weight,9) <= $zones_table[$i]) {
                    $shipping = $zones_table[$i+1];
    
                    switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
                    case (0):
                      $show_box_weight = '';
                      break;
                    case (1):
                      $show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
                      break;
                    case (2):
                      $show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes,2) . MODULE_SHIPPING_ZONES_TEXT_UNITS . ')';
                      break;
                    default:
                      $show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight,2) . MODULE_SHIPPING_ZONES_TEXT_UNITS . ')';
                      break;
                    }
    
    //                $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . (SHIPPING_BOX_WEIGHT_DISPLAY >= 2 ? ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS : '');
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . $show_box_weight;
                    $done = true;
            if (strstr($zones_table[$i+1], '%')) {
              $shipping = ($zones_table[$i+1]/100) * $order_total_amount;
            } else {
              $shipping = $zones_table[$i+1];
            }
                    break;
            	    }
          	    break;
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Price'):
    // shipping adjustment
    // bof: separate flat charge for master_categories_id 319
    // adjust for Price for master_categories_id 319 by $chk_cost
                  if ((($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) - $chk_cost) <= $zones_table[$i]) {
    // eof: separate flat charge for master_categories_id 319
                    $shipping = $zones_table[$i+1];
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country;
            if (strstr($zones_table[$i+1], '%')) {
              $shipping = ($zones_table[$i+1]/100) * $order_total_amount;
            } else {
              $shipping = $zones_table[$i+1];
            }
                    $done = true;
                    break;
    	            }
    	          break;
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Item'):
    // shipping adjustment
                  if (($total_count - $_SESSION['cart']->free_shipping_items()) <= $zones_table[$i]) {
                    $shipping = $zones_table[$i+1];
                    $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country;
                    $done = true;
            if (strstr($zones_table[$i+1], '%')) {
              $shipping = ($zones_table[$i+1]/100) * $order_total_amount;
            } else {
              $shipping = $zones_table[$i+1];
            }
                    break;
      	          }
    	          break;
              }
              if ($done == true) {
                break;
              }
            }
    
            if ($shipping == -1) {
              $shipping_cost = 0;
              $shipping_method = MODULE_SHIPPING_ZONES_UNDEFINED_RATE;
            } else {
              switch (MODULE_SHIPPING_ZONES_METHOD) {
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Weight'):
                  // charge per box when done by Weight
                  // Handling fee per box or order
                  if (constant('MODULE_SHIPPING_ZONES_HANDLING_METHOD_' . $dest_zone) == 'Box') {
                    $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone) * $shipping_num_boxes;
                  } else {
                    $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
                  }
                  break;
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Price'):
                  // don't charge per box when done by Price
                  $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
                break;
            	  case (MODULE_SHIPPING_ZONES_METHOD == 'Item'):
                  // don't charge per box when done by Item
                  $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
                break;
              }
            }
          }
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => $shipping_method,
                                                         'cost' => $extra_charge + $shipping_cost)));
    
          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);
    
          if (strstr(MODULE_SHIPPING_ZONES_SKIPPED, $dest_country)) {
            // don't show anything for this country
            $this->quotes = array();
          } else {
            if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;
          }
    
          return $this->quotes;
        }
    What this will do is handle the regular products and your category 319 products ...
    Last edited by Ajeh; 13 Apr 2012 at 07:38 PM.
    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. #7
    Join Date
    Feb 2012
    Posts
    427
    Plugin Contributions
    0

    Default Re: Offer flat rate for 1 item...?

    Hello,
    I have added the 0.00:0.00 zone rates and added the code to the correct file and uploaded it.

    Stupid question... What do I do now???

    Thanks
    A

  8. #8
    Join Date
    Feb 2012
    Posts
    427
    Plugin Contributions
    0

    Default Re: Offer flat rate for 1 item...?

    Since I have done this, the estimate shipping window wont load and I can't go to checkout. I'm gonna change it back and try again but if it happens again, i'm not sure what to do.

    A

  9. #9
    Join Date
    Feb 2012
    Posts
    427
    Plugin Contributions
    0

    Default Re: Offer flat rate for 1 item...?

    Yep, I tried it twice more and when I paste that into the correct part it stops all postage working!

    Thankyou
    A

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

    Default Re: Offer flat rate for 1 item...?

    What are your settings in the Zone Rate zones shipping module in the right panel when you click on it?

    If you look in the directory /cache

    What debug errors are in the log files?
    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 1 of 4 123 ... LastLast

Similar Threads

  1. Offer flat rate for 1 item...?
    By rainbow_pixie_star in forum General Questions
    Replies: 8
    Last Post: 20 Aug 2012, 07:33 PM
  2. Flat rate for 1 item and more for each additional item
    By spookyghost in forum General Questions
    Replies: 4
    Last Post: 29 Dec 2009, 08:56 PM
  3. How do I offer multiple Flat Rate shippings and per item shipping at the same time??
    By nyanko chan in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 11 Nov 2008, 05:48 PM
  4. Flat rate in US but flat rate + $1 for ea additional item - International?
    By bakdoor in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 19 Oct 2008, 12:07 AM
  5. Flat Rate for Specific Item
    By Webskipper in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 7 Jan 2008, 08:42 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