Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Shipping By Rules for WooCommerce

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Help Me to set up Shipping Rules 04 Jun 2017 13:43 #1

  • karsarkis_999
  • karsarkis_999's Avatar Topic Author
Hello I have purchased Shipping By Rules Pro plugin and can you help me to set up such rules because I haven't found it in rules example and don't know how to make it plese help me to set up this rules. I think this is about "Rolling System"

1)The country where the shop will be is "Georgia" the town where it will be is "Tbilisi"

2)Shipping will be across "Tbilisi(town)" and "Tbilisi(town)+40km"

3)Instead of ZIP code/Postal code field on Checkout page will the be, dropdown or radio button wich must be required to choose or fill, with text "Tbilisi(town)" or "Tbilisi(town)+40km". Also this fields will be connected to the shipping rules.

4)While filling the customer must choose at what direction he need the purchase to "Tbilisi(town)" or to "Tbilisi(town)+40km" and acording to this the system will show to him shipping possibilities to the price he spent.

This is Rules:

1)
<70 $. within Tbilisi
*Cost of Delivery 5 $.
*Delivery Time 10:00 - 22:00

2)
>70 $. within Tbilisi
*Free of Charge
*Delivery Time 10:00 - 22:00

3)
<100 $. from Tbilisi + 40Km.
*Cost of Delivery 15 $.
*Delivery Time 1 - 2 Days

4)
>100 $. from Tbilisi + 40Km.
*Cost of Delivery 10 $.
*Delivery Time 1 - 2 Days
Attachments:

Help Me to set up Shipping Rules 04 Jun 2017 17:51 #2

Dear Sarkis,
If I understand your shipping cost structure correctly, you have two areas:
1) Tbilisi
2) surroundings of Tbilisi (+40km)
Within each of these areas, there is an order amount threshold that determines the actual shipping costs. You want to let your customer select to which are they belong.

To be honest, your desire to replace the ZIP+City input controls with a dropdown box is nothing a shipping plugin in WooCommerce can easily do. The address input fields are provided by WooCommerce, and once woocommerce knows the address, then WC will call each shipping plugin and request the list of shipping costs for the given address.

Can't you simply let your customers enter the postal code and determine from the postal code whether the customer resides in tbilisi or in the surroundings? That would be the easiest approach, without the need to mess with the address input fields provided by WooCommerce.
As an example, take the Austrian case: Vienna has postal codes 1000-1999, the surroundings of vienna are 2000-3999. The corresponding rules for your system would be:
Name="Vienna (town), Delivery Time 10:00 - 22:00", 1000<=ZIP<2000; Amount<=70; Shipping=5
Name="Vienna (town), Delivery Time 10:00 - 22:00", 1000<=ZIP<2000; Amount>70; Shipping=0
Name="Vienna surroundings, Delivery Time 1-2 Days", 2000<=ZIP<4000; Amount<=100; Shipping=15
Name="Vienna surroundings, Delivery Time 1-2 Days", 2000<=ZIP<4000; Amount>100; Shipping=10
Error="Sorry, the given address is not recognized as Tbilisi or Tbilisi+40km. Unfortunately, we cannot ship to this address."; NoShipping

Best regards,
Reinhold

PS: If you really, really, really want to modify the address input provided by WooCommerce and replace it by some other control field that simply returns an indicator whether the address is in Tbilisi or within +40km (sorry, I can't help you with that part of modifying the address input controls), then I suppose you'll also have to extend our plugin with a tiny helper plugin that provides this new indicator as a variable for the rules. Such a plugin would need to be written in PHP and needs to impelement and connect the opentools_shipping_by_rules_get_cart_values filter as described in our documentation (open-tools.net/documentation/advanced-sh...merce.html#extending).

As you can imagine, this is not a straightforward task to meddle with the WooCommerce internals, so I would strongly recommend against it and try to work with the full address entered by the customer.

Help Me to set up Shipping Rules 04 Jun 2017 17:55 #3

PS: Alternatively, you can also leave all address input fields as they are, and simply provide two shipping methods:
1. Shipping method "Tbilisi (town), Delivery Time 10:00 - 22:00":
Amount<=70; Shipping=5
Amount>70; Shipping=0

2. Shipping method "Tbilisi + 40km, Delivery Time 1-2 Days":
Amount<=100; Shipping=15
Amount>100; Shipping=10

This will ALWAYS offer "Tibilisi (town)" and "Tbilisi + 40km" as possible shipping methods (price already properly calculated from the order total), so the customer can choose whether he is in Tbilii or in its surroundings. This choice would then be in the shipping methods, but not in the address area of the checkout area.
Again, I would recommend against this, if it is somehow possible to determine this information from the full address.

Help Me to set up Shipping Rules 04 Jun 2017 18:28 #4

  • karsarkis_999
  • karsarkis_999's Avatar Topic Author
Thank you I understand I will use the second method so the customer will choose before payment at what location it will be delivered in second method?

Help Me to set up Shipping Rules 04 Jun 2017 20:23 #5

  • karsarkis_999
  • karsarkis_999's Avatar Topic Author
1) And how can I make so on the cart page instead of price on the free shipping be written FREE SHIPPING
2) How make so that all the varites be unchecked from the beginning
Attachments:

Help Me to set up Shipping Rules 19 Jun 2017 00:29 #6

Dear Karsakis,
Both are the default behaviour of WooCommerce (i.e. shipping costs of 0 are not printed and the first method is auto-selected). The displayed text (i.e. the suppression of the shipping cost for free shipping) is done in WooCommerce's templates/cart/cart-shipping.php, which calls the function wc_cart_totals_shipping_method_label to create the displayed name of the shipping method. That function (file wc-cart-functions.php) has an explicit check "if ( $method->cost > 0 ) {", i.e. it is hardcoded to append the shipping costs only if they are larger than 0.

The only way I can see around this issue is to implement the filter woocommerce_cart_shipping_method_full_label (called at the end of the wc_cart_totals_shipping_method_label) and insert the HTML for the free shipping text if $method->cost==0...

That would mean implementing a tiny wordpress plugin to provide an implementation of that filter.
As I said at the beginning, this is a general WC problem and has nothing to do with our plugin.

Best regards,
Reinhold
  • Page:
  • 1