Re: [mezzanine-users] Cartrige custom shipping by country

2016-11-04 Thread akos1234
Hello Danny,

Thank you so much for your prompt reply. I will have a look and update here.

Regards

Akos

On Thursday, 3 November 2016 23:31:58 UTC, Danny S 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
>
> *su*ggested 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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Cartrige custom shipping by country

2016-11-04 Thread Akhlaq Rao

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






On Thu, Nov 3, 2016 7:31 PM, Danny molo...@gmail.com
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 mezzanine-users+unsubscr...@googlegroups.com.
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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Cartridge: How to override the name of the product and variations in the cart / checkout?

2016-11-04 Thread Ryne Everett
I agree that the current default behavior isn't great for everybody. I'm
not thrilled by it myself but have lived with it so far.

One approach would be to improve the default behavior in cartridge,
though I don't have a proposal for a more generally acceptable format at
hand.

Another approach would be to add a cartridge setting for a function that
formats this string, but I'm not sure that can be justified.

Perhaps monkey-patching the ProductVariation.__str__ method would be the
best approach. I don't think I've monkey-patched model methods before
but you might come up with a sensible way to do it with experimentation
and/or searching the web.

Please give a report if you come up with anything.

On 11/02/2016 05:20 AM, Pete Dermott wrote:
> Hi Everyone,
>
> I'm looking to create a Cartridge store that offers the ability for
> customers to buy low cost samples of our products, my thought was to
> use the variations system to do so.
>
> However, when I get to the checkout the system puts the items in the
> cart as $ProductName $ProductOptionType: $ProductOptionName so for
> example, with my product option type of "Shippable" this turns into
> "Product Name Shipable: Sample" which isn't really ideal.
>
> What I would like to do instead is remove the modification of the
> product description and show the original description and a separate
> field for the products SKU instead. 
>
> I believe the modification to the name is taking place
> incartridge.models.ProductVariation file's __str__ method
> 
> but I've got no idea how I can modify this without causing issues with
> other parts of the site.
>
> What is my best option here?
> -- 
> 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 mezzanine-users+unsubscr...@googlegroups.com
> .
> 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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Override behaviour of "image upload" in media library

2016-11-04 Thread Valeriia Sytchenko
I want to add additional functionality to image uploader.

Now I'm building a shop with Cartridge/ Mezzanine. 
When editing Product, admin could add image using media library. When admin 
select file from local PC, it uploads to MEDIA ROOT without any changes. 
I need to add resizing and putting watermark on it, so that after pushing 
"upload" button, all selected images will be resized, watermaark will be 
put and then uploaded to MR folder. 

The problem is that I've searched via both of packages and haven't found 
where those functions related to Media library live.

-- 
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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Override behaviour of "image upload" in media library

2016-11-04 Thread Eduardo Rivas
Looks like Filebrowser Safe sends a post-upload signal. You should be 
able to do your processing from there.


https://github.com/stephenmcd/filebrowser-safe/blob/761421ff719b7b673d008dd4b65ba4ac242ecd7a/filebrowser_safe/views.py#L352

--
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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Override behaviour of "image upload" in media library

2016-11-04 Thread Ryne Everett
The functionality is in filebrowser-safe
(https://github.com/stephenmcd/filebrowser-safe/blob/master/filebrowser_safe).

My first thought is use the filebrowser_pre_upload or
filebrowser_post_upload signal
(https://github.com/stephenmcd/filebrowser-safe/blob/master/filebrowser_safe/views.py).
These signals are not currently documented but I don't think they're
likely to be deleted any time soon.

On 11/04/2016 10:12 AM, Valeriia Sytchenko wrote:
> I want to add additional functionality to image uploader.
>
> Now I'm building a shop with Cartridge/ Mezzanine. 
> When editing Product, admin could add image using media library. When
> admin select file from local PC, it uploads to MEDIA ROOT without any
> changes. 
> I need to add resizing and putting watermark on it, so that after
> pushing "upload" button, all selected images will be resized,
> watermaark will be put and then uploaded to MR folder. 
>
> The problem is that I've searched via both of packages and haven't
> found where those functions related to Media library live.
>
> -- 
> 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 mezzanine-users+unsubscr...@googlegroups.com
> .
> 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 mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Cartrige custom shipping by country

2016-11-04 Thread Danny

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/36ab544df43efb224719d300761612a4#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 molo...@gmail.com 
 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

*su*ggested 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 mezzanine-users+unsubscr...@googlegroups.com
.
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 mezzanine-users+unsubscr...@googlegroups.com 


Re: [mezzanine-users] Cartrige custom shipping by country

2016-11-04 Thread Akhlaq Rao
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  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 molo...@gmail.com 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
>>
>> *su*ggested 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 mezzanine-users+unsubscr...@googlegroups.com.
>> 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 mezzan