Thanks. I am taking one of these approach to modify the shipping in the
handler.
 





On Sun, Nov 13, 2016 4:14 PM, akos1234 [email protected]
wrote:
Hi Akhlaq,
The only closest one I came across was this -
http://mezzanine-users.narkive.com/AOk7Y6Kl/cartrige-custom-shipping-by-country-and-product-category
even that it seems he was not quiet heading for the right direction.
Regards

On Saturday, 5 November 2016 02:03:34 UTC, Akhlaq Rao wrote:Thanks a lot Danny,
is there a good example about how to set the shipping rules based on country?
On Fri, Nov 4, 2016 at 7:12 PM, Danny <[email protected]>  wrote:
On 5/11/2016 4:18 AM, Akhlaq Rao wrote:
Hello Danny,
 
I am not seeing these options when creating a
variation, all I see the colour and size, do you now how
do I enable these variations?
 
- Product Variations now have
weight, and boolean "pickup available"/"shipping
available" options
 
Thanks,
 Akhlaq
 
In my ProductVariation  model, I've added these as fields. They are
not product options (which is what colour/size are in the default
settings).
When you edit the details on a variation, you can add things like
price, sale price etc; What I've done is add weight, pickup
available and shipping available as other fields there.

https://gist.github.com/molokov/36ab544df43efb224719d300761612
a4#file-models-py-L8

If all you want to do is add shipping rules based on country, you
don't need these fields - I just have them because we sell some
items that are "virtual"
(e.g. tickets) that have no weight; and we have other items that can
only be picked up (and never shipped).

Seeya. Danny.





On Thu, Nov 3, 2016 7:31 PM, Danny
 [email protected]
wrote:
On 4/11/2016 5:31 AM, akos1234 wrote:
Hello everyone,
 
I am trying to attempt to create the shipping
for my site.
 
I was looking at this post -
 
http://mezzanine-users.narkive.com/AOk7Y6Kl/cartrige-custom-shipping-by-country-
and-product-category

which I thought was at the right track. I need
to set shipping cost for countries as well as
different cost for quantity.
 
If more than 5 items bought, the calculation of
shipping would cost more than one item.
 
However,Melvyn
Sopacua
 
suggested
something I did not quiet understand.
 
here as quoted -
 
If this is the extent of your shipping
rules, you may get away with this
approach.
>From experience with other shopping carts, I
highly suggest you
implement
a rule-based approach as opposed to a property
approach.
Approach
like an email filter:
-
You define a state formulated by a set of
conditions
-
Which result in one or more actions
-
And has post-processing flags, like "stop
further rule processing if used"

The
implementation is more complex, but the
resulting flexibility is worth it
and
much of the code can be reused for different
types of business logic, like
follow-up
emails, discounts and available payment methods:
-
Send a "please review our product" reminder, if
customer has not reviewed
and
has received product x days ago.
-
Give 10% cart discount to customers who have
spent at least x ammount last
year
and don't apply any other cart discount rules
-
Offer "Pay within 30 days" payment method only
to customers of the customer
group
"B2B" with credit limit > order ammount
-
Don't offer 24 hour delivery if shipper api
qualifies customer address as
'rural'

My
2c.
--
 Has anyone done the shipping
and is it possible to view the code?
 

I've got some custom shipping rules in my variation of
Cartridge (along with a number of other changes).
I've tried to summarise all the shipping rule related
changes in this gist:
https://gist.github.com/molokov/36ab544df43efb224719d300761612a4

Essentially:
- Product Variations now have weight, and boolean
"pickup available"/"shipping available" options
- There's a ShippingRule model which allows you to
define the rules within admin.
The rules define a) a weight range, b) whether you
care about the pickup/shipping options, and c) a country
regexp - and a corresponding price. The order of the
rules is important.
- Users are presented with valid shipping options in a
drop down during the payment step of checkout (after
entering their shipping address). If there's no matching
rule, an error will be shown.

What I have is probably beyond what you need, and as you
can see I've touched the code in a lot of places (and
mind you, this was over a year ago, so my cartridge fork
isn't quite up to date with the latest master), but
hopefully it will point you in the right direction.

The changes to checkout.py (especially
shippingrule_billship_handler) and models.py/admin.py
are probably the key things you may need.

Hope this helps a little.

Seeya. Danny.

-- 
You received this message because you are subscribed to
the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails
from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
-- 
You received this message because you are subscribed to the Google
Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.



-- 
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to