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