Here's what I want to do. I have a store with a variety of products. some of the products have price modifiers (like custom color, or "base price").

The products have a price per quantity. But, the products also have a base price. Additionally, if a customer selects a custom color, then there is a price modification. But, I don't want the base price, or the custom color price modification to apply to every quantity of that product. Just once per product in the cart.

example: These are products that are typically purchased in quantity (think holiday cards). Each product (the card type) has a minimum order quantity (25). Even though there is a minimum quantity purchase of 25, I'm managing the pricing per unit (so the store will do all the price calculations, and so the customer can adjust quantity in the cart). So, the per unit price is $5. There is a price modifier for color. There is Black (+$0), White (+$0), and Custom Color (+$30).

If the customer orders this card at a quantity of 50 in white, the price will be: $250 ($5 x 50)

If the customer orders this card at a quantity of 50 in a custom color (they specify the color), the price will be: $280 ($5 x 50 = $250 + $30) (the custom color charge is a one-time charge. Not a per unit charge).

The "base price" functionality (I'm calling it base price, but it's really a "set up cost for die cutting of certain versions of the cards) can function the same.

Example. Card A has a per quantity cost of $5. But, because this is a special type of printing, it requires a one-time setup cost of $50. So, the price modification is the same as the custom colors above (only the customer doesn't get to choose whether this modifier is selected, it's automatically chosen).

I have a lot of different products, and the setup cost is different for each product type. I could do the math and come up with some formula that allows me to include the setup cost in the per unit cost. But, the set up cost may change over time, where the actual per unit cost will not. Additionally, if a customer comes back and purchases more of one of the items that they already purchased, then they do not get charged that setup cost. So, ideally, I'd like to keep it away from the per unit cost, and use it just like the custom color scenario... and in the templates I can just hide that modifier option and make it apply automatically.

Clearly, this isn't an option in the expresso store. Is there a way to create a custom price modifier type/module/add-on that I could use? Or, any other approach for managing this? (my fall-back method is to find in the code where the price modifier math is being done and change it from a "multiply against every unit" to a simple "add once per product in the cart". I realize that won't survive software updates... But ALL products would operate this way.. So, I wouldn't have the need to have a standard price modifier function.)


1 Answer 1


There are two ways I can think of to achieve this.

The first would be to actually make your "custom color price" a whole separate product. Since you can add multiple products to the cart at once, you could let the customer choose a custom color, and add this (with a qty of 1) to the cart along with the correct # of cards. If your customer usually only order one product at a time then this would be a reasonable solution, because your customers will see the qty of items they ordered, plus a surcharge for the custom color in their cart. However, if each product has a different custom color surcharge then it could get a bit out of hand.

The second solution is to write an extension. Explaining the basics of extension development is out of scope for this answer, but if you're familiar with it (or have a PHP developer at your disposal), you can use the store_cart_item_update_end hook to reset the item price every time the cart is updated. With this method you could use a custom field to store the "setup price" and "custom color price" for each product, and then query these and update the cart price based on any modifiers selected for that product.

  • Your first option of creating products for those fees was a good option. Unfortunately, as you surmised, there are different fees for different products. So, managing all those options/fees is too much. So, we approached it the way you mention in the second option. We didn't actually create it as an extension, but probably will in the future. Thanks!
    – Ottenhoff
    Aug 28, 2013 at 1:50
  • No problem :) Don't forget to mark the answer as "accepted" using the tick mark on the left if this answers your question. Aug 28, 2013 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.