Coupon code lost unless checked out immediately

More
7 years 2 months ago - 7 years 2 months ago #36756 by loppis
Hi, it's me again :).

As I already mentioned, partial payments now work fine on my site and the coupon is created and automatically inserted in cart :



All good so far and user can checkout and pay using another payment method.

But let's say that the customer changes his mind, navigates to another page to add another product, and then go back to cart and checkout.

Now the coupon is missing and no discount is given anymore- at least on my site (VM 3.0.18 + Rupostel OPC (same issue with the VM standard checkout though)

The points have already been deducted from the customers account, but customer won't be able to use them, unless he or she has a very good memory or copied the code earlier and save it somewhere.

This can definitely become an issue and make some customers really annoyed :/.

Is this only happening on my site, or?
Attachments:
Last edit: 7 years 2 months ago by loppis.

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

More
7 years 2 months ago #36786 by nordmograph
Hello

I just tested at
www.nordmograph.com/workshop
And the coupon kept attached tot he cart, with the correct discount.
Even after browsing to other pages and coming back to the cart.
I'm not sure I can reproduce the issue you describe.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

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

More
7 years 2 months ago - 7 years 2 months ago #36804 by loppis
Thank you for testing :).

I disabled AwoCoupon on my store, and now it works fine too - the coupon doesn't go away until the customer actively removes it from the cart (which is quite unlikely to happen :))

However, AwoCoupon is essential for me - and is likely to be for many other VM users as well - even the free version provides many features that the native VM coupon system is missing.

I guess that native coupon works even with awocoupon installed, but to get rid of the issue described above we need to insert the coupon in awocoupon instead, I suppose?

Around line 209 :

$q ="INSERT INTO #__virtuemart_coupons
(coupon_used , coupon_code, percent_or_total , coupon_type, coupon_value, coupon_start_date, created_on)
VALUES
('0' , '".$coupon_code."' , 'total' , 'gift' , '". $coupon_price ."', '0000-00-00 00:00:00' , '".date('Y-m-d H:i:s')."')";
$db->setQuery($q);
$db->execute();

AwoCoupon stores the coupons in it's own table, #__awocoupon , my coding skills are limited but I'll play around with it and see if I can write code that works :).

Ultimately, a setting in the plugin parameters where we can chose if we're using awocoupon or native VM coupons would be nice of course, but I'll mess with the above code and report back my results :).

EDIT : Nordmograph, in case adding support for AwoCoupon would be in your interest as well, I believe this thread has the info we need to create the coupon :

awodev.com/forum/awocoupon/help-section/...ns-directly-database

Meanwhile, I'll keep experimenting on my own hehe :)

Cheers
Last edit: 7 years 2 months ago by loppis.
The following user(s) said Thank You: nordmograph

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

More
7 years 2 months ago #36895 by nordmograph
Hello

You can redownload the plugin.
I added support for Awo coupon

Edit the settings, set the partial payment method to Awo coupons instead of VM coupons.
Then the created coupon will be added to the #__awo_coupons_vm table and to the #__awo_coupons_vm_user one to restrict coupon to that user.
Give it a try and let me know how it goes.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

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

More
7 years 2 months ago #36938 by loppis
Wow, awesome! Thank you :).

I'll test and get back to you with the results :)

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

More
7 years 2 months ago #37087 by loppis
Hi again, sorry for being so slow. I'm traveling and don't have daily Internet access :)

A quick test gave the following error :

Points was deducted but a coupon was not created, order was created as pending (user did not have a chance to pay the reminder using real money).

I don't have the "#__awocoupon_vm" table in my database, instead, the table where coupons are stored is called "#__awocoupon".

Tried changing a couple of things :

Line 216

From
$q ="INSERT INTO #__awocoupon_vm

To
$q ="INSERT INTO #__awocoupon

Also line 217
( coupon_code, num_of_uses , coupon_value_type , coupon_value , discount_type , function_type, startdate )

to

( coupon_code, num_of_uses_total , coupon_value_type , coupon_value , discount_type , function_type, startdate )

And line 223

$q ="INSERT INTO #__awocoupon_vm_user
to
$q ="INSERT INTO #__awocoupon_user

... but now I get Error 404 after trying to apply a partial payment



Can't access the log files right now but can dig it up later if it would help?
Attachments:

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

Time to create page: 0.384 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.