discount code adjusting price per product item

  • Posts: 8
  • Thank you received: 2
9 years 9 months ago #211189

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3

I have a client who wants to offer a discount code that will discount each item to a fixed price, and the discount per item is determined by the client picking some round number - not at a fixed dollar amount nor fixed percentage. (In other words, they'd like the price of certain product to be reset based upon a coupon code - similar to how HikaShop allows different pricing based upon the user's group.)

Is the best solution the creation of a plugin that will adjust the rates during a trigger? I regularly write plugins, so that shoud not be too challenging for me. But I want to know if there is a better way.

Please Log in or Create an account to join the conversation.

  • Posts: 26242
  • Thank you received: 4036
  • MODERATOR
9 years 9 months ago #211202

Hi,

There is no such feature in HikaShop.
I know that AWOCoupon is well advanced but I can't tell if that kind of feature is available.

About the development of such kind of plugin ; it will mostly require to override the product prices.
You can also generate the discount price in order to get what you want in the order total ; but the display won't be the same.

www.hikashop.com/support/support/documen...r-documentation.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 2
9 years 9 months ago #211974

As a follow-up, I can report that I was able to get this working. I'll share briefly my approach per chance that helps someone in the future.

  • I set up a new usergroup called Receives Promotional Pricing.
  • The shop owner creates a new coupon code with the price/percentage set to zero.
  • My plugin's option is set to the usergroup Recieves Promotional Pricing as well as with the promo code that is to trigger the new pricing.
  • For each product or variant that is to receive a new price when the promo code is entered, create a second pricing item and set it's usergroup to Recieves Promotional Pricing.

Once my plugin detects the key promo code as being entered, it records this in the user's session. Then when the cart is displayed and if the user's session shows the promotion is to be applied, the plugin checks to see if each item in the cart has promotional pricing, and if it does, the plugin updates the pricing object that is stored within the order. The new per-product pricing is retained within the order as it is stored in the db.

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum