How to check PickUpInStore in Shipping Director?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hello and thans for your reply!

I follow this : https://www.noptools.com/blog/69/product-specific-fixed-rate-for-quantity-1-plus-additional-shipping-charge-for-quantity-1, so I have an additional shipping fee inside of product. When I choose "Pick up in store", in the "Confirm Order" page, this additional shipping fee will show in the "Shipping" row, which should be zero. That's my problem..

Thanks for your help!
7 years ago
Hello and thanks for everyone's help!

Finally I got a solution.

Previously I using this in Shipping director : Items.Where(!String.IsNullOrWhiteSpace(Product.AdminComment)).Sum(Decimal.Parse(Product.AdminComment.SubstringBetween("Shipping:",";")) - Product.AdditionalShippingCharge)

This "Product.AdditionalShippingCharge" is come from "Additional shipping charge" in product, which is working fine when custom not select "Pick up at store". However, if custom choose "Pick up at store", the shipping director will be skiped and that "Additional shipping charge" will show in the finall "shipping fee", which should be "0".

So I leave this value as "0" in product, and leave shipping director handle this. Now my shipping director expression using :
Items.Where((Product.Name).Contains("Adapter")).Sum(10) + Items.Where((Product.Name).Contains("Adapter")).Sum(5)*(Items.Where((Product.Name).Contains("Adapter")).Sum(Quantity) - 1)

The "10" is the first item's shipping fee, and "5" is the additional shipping fee from second item.

for now it looks working fine.

Thanks for everyone again for all of your help!
7 years ago
@xiangzheng0000

I don't think your formula is correct. If there are two types of Adapter Products in the cart (e.g. "Adapter 1" and "Adapter 2", do you want 10 for first of each Adapter type, and then 5 for each additional (for each adapter type)?  For example if two items in cart, the first with quantity 1 and the second with quantity 2, then with your formula, you get

.Sum(10)   +  .Sum(5) * (.Sum(q)-1) =
(10 + 10)  +  (5 + 5) * ((1 + 2)-1) =
20         +    10 * (2) =
20         +      20  =
40

I think you want:

  Adapters      Reference      Items.Where(Product.Name.Contains("Adapter"))
  AdapterRate   Decimal        [@Adapters].Sum(10) + 5 * ([@Adapters].Sum(x => x) - [@Adapters].Count())

(10 + 10)  +  5 * ((1 + 2) - 2) =
20         +  5 * (1) =
20         +      5 =
25
7 years ago
New York wrote:
@xiangzheng0000

I don't think your formula is correct. If there are two types of Adapter Products in the cart (e.g. "Adapter 1" and "Adapter 2", do you want 10 for first of each Adapter type, and then 5 for each additional (for each adapter type)?  For example if two items in cart, the first with quantity 1 and the second with quantity 2, then with your formula, you get

.Sum(10)   +  .Sum(5) * (.Sum(q)-1) =
(10 + 10)  +  (5 + 5) * ((1 + 2)-1) =
20         +    10 * (2) =
20         +      20  =
40

I think you want:

  Adapters      Reference      Items.Where(Product.Name.Contains("Adapter"))
  AdapterRate   Decimal        [@Adapters].Sum(10) + 5 * ([@Adapters].Sum(x => x) - [@Adapters].Count())

(10 + 10)  +  5 * ((1 + 2) - 2) =
20         +  5 * (1) =
20         +      5 =
25


Hi @New York and thank you for your reply!

In my case, I have 4 products(and for each of them has different shipping fee and additional fee), and I using the Product.Name.Contains("PartOfProductName") to make sure the filter result is correct. And I create individual shipping director rule for each product with a decimal type return value. Finally calculate the for return value as a total shipping fee. Base on my test It can solve my problem. Maybe using product name to control the filter is not a very good idea..

Thank you for any suggestion!
7 years ago
Product.Name is OK, except if there is risk it might get changed.  Product.Id will never change.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.