Attribute Prices

Could anyone help with some script to change the value of an targeted attribute based on the quantity of the product selected?
Example is a set up fee of $35 is the same for all quantities so i would like to change the value="{{attrOption.id}}" to be divided by the data-ecommerce_product_quantity_field="{{this.id}} in the product.

i have added an ID tag to the attributes to take the {{attr_name}} so when named set up i was thinking i could add if… something script in the attributes layout?

Hi @AJ1971
Perhaps I’m not understanding the exact requirements here, but I don’t think you can change the price of products or attributes on the front-end like this.

If I understand, you need to charge a setup fee per product, but not per quantity.
Perhaps the volume discounting brackets could work here (if customers might only purchase a limited quantity).
Otherwise, I’d look to have a separate “Setup” product that you programmatically add to the cart for each product in the cart.
Failing that, perhaps the Shipping options could be used to achieve this… unless you are already utilising shipping.

thanks @Adam.Wilson

Really har d to explain I would need to add more than 1 set per product that has multiple”Attributes”.

Example is Pen A that has

Pad print Position A - attribute print price per item applies , but set up could be New at $55 or repeat at $25
Pad print Position B - attribute print price per item applies , but set up could be New at $55 or repeat at $25 OR could be same artwork as Print Position A so does not apply…
Pad print Position C - attribute print price per item applies , but set up could be New at $55 or repeat at $25

Digital Print Position A- attribute print price per item applies , but set up could be New at $55 or repeat at $25

Laser Engrave Position A- attribute print price per item applies , but set up could be New at $55 or repeat at $25

When would the product be added to the cart? On click of add to cart main button fore the productor on selection of the secondary set up product?

Is it possible to be to add it via radio button as you would an attribute and the its added to cart via the main add to cart to cart button?

Ah, I see. That’s getting pretty complex.
I don’t know if any of this is actually possible, it would require further testing. But I’d explore having 2 ‘setup’ products (one for the NEW $55 setup and one for the REPEAT $25) and the radio buttons define which of these product IDs is to be added to the cart.

Then have a dummy add-to-cart button which calls the add-to-cart function for the defined setup product and then calls the add-to-cart function again for the main product.

There would be a lot of custom work here though and other factors to consider, like how to present these other products in the cart and how to stop tampering with them, and what happens if the cart is adjusted afterwards… it could all get very complex.

Perhaps this is a job suited for Treepl Services (https://services.treepl.co/) as they’ll know the ins and outs of the eCommerce functionality better than anyone.

Other than that I can’t see any other way to achieve this. But it brings up an interesting feature request - where product attribute prices can be multiplied by the product quantity (as it currently works) OR be set as ‘one-off’ values per product and not be affected by the quantity of the currently configured product.

@Adam.Wilson, The latter would in a feature request be the ultimate goal. some Apps i have seen attached to shopify used dynamic Pricing with % instead of fixed price. But if a attribute could be set as Fixed price Total that would be Massive! for alot of users.

I’ll write up a Backlog Request soon for this.
@AJ1971 If you can think of any other use cases please let me know, as that will help strengthen the request.

Backlog request now added here:
Product Attributes Enhancements

Feel free to add to this.