how to use Multi Coupon Checkout

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 3 weeks ago #351236

-- HikaShop version -- : 4.7.2
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.3
-- Browser(s) name and version -- : Chrome 90.0.4430.212

Hi,
i'm trying to use the Multi Coupon Checkout plugin.
I enabled all, i can see input box on my checkout page, i add a coupon from Orders->Coupon and than i write down coupon code on the input on the checkout page, it start to process but nothing comes out

How can i use this plugin?

Thank you.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 3 weeks ago #351239

Hi,

First, please make sure that you're able to use your coupon on the checkout with the Multi coupon plugin deactivated.
It's likely that the problem you're describing has nothing to do with the plugin.

The plugin waits that a coupon has been added to a cart to remove the coupon from the cart and add it instead with its own system as a "simili coupon". No configuration is required to use the plugin. You just have to install it and enable it.

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

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 3 weeks ago #351298

Hi,
without plugin coupon works as expected.
Can you explain better what it means that the plugin waits for a copon to be added to the cart and then remove it?

Thank you

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 3 weeks ago #351299

Hi,

Well, normally, you add a coupon to the cart via the input field in the "coupon" view of the checkout workflow.
When this happens, the plugin takes the coupon out of the cart, as if the cart didn't have a coupon, and then adds it as an "additional fee" to the cart. That way, the normal coupon view of HikaShop can be used again to add another coupon, and the coupon is still taken into account in the cart.

So if it works without the multicoupon plugin, it has to work with the plugin too, unless there is a misunderstanding somewhere.
For example, the cart module doesn't display additional fees, but it can display coupons. So if you rely on the cart module display to see if the coupon is in the cart or not, instead of the cart view of the checkout workflow, you might think the coupon is not taken into account when the plugin is activated, when in fact it is, but you just don't see it.

Could you provide a coupon code, a screenshot of the settings of that coupon, activate the multicoupon plugin, and provide instructions to reproduce the issue on your website ?

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

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 3 weeks ago #351339

Hi,
sorry but i cannot get it!
here is my website 93.65.142.236:22080/joomlabresciarevamp2021
user: This email address is being protected from spambots. You need JavaScript enabled to view it.
pwd: cv56py

go to cart and chekcout
plugin is active, try to add coupon AAA (see attached screenshot) nothing appends

thank you

Attachments:

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 3 weeks ago #351343

Hi,

Thanks.
Could you provide a FTP access via our contact form so that we could look into it deeper ?
www.hikashop.com/support/contact-us.html

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

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 3 weeks ago #351365

Hi,
sorry but i have problem give you access through FTP.
You can download a whole site backup from the following url (akeeba backup)

JPA: www.dropbox.com/s/ynvl9kut8onyi94/site-l...l3zZwoXlIw4.jpa?dl=0
or
ZIP: www.dropbox.com/s/vtk422undrqv6c0/site-l...umz1YjbsZEE.zip?dl=0

Hope you can check it and solve my problem.

Thanks

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 3 weeks ago #351374

Hi,

Well, I tried but it didn't work.
After going through the restoration process, the website didn't work for some reason:
i.imgur.com/kBAKf71.png

If you can't provide a FTP access, could you install a file explorer extension ( like extensions.joomla.org/extension/core-enh...anagement/extplorer/ ) on your website backend which would allow me to modify the files without the need for FTP ?

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

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 2 weeks ago #351437

Hi,
you have to use PHP 7.4, it will not work with 8 or latest.


eXtplorer installed

Let me know if you need something else to check and solve our problem!

Thanks.

Regards,
Matteo

Last edit: 11 months 2 weeks ago by nicolas.

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 2 weeks ago #351450

Hi,

Thanks for the access.
I was able to reproduce and debug the issue on your website and made a patch in the multicoupon plugin.
I've added the patch on your website and it seems to be working fine now.
I've also made a new version of the plugin available on our website in order for others to be able to get the patch.

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

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 2 weeks ago #351457

Hi,
thank you it works!

Unfortunately there is another problem now.

I created two coupons, AAA and BBB, if I add AAA to checkout page everything is ok!
Then I add BBB in the checkout page but it gives me 2 times BBB, both with the value of BBB (-2€)
if I put AAA again it gives me two AAA instead of the two BBB, both with the value of AAA (-10€)

You can use our environment for testing
Thanks

Regards

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 2 weeks ago #351468

Hi,

Thank you for the new feedback.
The new issue comes from the modifications I made in the previous patch.
I've made a new patch to fix this too.
I've added the patch on your website and it seems to be working fine now.
I've also made a new version of the plugin available on our website in order for others to be able to get the patch.

The following user(s) said Thank You: matmosis

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

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 2 weeks ago #351472

Hi,
it works thank you.

Just a little one, when adding a coupon, message $checkoutHelper->addMessage('cart.additional.added', array(Jtext::_('COUPON_ADDED'),success')); does not come out


Thanks

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 2 weeks ago #351475

Hi,

Thank you for the new feedback.
I've made a new patch to fix this too.
I've added the patch on your website but it didn't work. It seems that whatever modification I did, they were not taken into account for some reason. So I've tested the patch on a test website on my end and I confirmed it fixed the problem there.
I've also made a new version of the plugin available on our website and the patch is in it.

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

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 1 week ago #351638

Hi,
is there an event fired when coupon is removed by the little trash icon that we can get?

Thanks

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 1 week ago #351641

Hi,

A save is done on class.cart since the additionals are stored in cart_params, so you have the onBeforeCartSave(&$cart, &$do) event before the modification and then onAfterCartSave(&$cart) after it. if you check $cart->cart_params and $cart->old->cart_params you should be able to run PHP code only when the coupon is removed via the little trash icon.

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

  • Posts: 50
  • Thank you received: 1
  • Hikamarket Multivendor Hikashop Business
11 months 1 week ago #351656

Hi,
sorry but i don't get what's the difference between $cart->additional and $cart->cart_params->additional
And in general i don't get what $cart->cart_params contains, can you explain me better please?

Regarding my question about manage coupon delete, can you provide an example code?

Thanks

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

  • Posts: 81481
  • Thank you received: 13062
  • MODERATOR
11 months 1 week ago #351660

Hi,

Well, I'm not sure about the code.
I suppose it should be something like that:

function onAfterCartSave(&$cart) {
$oldcoupons = array();
$newcoupons = array();
if(!empty($cart->old->cart_params->additional)) {
foreach($cart->old->cart_params->additional as $additional) {
 $oldcoupons[] = $additional->name;
}
}

if(!empty($cart->cart_params->additional)) {
foreach($cart->cart_params->additional as $additional) {
 $newcoupons[] = $additional->name;
}
}

if(count($newcoupons) < count($oldcoupons)) {
 // a coupon has been deleted, add your code there
}

}

Note that this will probably not work as I haven't tested it.
The first thing I would do is to have only hikashop_writeToLog($cart);
in the function, run my test and check the "payment log file" of the HikaShop configuration. At the end I should have a cart object with the data of the cart, including $cart->cart_params and $cart->old->cart_params
That way, I could make sure that the data in these indeed reflect the coupon being removed, and that they are in the correct format as you actually might need to json_decode the params before running the foreach on them.


$cart->additional is where the additionals are added to the $cart object when a cart is loaded. There is no "additional" column in the hikashop_cart table in the database. cart_params is the name of the column of hikahsop_cart where all extra data regarding a cart is stored in the database, including the additionals.

The following user(s) said Thank You: matmosis

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

Time to create page: 0.077 seconds
Powered by Kunena Forum