What I want to do is pretty simple in theory, but I have had no luck so far achieving this. Any help is greatly appreciated...
Rather than use the 'requires shipping' feature associated with each product, I really need opencart to display the shipping/delivery modules from the Shopping Cart and Checkout if and only if the total cart weight is greater than zero. Can somebody please help me?
So far, all attempts at using weight-based shipping modules has fallen short because even though the shipping charge might evaluate to $0.00 for a cart weight of 0.00, the idea here is to be able to completely skip over the shipping requirements during checkout if the cart weight is truly zero. Make sense? Thanks in advance...
Rather than use the 'requires shipping' feature associated with each product, I really need opencart to display the shipping/delivery modules from the Shopping Cart and Checkout if and only if the total cart weight is greater than zero. Can somebody please help me?
So far, all attempts at using weight-based shipping modules has fallen short because even though the shipping charge might evaluate to $0.00 for a cart weight of 0.00, the idea here is to be able to completely skip over the shipping requirements during checkout if the cart weight is truly zero. Make sense? Thanks in advance...
Last edited by TraderDan on Sat Jan 14, 2012 5:00 am, edited 1 time in total.
To put it one other way, here is an example of the problem I'm facing...
THE GIVENS:
- I have a product with 'Requires Shipping' set to no, a base weight of 0.00, and a set of options associated with it.
- A couple of the product options have individual weight values > 0.00 while a couple others have weight individual weight values that = 0.00 (these are digital download options).
THE PROBLEMS:
- If a customer chooses one of the options that has weight > 0, they are skipped over the shipping options during checkout.
- And if I change the 'Requires Shipping' option to yes for that product, then even if a customer chooses one of the digital options (weight = 0.00), they still get shown all the shipping steps during checkout.
I need the shipping module to trigger automatically, based solely on the total weight of the cart, nothing else.
Can this be done without pulling all my hair out? Again, thanks...
THE GIVENS:
- I have a product with 'Requires Shipping' set to no, a base weight of 0.00, and a set of options associated with it.
- A couple of the product options have individual weight values > 0.00 while a couple others have weight individual weight values that = 0.00 (these are digital download options).
THE PROBLEMS:
- If a customer chooses one of the options that has weight > 0, they are skipped over the shipping options during checkout.
- And if I change the 'Requires Shipping' option to yes for that product, then even if a customer chooses one of the digital options (weight = 0.00), they still get shown all the shipping steps during checkout.
I need the shipping module to trigger automatically, based solely on the total weight of the cart, nothing else.
Can this be done without pulling all my hair out? Again, thanks...
Have you thought about changing the "Free Shipping" to read "No Shipping", and set it available if cart weight is 0?
In catalog / language / english / shipping / free.php
Find:
Replace With:
In catalog / model / shipping / free.php
Find:
Before Add:
In catalog / language / english / shipping / free.php
Find:
Code: Select all
$_['text_title'] = 'Free Shipping';
$_['text_description'] = 'Free Shipping';
Code: Select all
$_['text_title'] = 'Digital Download';
$_['text_description'] = 'Digital Download';
Find:
Code: Select all
$method_data = array();
Code: Select all
if ($this->cart->getWeight() > 0) {
$status = false;
}
You could also modify your system file where it checks for shipping.
In system / library / cart.php
Find:
Replace With:
In system / library / cart.php
Find:
Code: Select all
public function hasShipping() {
$shipping = false;
foreach ($this->getProducts() as $product) {
if ($product['shipping']) {
$shipping = true;
break;
}
}
return $shipping;
}
Code: Select all
public function hasShipping() {
$shipping = false;
foreach ($this->getProducts() as $product) {
if ($product['shipping']) {
$shipping = true;
break;
}
}
if ($this->getWeight() <= 0) {
$shipping = false;
}
return $shipping;
}
YES! YES! YES! YES! YES! YES! YES! YES! YES! YES! YES! YES! YES!
THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!
This is EXACTLY what I was trying to do, I knew it had to be a simple thing! (I'm just not much of a programmer, and opencart is still very new to me)
One last request:
How can I make it so that my Handling Fee is only applied if the cart weight is greater than zero? Right now my $2.00 Handling Fee is being applied to all products, but I only want to include it when shipping physical items.
Thanks again, you've already helped me out SO MUCH!!
THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU! THANK YOU!
This is EXACTLY what I was trying to do, I knew it had to be a simple thing! (I'm just not much of a programmer, and opencart is still very new to me)
One last request:
How can I make it so that my Handling Fee is only applied if the cart weight is greater than zero? Right now my $2.00 Handling Fee is being applied to all products, but I only want to include it when shipping physical items.
Thanks again, you've already helped me out SO MUCH!!
Not a problem, glad to help.
For the handling fee, edit the file
catalog / model / total / handling.php
Find:
Replace With:
**Edit:
Attached a vQmod that will apply these changes for you so you won't have to modify your core files.
Cheers,
Joel.
For the handling fee, edit the file
catalog / model / total / handling.php
Find:
Code: Select all
if (($this->cart->getSubTotal() < $this->config->get('handling_total')) && ($this->cart->getSubTotal() > 0)) {
Code: Select all
if (($this->cart->getSubTotal() < $this->config->get('handling_total')) && ($this->cart->getSubTotal() > 0) && ($this->cart->getWeight() > 0)) {
Attached a vQmod that will apply these changes for you so you won't have to modify your core files.
Cheers,
Joel.
Attachments
OpenCart v1.5.1.3
Last edited by OpenCart Addons on Sat Jan 14, 2012 5:10 am, edited 1 time in total.
Joel, you solved all my shipping problems... you are officially my hero, I can't thank you enough!
Would it be wise on my part to incorporate these modifications into a vqmod as opposed to performing the changes on core files? In theory, these core files will get overwritten next time opencart gets upgraded to a new release, correct?
Thanks again for all your help.
Would it be wise on my part to incorporate these modifications into a vqmod as opposed to performing the changes on core files? In theory, these core files will get overwritten next time opencart gets upgraded to a new release, correct?
Thanks again for all your help.
Hi,
I have a similar issue. Right now I want weight based shipping to be applied to only if item is more than 25kgs. Is this possible?
For an example, I have 2 items called A and B. Item A weight only 10kgs. But Item B weight 25kgs. So if a customer is checking out with item A, then cart shouldn't display weight based shipping as an option but other shipping methods are used. But if a customer is checking out with item B then I want weight based shipping displayed as per shipping method. is this possible to achieve?
Thank you in advance,
pgp
I have a similar issue. Right now I want weight based shipping to be applied to only if item is more than 25kgs. Is this possible?
For an example, I have 2 items called A and B. Item A weight only 10kgs. But Item B weight 25kgs. So if a customer is checking out with item A, then cart shouldn't display weight based shipping as an option but other shipping methods are used. But if a customer is checking out with item B then I want weight based shipping displayed as per shipping method. is this possible to achieve?
Thank you in advance,
pgp
Hey,
This is possible.
in catalog / model / shipping / weight.php
Find:
Add Before:
This feature is already integrated into my commercially available Improved Weight Based Shipping extension here:
http://www.opencart.com/index.php?route ... on_id=3335
Regards,
Joel.
This is possible.
in catalog / model / shipping / weight.php
Find:
Code: Select all
if ($status) {
Code: Select all
if ($this->cart->getWeight() < 25) {
$status = false;
}
http://www.opencart.com/index.php?route ... on_id=3335
Regards,
Joel.
Hi,
Great thread. What would need to be done to restrict shipping if any item's weight is set to 0. I have lots of products with no weight info and would like to restrict shipping to people outside my area. Would like to add a message saying one or more items is not eligible for shipping to your country, zone, etc.
Thanks in advance.
OC 1.5.1.3
Great thread. What would need to be done to restrict shipping if any item's weight is set to 0. I have lots of products with no weight info and would like to restrict shipping to people outside my area. Would like to add a message saying one or more items is not eligible for shipping to your country, zone, etc.
Thanks in advance.
OC 1.5.1.3
Hello Guy
Please can someone help me here. Basically am using Royal Mail shipping weight. have set all the weight and price.
What i want now is i don't want to display Royal Mail First Class Standard and Royal Mail Second Class Standard if total amount is ABOVE £5, then display order shipping option like First class Recorded etc... So if the Total amount is below £5 i want to display all the shipping Method
Example
Royal Mail First Class Standard
Royal Mail Second Class Standard
Royal Mail Special Delivery 1PM
Royal Mail First Class (Recorded)
ParcelForce 24
*Display All if total amount is less that £5
Royal Mail Special Delivery 1PM
Royal Mail First Class (Recorded)
ParcelForce 24
*Display All if total amount is More Than that £5.
Note: Am going to set all the weight=price to each shipping method in the Royal Mail Based in the admin. if any weight product is less or greater that's when the above details trigger.
Thanks in advance. Regards
Please can someone help me here. Basically am using Royal Mail shipping weight. have set all the weight and price.
What i want now is i don't want to display Royal Mail First Class Standard and Royal Mail Second Class Standard if total amount is ABOVE £5, then display order shipping option like First class Recorded etc... So if the Total amount is below £5 i want to display all the shipping Method
Example
Royal Mail First Class Standard
Royal Mail Second Class Standard
Royal Mail Special Delivery 1PM
Royal Mail First Class (Recorded)
ParcelForce 24
*Display All if total amount is less that £5
Royal Mail Special Delivery 1PM
Royal Mail First Class (Recorded)
ParcelForce 24
*Display All if total amount is More Than that £5.
Note: Am going to set all the weight=price to each shipping method in the Royal Mail Based in the admin. if any weight product is less or greater that's when the above details trigger.
Thanks in advance. Regards
In catalog / model / shipping / free.phpbudalal wrote:Hi,
Great thread. What would need to be done to restrict shipping if any item's weight is set to 0. I have lots of products with no weight info and would like to restrict shipping to people outside my area. Would like to add a message saying one or more items is not eligible for shipping to your country, zone, etc.
Thanks in advance.
OC 1.5.1.3
Find:
Code: Select all
$method_data = array();
Code: Select all
if ($this->config->get('config_weight_class_id')) {
$weight_class = 'weight_class_id';
} else {
$weight_class = 'weight_class';
}
foreach ($this->cart->getProducts() as $product) {
if ($this->weight->convert($product['weight'], $product[$weight_class], $this->config->get('config_' . $weight_class)) <= 0) {
$status = false;
}
}
I'm going to make the assumption that your currency is already set to £. I'm also going to use the SubTotal to check the status of the shipping.Leksmaster wrote:Hello Guy
Please can someone help me here. Basically am using Royal Mail shipping weight. have set all the weight and price.
What i want now is i don't want to display Royal Mail First Class Standard and Royal Mail Second Class Standard if total amount is ABOVE £5, then display order shipping option like First class Recorded etc... So if the Total amount is below £5 i want to display all the shipping Method
Example
Royal Mail First Class Standard
Royal Mail Second Class Standard
Royal Mail Special Delivery 1PM
Royal Mail First Class (Recorded)
ParcelForce 24
*Display All if total amount is less that £5
Royal Mail Special Delivery 1PM
Royal Mail First Class (Recorded)
ParcelForce 24
*Display All if total amount is More Than that £5.
Note: Am going to set all the weight=price to each shipping method in the Royal Mail Based in the admin. if any weight product is less or greater that's when the above details trigger.
Thanks in advance. Regards
Find:
Code: Select all
if ($this->config->get('royal_mail_1st_class_standard_status') && $address['iso_code_2'] == 'GB') {
Code: Select all
if ($this->config->get('royal_mail_1st_class_standard_status') && $address['iso_code_2'] == 'GB' && $this->cart->getSubTotal() < 5) {
Code: Select all
if ($this->config->get('royal_mail_2nd_class_standard_status') && $address['iso_code_2'] == 'GB') {
Code: Select all
if ($this->config->get('royal_mail_2nd_class_standard_status') && $address['iso_code_2'] == 'GB' && $this->cart->getSubTotal() < 5) {
Regards,
Joel.
Having a similar issue.
I have successfully set this up:
If my cart weight = 0, then I only display the free-shipping module. If my cart weight is greater than or equal to 0, then I use the UPS module.
Here is my issue. If I have a item of '0' weight (or a free-shipping item) in the cart along with any other item of weight (or an item that has a shipping cost), UPS assumes that the '0' weight item is the base rate, and charges as such.
Is there a way to implement a rule that say:
If my item is set to weight '0', then associate no shipping cost? Or maybe I could say 'if my item is set to weight '0', then mark the item as 'does not require shipping', but only if there are other items in the cart of weight?
I am half way there on figuring this out. Any help is greatly appreciated.
Thanks.
I have successfully set this up:
If my cart weight = 0, then I only display the free-shipping module. If my cart weight is greater than or equal to 0, then I use the UPS module.
Here is my issue. If I have a item of '0' weight (or a free-shipping item) in the cart along with any other item of weight (or an item that has a shipping cost), UPS assumes that the '0' weight item is the base rate, and charges as such.
Is there a way to implement a rule that say:
If my item is set to weight '0', then associate no shipping cost? Or maybe I could say 'if my item is set to weight '0', then mark the item as 'does not require shipping', but only if there are other items in the cart of weight?
I am half way there on figuring this out. Any help is greatly appreciated.
Thanks.
Who is online
Users browsing this forum: No registered users and 14 guests