Modifying FixedRateShippingComputationMethod Plugin With Some Database Access Please Help

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
Hey guys. I have been working with ASP.net (not MVC) for years and I'm trying to get familiar with the new technology. I want to modify the FixedRateShippingComputationMethod by adding some code to check the Category of the Products and then calculate base on that.

For Example:

Category 1 = Max Products that could be shipped on a flat rate is 15. Then Another box is needed.
Category 2 = This needs to always have a separate box as this is a larger Item.
Category 3 = This Items could be mix with Category 1 but only certain mix are available for example 1 Category 3 and 5 Category one.

I think I could perform this with pure loops and if conditions. But I don't know how to access the fields from the database with a plugin if someone could at least point me in that direction I should be able to handle the rest.

Thanks

Let's continue supporting this great open source product.
12 年 前
aesperon wrote:
Hey guys. I have been working with ASP.net (not MVC) for years and I'm trying to get familiar with the new technology. I want to modify the FixedRateShippingComputationMethod by adding some code to check the Category of the Products and then calculate base on that.

For Example:

Category 1 = Max Products that could be shipped on a flat rate is 15. Then Another box is needed.
Category 2 = This needs to always have a separate box as this is a larger Item.
Category 3 = This Items could be mix with Category 1 but only certain mix are available for example 1 Category 3 and 5 Category one.

I think I could perform this with pure loops and if conditions. But I don't know how to access the fields from the database with a plugin if someone could at least point me in that direction I should be able to handle the rest.

Thanks

Let's continue supporting this great open source product.

Maybe Shipping Director might eassy your customization task
12 年 前
I try Shipping Director and it doesn't meet my requirements.

I just need to know how to access the Fields on the database from a plugin
12 年 前
You don't " access the Fields on the database ".  You reference properties of the shopping cart Items.

I'm surprised that Shipping Director didn't meet your requirements - Your example above looks very doable - did you read the blog about Packing and "Requires own box"?

You can PM me, or use Contact form on nopTools.com if you have any questions.
12 年 前
Can you give me one example how to access the reference the properties of the current shopping cart objects.?
12 年 前
sure...

foreach (var shoppingCartItem in getShippingOptionRequest.Items)
    totalWeight += shoppingCartItem.ProductVariant.Weight * shoppingCartItem.Quantity;

(example only - this does not take into account possible weight adjustments)
12 年 前
Thanks I will try this
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.