Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Offer flat rate for 1 item...?

Offer flat rate for 1 item...?

Views: 4,896

Results 1 to 20 of 33
13 Apr 2012, 1:16 PM
#1
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

13 Apr 2012, 3:59 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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!]
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!

13 Apr 2012, 4:42 PM
#3
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

13 Apr 2012, 4:48 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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!]
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!

13 Apr 2012, 5:31 PM
#5
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

13 Apr 2012, 6:28 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

// 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 ...

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!

14 Apr 2012, 9:56 AM
#7
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

14 Apr 2012, 10:02 AM
#8
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

14 Apr 2012, 10:36 AM
#9
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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! :frusty:

Thankyou
A

14 Apr 2012, 12:40 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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!]
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!

14 Apr 2012, 2:54 PM
#11
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

Hello,
My zone rates say...
Zone Based Rates

Enable Zones Method
True

Calculation Method
Price

Tax Class
--none--

Tax Basis
Shipping

Sort Order
1

My debug logs in cache are many! is there a way to reset them as I think a couple apply to changes I made which I then changed back. That way i will be able to see which ones I need.

Thanks
A

14 Apr 2012, 3:04 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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

I need to see ALL of the settings for Zone Rate zones ... that is just a portion of them ...

What do the debug error logs read if you open them up? Check the newest ones ...

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!

14 Apr 2012, 3:59 PM
#13
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

Here are the April ones of the last 3 days...

12-Apr-2012 16:29:19] PHP Fatal error: Cannot redeclare class shipping in /home3/craftja1/public_html/directory/includes/modules/shipping/shipping.php on line 10

[12-Apr-2012 16:52:07] PHP Fatal error: Cannot redeclare class shipping in /home3/craftja1/public_html/directory/includes/modules/shipping/shipping.php on line 10

[13-Apr-2012 03:30:58] PHP Parse error: syntax error, unexpected T_STRING in /home3/craftja1/public_html/directory/includes/languages/english/shopping_cart.php on line 26

[13-Apr-2012 03:31:03] PHP Parse error: syntax error, unexpected T_STRING in /home3/craftja1/public_html/directory/includes/languages/english/shopping_cart.php on line 26
[12-Apr-2012 16:29:13] PHP Fatal error: Cannot redeclare class shipping in /home3/craftja1/public_html/directory/includes/modules/shipping/shipping.php on line 10

[12-Apr-2012 16:28:51] PHP Fatal error: Cannot redeclare class shipping in /home3/craftja1/public_html/directory/includes/modules/shipping/shipping.php on line 10

[12-Apr-2012 16:28:48] PHP Fatal error: Cannot redeclare class shipping in /home3/craftja1/public_html/directory/includes/modules/shipping/shipping.php on line 10

[12-Apr-2012 16:28:21] PHP Fatal error: Cannot redeclare class shipping in /home3/craftja1/public_html/directory/includes/modules/shipping/shipping.php on line 10

[12-Apr-2012 16:26:20] PHP Fatal error: Cannot redeclare class shipping in /home3/craftja1/public_html/directory/includes/modules/shipping/shipping.php on line 10

[12-Apr-2012 16:26:11] PHP Fatal error: Cannot redeclare class shipping in /home3/craftja1/public_html/directory/includes/modules/shipping/shipping.php on line 10

[14-Apr-2012 04:59:45] PHP Parse error: syntax error, unexpected '}' in /home3/craftja1/public_html/directory/includes/modules/shipping/zones.php on line 329

[13-Apr-2012 03:32:18] PHP Parse error: syntax error, unexpected ')' in /home3/craftja1/public_html/directory/includes/languages/english/shopping_cart.php on line 26

[13-Apr-2012 03:32:17] PHP Parse error: syntax error, unexpected ')' in /home3/craftja1/public_html/directory/includes/languages/english/shopping_cart.php on line 26

[13-Apr-2012 03:31:12] PHP Parse error: syntax error, unexpected T_STRING in /home3/craftja1/public_html/directory/includes/languages/english/shopping_cart.php on line 26

[13-Apr-2012 03:31:04] PHP Parse error: syntax error, unexpected T_STRING in /home3/craftja1/public_html/directory/includes/languages/english/shopping_cart.php on line 26

[12-Apr-2012 16:43:42] PHP Fatal error: Cannot redeclare class freeshipper in /home3/craftja1/public_html/directory/includes/modules/shipping/freeshipper.php on line 10

[12-Apr-2012 16:42:21] PHP Fatal error: Cannot redeclare class freeshipper in /home3/craftja1/public_html/directory/includes/modules/shipping/freeshipper.php on line 10

[12-Apr-2012 16:42:17] PHP Fatal error: Cannot redeclare class freeshipper in /home3/craftja1/public_html/directory/includes/modules/shipping/freeshipper.php on line 10

[12-Apr-2012 16:42:09] PHP Fatal error: Cannot redeclare class freeshipper in /home3/craftja1/public_html/directory/includes/modules/shipping/freeshipper.php on line 10

[12-Apr-2012 16:38:57] PHP Fatal error: Cannot redeclare class freeshipper in /home3/craftja1/public_html/directory/includes/modules/shipping/freeshipper.php on line 10

[12-Apr-2012 16:38:51] PHP Fatal error: Cannot redeclare class freeshipper in /home3/craftja1/public_html/directory/includes/modules/shipping/freeshipper.php on line 10

[14-Apr-2012 05:35:20] PHP Parse error: syntax error, unexpected $end, expecting T_FUNCTION in /home3/craftja1/public_html/directory/includes/modules/shipping/zones.php on line 326

[14-Apr-2012 05:33:01] PHP Parse error: syntax error, unexpected T_STRING in /home3/craftja1/public_html/directory/includes/modules/shipping/zones.php on line 182
[14-Apr-2012 05:32:51] PHP Parse error: syntax error, unexpected T_STRING in /home3/craftja1/public_html/directory/includes/modules/shipping/zones.php on line 182

[14-Apr-2012 05:00:37] PHP Parse error: syntax error, unexpected '}' in /home3/craftja1/public_html/directory/includes/modules/shipping/zones.php on line 329

[14-Apr-2012 05:00:06] PHP Parse error: syntax error, unexpected '}' in /home3/craftja1/public_html/directory/includes/modules/shipping/zones.php on line 329
[14-Apr-2012 04:59:52] PHP Parse error: syntax error, unexpected '}' in /home3/craftja1/public_html/directory/includes/modules/shipping/zones.php on line 329

Did you mean you wanted everything from my zones? This is everything...

Zone Based Rates

Enable Zones Method
True

Calculation Method
Price

Tax Class
--none--

Tax Basis
Shipping

Sort Order
1

Skip Countries, use a comma separated list of the two character ISO country codes

Zone 1 Countries
GB,IR,JE,GG

Zone 1 Shipping Table
0.00:0.00,4.99:1,9:2,12:2.50,14.99:3.50,19.99:5.50,38:6.50,50:10

Zone 1 Handling Fee
0

Handling Per Order or Per Box Zone 1 (when by weight)
Order

Zone 2 Countries
AT,BE,DK,FI,FR,DE,GR,IT,NO,NL,PT,PL,CZ,ES,SE,CH,HU

Zone 2 Shipping Table
0.00:0.00,4.99:2.20,9:3.20,12:4,14.99:4.50,19.99:6.50,38:8,45:12,60:20

Zone 2 Handling Fee
0

Handling Per Order or Per Box Zone 2 (when by weight)
Order

Zone 3 Countries
US,CA,AU,BR,CL,CN,CO,CR,CU,CY,DO,EG,FK,FJ,GE,GL,HK,IS,IN,ID,IR,IL,JM,MT,MX,MA,NZ,PE,PH,PR,RU,SA,SG,ZA,LK,TW,TH,TN,TR,UA,AE,US,UM,VE,VN

Zone 3 Shipping Table
0.00:0.00,4.99:2.50,10:4,14.99:4.80,19.99:6.50,38:10,45:12,60:20

Zone 3 Handling Fee
0

Handling Per Order or Per Box Zone 3 (when by weight)
Order

14 Apr 2012, 4:40 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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

It looks like you have errors in the zones.php ...

Try this file ...

Then, delete all of the debug log files in the:
/cache

and try again and see what errors show up, if any ...

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!

14 Apr 2012, 5:32 PM
#15
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

Hi,
All uploaded and still lets me look at shipping. I cannot see any debug errors yet:clap:

So whats next? Assigning flat rate to particular products?

Thankls
A

14 Apr 2012, 5:45 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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

You need to change this section of code that starts with the line in BLACK and ends in the line in BLACK:

[B]// set extra_charge_amount for UK - GB
[/B]      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;
          break;
        }
      }
// change extra_charge_amount for rest of the world
          if ($chk_count > 0 && $dest_country != 'GB') {
            $extra_charge_amount = 2.00;
          }

[B]      // reduce order total by master_categories_id 319[/B]

Now if something from ONLY Category 319 is in the cart, it will charge either the 1.50 for United Kingdom or the 2.00 for everyone else ...

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!

14 Apr 2012, 5:57 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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

NOTE: if your Zone 3 definitions is suppose to be everyone not in Zone 1 and Zone 2, use instead:
00

instead of the countries that you have in Zone 3, so that nothing is forgotten or to avoid errors ... example, you have the US in there twice ...

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!

14 Apr 2012, 6:24 PM
#18
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

Oh, thanks, ill set zone 3 to 00.

When it says reduce order total by master_categories_id 319, do I change this to the number next to the main category?
If I want more than 1 category added to this, would I do... Reduce order total by master_categories_id 42, 59, 100 etc? and seperate with a comma.

Thanks
A

14 Apr 2012, 6:25 PM
#19
rainbow_pixie_star avatar

rainbow_pixie_star

Zen Follower

Join Date:
Feb 2012
Posts:
427
Plugin Contributions:
0

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

OH! Also as the category i want to use isn't 319, do I change EVERY 319 in that document or just particular ones?

:wacko:

14 Apr 2012, 6:31 PM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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

I am going to need to start drinking early today ... :frusty:

Let me see what all code has to be changed to do multiple master_categories_id ...

NOTE: the master_categories_id is NOT a categories_id that holds Categories ... it is the immediate categories_id that the Product belongs to ...

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!