rockon VIP
Total posts: 21
09 Sep 2015 11:01

J!3.4.3, Emerald 9.266, HikaShop 2.5.0, Action Emerald/HikaShop 9.8

Hi Sergey,

Generally all is good, but I could use your help for a specific exception.

Emerald subscriptions are sold through HikaShop, with their prices in Emerald set to "0.00" and the price set in HikaShop. Some subscriptions are free, indeed (price in HikaShop also "0.00"), but depending on certain conditions also set in HikaShop, shipping cost is added in the shop during checkout... FYI, due to physical goods being sent to subscribers.

By default, free subscriptions are immediately activated = published. That's fine where shipping cost has been added and the payment did happen. But for "totally free" with shipping cost or total order value = "0.00" I need the subscription to save as inactive = unpublished, so it's up to an admin to manually publish (= "approve") these subscriptions.

So, I guess I need to insert some code somewhere: a condition which saves new/renewed subscriptions as unpublished if the total order value in HikaShop is zero.

In HikaShop, it's the table #__hikashop_order and its column/field "order_full_price", which provides the required information = the total order value.

I assume in Emerald it's the table #__emerald_subscriptions and its column/field "published" (default = 1), which needs to be set to "0 "on saving a new/renewed subscription if the HikaShop "order_full_price" is "0.00000" for the order.

Due to the table structure especially in HikaShop, there seems to be a bit more involved to get the right row(s) in #__emerald_subscriptions affected, or?

So, this leads to my questions:

Can you please point me at where to insert the condition? I haven't investigated Emerald's or the action's code yet.

Perhaps even provide me with a code snippet? Considering you knowing exactly how Emerald and HikaShop are playing together in the action, it's probably not much more than a blink for you, hehe...

In any case, many thanks in advance!

Last Modified: 11 Sep 2015


Sergey
Total posts: 13,748
10 Sep 2015 05:56

rockon I need the subscription to save as inactive = unpublished, so it's up to an admin to manually publish (= "approve") these subscriptions.

I added special parameter to Emerald hikashop plagin. Will be there release today.


Sergey
Total posts: 13,748
11 Sep 2015 05:34

Update latest Emerald packge. Hikashop plugin is part of that package.


rockon VIP
Total posts: 21
11 Sep 2015 11:51

P-E-R-F-E-C-T !!!

Wow. After some tests I can say it appears to work great, just as needed! And very nicely done in the Control Panel with extra location/header/message.

Thank you sooo much! I sure hope that it was an easy-enough thing for you to do, and that a few more Emerald/HikaShop users will benefit from it.

Have a good weekend - you deserve it! :)

Thanks and cheers!

Powered by Cobalt