How to increase shipping cost according to quantity - prestashop

I am currently setting up the shipping settings for my site www.lordswoods.co.uk
I have set up two carriers
Yodel- maximum package weight 30kg (carrier range 1kg to 75kg) price £7.75
Pallet track - for all total orders above 75kg
When I order a 1 x 20kg item such as pro master 5 - economy green. The shipping price in the cart is £7.75 as it should be. However when I increase the quantity to two, the shipping price stays the same at £7.75, whereas I want it to to be £7.75 per item until 75 kg is reached.
e.g., 3 x promaster 5 should equal £23.25 (3 x 7.75)
How do I set this up?

You can try adding the shipping cost to all the products separately instead of adding it in the carrier. That way your shipping charges will increase for each item added to the cart.

Related

Shopify Scripts - Tiered product discount by quantity only when same variant

This is a good example https://help.shopify.com/en/manual/checkout-settings/script-editor/examples/line-item-scripts#tiered-product-discount-by-quantity
But I need it to work only if you enter code herechoose the same variant. You cant mix and match. The product has multiple variants but I only want the discount to apply if the product is in the same variant group.
discount +10 same products
Example 1 correct
Phone / variant Black x10 = discount
phone / variant Red x5 = NO discount
Example 2 incorrect
Phone / variant Black x5 = discount
phone / variant Red x5 = discount
Discount applied because total is 10 but its incorrect because the variant is not the same
Thanks for the help.
Not sure if I understand the question but this should be a good start.
def apply_discount(cart, min_quantity, perc_discount)
cart.line_items.each do |line_item|
if line_item.quantity > min_quantity
new_line_price = line_item.line_price * perc_discount
line_item.change_line_price(new_line_price, message: "More than 10 same product!")
end
end
end
apply_discount(Input.cart, 10, 0.90)
We just check line by line if it's more than min_quantity we apply the discount.
If you want to apply the discount only once you can just put a return inside the if
This will not work if you have discounts already applied to a subset of items of the same variant... line items are separated by sku and price, so for that you would need something more complex. But I was not sure you were interested in that case.

How to calculate price given payback period?

I have a capex table to calculate investment of a new product.
As shown in pic all numbers are not real numbers
D83 is the initial investment, meaning we invest $15,800 to buy machine and space
E85 to I85 are the variable cost each year.
E86 to I86 are the revenue each year, revenue = price * est.sold quantity
E87=E85+E86, F87=F85+F86, etc.
D91 = {INDEX($E$87:$I$87,MATCH(TRUE,$E$89:$I$89>0,0))} This is an array to find the first positive cash flow of Row 89 and return the value in row 87
D92 = {INDEX($E$83:$I$83,MATCH(TRUE,$E$89:$I$89>0,0))} This is an array to find the first positive cash flow of Row 89 and return the value in row 83
D93 = COUNTIF(E89:I89,"<0")+((-D92)/D91)
In this way, I calculated the payback years of a project.
In cell D98 I need to calculate that given a certain payback year number, other things hold still, what the price needs to be. Since D91 and D92 are arrays to lookup for the first positive cash flow and each year cash flow is not even, I can't think of a formula to put in D98 so D98 changes with C98, for example, if I put 2 in C98 meaning I need the payback period to be 2 years, and D98 will automatically give me a number to show what price it should be.
Is there any formula or VBA to do it?

How to add quantity based product prices in Prestashop with addon price?

How do we enter prices for below
1 Banner = Base price $20 + Artwork $5 = $25
2 Banners = Base price $20 x 2 ($40) + Artwork $5 = $45
3 Banners = Base price $20 x 3 ($60) + Artwork $5 = $65
Currently Prestashop does not allow to have a fixed addon price for artwork variable.
It should not get multiplied when the quantity increases. (Artwork is a fixed cost)
How can i do that?
You should do creating specifics prices for each quantity. In specific price only modify the quantity value. Also, a list with prices and saves will appear in product page.

How to use SSRS to report using a custom, "matrix-ized" table

First up, my environment: SQL 2005 + MS DAX 2009.
We have made a table that gets used in a matrix-like fashion for entering in purchase orders via an AX form. So each row will have:
a column for item#
a column for color
columns 1-7 for size (size1, size2,...), quantity (qty1, qty2,...), and cost (cost1, cost2,...).
I am trying to create a report in SSRS that basically uses this data in a more list-like fashion for printing out a PO order form.
I have got it to show the sizing right, but the cost situation complicates it as the unit cost can, and does, differ depending on size (for instance 2XL is more than S-M-L).
For example in our table, item 10000 black has 3 for Small (this data would be qty1), 3 for Medium (qty2) and 4 2XL (qty5). The cost for qty1 and qty2 are the same at $2.50 (cost1 and cost2). The cost for qty5 (cost5) would be $4. I would like to have this broken out into 2 rows by the cost and associated size on the form. So one line would have 10000 black Small and medium info and the second row would have the same item and color, but only have 2XL and its cost data.
Is there a way to "match" fields or somehow cycle through them to get the correct cost without having to have an additional 7 cost columns? Or perhaps there is a more elegant solution that is escaping me?

Dynamic Discount on Products

In the real world the discount on products you purchase is quite interesting. For example a seller offers a discount on his products in the following way:
On buying one quantity there will be no discount
On buying 2 he offers 10% discount
On buying 4 and 5 disount will be 20%
On 6 and onward 22%
What is the best way to accomplish this in an eCommerce application?
Take a ceiling function of the exponent or approximation thereof. For example Discount = MaxDiscount * (1 - (N-1)/N), where N is number of items. for 1 item discount is 0, for 2 items discount is 1/2 of the max, for large number of item it will approach MaxDiscount. Use ceiling function to you want discount to be integer number.