1

I am using Exp:resso Store 1.6.4. We developed stuff so that when a user purchases a product they will, as Zoo Visitor members, acquire the categories associated with that product. We now want to apply a discount to a product provided they have a certain category. Right now I'm looking for the simplest way to do this that remains secure, i.e. the user cannot change anything around.

Currently our purchase process is a price/description page with a register button (this is the Product Tag/form with a specified entry_id and empty_cart (is there any way to lock empty_cart, i.e. prevent it from being changed?)). Clicking the register button takes them to the checkout page which shows their member registration (if a guest) details, billing details, order details, and payment method.

If I create a product modifier that affects the price, anyone can add that modifier to the Product Tag's form. If I create another product anyone can change the hidden input's entry id to that of the new product. How can we securely lock down a price? Is there a way to, e.g. enable/use Sale Price while it's not enabled?

actually while writing this I realized at least for now I can attempt to check the details on the membership details on the Checkout page for this one specific product... but that's not really going to be feasible down the line.

Anyone have ideas for a quick fix? Don't have time to build add-ons for this kind of feature at the moment (and won't have time probably up until next year). But if you have an idea how to take that route I'm all ears, too.

1 Answer 1

1

Your question is a little hard to follow, but if I've understood it right, you want to discount products based on the Zoo Visitor entry category of the member purchasing them?

I can't think of any easy way to do this which would be secure from request tampering, without writing an extension. It would be fairly trivial to write an extension though which used the store_order_item_recalculate_end hook (called store_cart_item_update_end in Store 1.6) and change the price based on the current member's details.

Another approach which might work is that Store 2.0 has native support for discounting products based on the currently logged in member's group. It won't work with Zoo Visitor member categories, but if you have the ability to change the main EE group of the member then this could be useful.

2
  • You've understood it right. By trivial I suppose you mean if I hardcode the discount, its conditions, etc. Is there like a recommended way to leave those things (discount, its condition) in content entry or that's all up to me? =) Groups are insufficient as a member can only be in 1 group, thus the use of member categories.
    – notacouch
    Commented Nov 25, 2013 at 16:32
  • 1
    It would be slightly more than trivial, but you could certainly store the discount amount in a channel entry, then retrieve it and apply it inside the extension. You could check out ObjectiveHTML's Channel Data library for easy access to the channel fields. Commented Nov 25, 2013 at 21:07

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.