0

I´m trying to update a shipment cost for different zones of a country (using predicates, conditional actions)

Using the trigger Getting shipping quote via Flat Rate class uc_flatrate, activated , I´m trying to modify the rate..

Still the trigger doesn´t get called, I tried to modify the objects with php , didn´t work , then i tried a simple test to display a message to the user, didn´t work..

then I tried to write a simple text into a file to see if the event gets called... didn´t work

How can I run a php script when I press calculate shipment cost? (or whenever the shipment cost is calculated) ?

  • what I could do is define multiple rates / kg on weight quotes and edit it's default created predicate and put an condition of the location with no action, so it applies the quote.. Still that doesn't help much as I have multiple prices for ranges of weight 0-10 , once price, 11 to 30 another etc.. I just want to be able to control this with PHP :( – PartySoft Aug 2 '11 at 10:05
1

To directly answer your question, yes, Predicates work. I use them extensively at a D6 Ubercart site of mine. Aside from that, my store is all digital goods, so no shipping.

0

If you have:

CountryA

  • Zone1
  • Zone2
  • Zone3

CountryB

  • Zone1
  • Zone2
  • Zone3

Where Zone 1 and 2 of Country A and Zone 3 of Country B cost the same, then create one shipping method which has the same flat rate, give it 3 conditions under "Order: Shipping Address" - "Check an order's shipping State/Province" and state Zone1, Zone2, Zone3. Make sure you select OR as the operator at the top.

If the other zones are also the same costs, do the same. To have a shipping condition for "the rest of the destinations", you may do either of two methods whichever is fewer: 1.) Select all the state/provinces that already have shipping quotes and negate them, meaning "NOT" these destinations. Or, just keep going with the select destination "TRUE" method.

If you want to complicate things further with different countries and provinces, you can sort out the conditions and "override" the rules using weights for importance of the rule. Lowest weighted condition will triumph. Have a think about the best method to sort your shipping rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.