Redeem coupon at order create

  • Posts: 28
  • Thank you received: 0
10 years 10 months ago #137656

We would like to redeem a coupon once the order is created or payed, instead of order has been send.

A third party application is changing the order status from payed into send, using an mysql query directly; Therefore HikaShop does not redeem the coupon.

Or perhaps there is a better solution? (Do we need to use the HikaSerial coupon or the HikaShop coupon during checkout?)

Using HikaShop en HikaSerial

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 10 months ago #137689

Hi,

If you modify the database directly, HikaShop won't be triggered so all the code which should be executed for the order processing (coupon, stock, market vendors, serial management, etc) won't.
I recommend you to create a little plugin which will use the HikaShop function in order to change the order status.

$orderClass = hikashop_get('class.order');
$updateOrder = new stdClass();
$updateOrder->order_id = $order_id;
$updateOrder->order_status = 'shipped';
$orderClass->save($updateOrder);
So your third party application could call an URL in your website, given the order_id in parameters (with a secret password or other thing for the security). Your plugin will catch it, call HikaShop to change the order_status and all will work better.

The "HikaSerial coupon" step is a new step which allow you to use HikaShop coupons or HikaSerial serials during the checkout.
If you have some consumable serials (like with the new points plugins), it could be useful to let the customer enter his serial during the checkout in order to gain his points. (instead of having a module somewhere in your site).
If you do not have serial to consume, you do not need this special HikaSerial checkout step.

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: 28
  • Thank you received: 0
10 years 10 months ago #137706

Perhaps will try that. Is it also possible to redeem a coupon once the orderstatus is 'order created' or 'order payed' ?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 10 months ago #137712

Hi,

Why do you want to "redeem" a coupon when the order is created ?
A coupon will be use when the order is created and we update the coupon only when the order is cancelled (to change back the coupon counter).

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: 28
  • Thank you received: 0
10 years 10 months ago #137715

When I create coupons with HikaSerial, those coupons are listed in HikaShop with quota 0/1 (Each coupon may be used only once, but it has been used zero times). When I place an order it's still 0/1. Only when I change the order into 'Sent', the quota of the used coupon changes from 0/1 to 1/1 preventing a user to use it a second time.

Perhaps I'm overlooking something or how do I generate the coupons otherwise?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 10 months ago #137765

We cannot reproduce what you're saying with the latest version of HikaShop on our end.
The "number of used times" of a coupon is increased when an order with that coupon code is created, not when it is updated.
Maybe you have an old version of HikaShop with a bug ?

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

  • Posts: 28
  • Thank you received: 0
10 years 10 months ago #138223

Verified a couple of things, steps to reproduce:

[not working]
- Create a coupon with e.g. 5 EURO discount
- Place a 5 EURO product in your shopping basket
- Start payment process, enter coupon code and the amount to be payed will be reduced to 0 EURO
- Order will be 'Confirmed'; Coupon is listed within order but usage count at coupon is not reduced.

(This way the payment plugin is also not involved, because order will be entirely processed by HikaShop)

Last edit: 10 years 10 months ago by wozzie.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 10 months ago #138247

That probably happens because the order is confirmed directly when it is created. Change the "send confirmation email" option of the "validate free order" plugin of Hikashop via the joomla plugins manager and the order will be confirmed on a second step and you should not have the issue anymore.

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

  • Posts: 28
  • Thank you received: 0
10 years 10 months ago #138250

Changed 'Validate free order' plugin setting and changed 'Send confirmation email' to No. Seems to work now for free orders!

Now there still is an issue using the IDEAL plugin; Coupon usage is not increased / redeemed when payment is done. Also informed the IDEAL plugin creator (ccIDEAL), but perhaps you know where to look?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 10 months ago #138255

Does it works for you with other payment plugins like PayPal ? If yes, then the issue is really in the payment plugin and that should be fixed by the developer of the payment plugin. If no, then the issue is within HikaShop and we would need more information on how you configured the PayPal plugin and the order status options in the configuration to be able to reproduce the issue.

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

  • Posts: 28
  • Thank you received: 0
10 years 10 months ago #138261

Seems the problem also occurs using the Paypal plugin. Order status is 'confirmed', coupon is not redeemed.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 10 months ago #138292

Can you replace the file administrator/components/com_hikashop/classes/order.php with the one in this archive and try again ?


File Attachment:

File Name: h1213b3c.zip
File Size:10 KB

Attachments:

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

  • Posts: 28
  • Thank you received: 0
10 years 10 months ago #138467

Will verify. Seems to work now with Paypal (No IPN reveived from Paypal yet, order status is created). Still something going wrong with iDEAL (During payment process coupon usage is increased, but after payment confirmed & return back to shop coupon is released).

Last edit: 10 years 10 months ago by wozzie.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #147229

Hi,

If your problem is not solved, thanks to update HikaShop, some changes have been made regarding the coupons.
That will probably help you.

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

Time to create page: 0.090 seconds
Powered by Kunena Forum