Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Shipping by Rules for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Discount on cart 11 Feb 2016 16:28 #1

  • szumik
  • szumik's Avatar Topic Author
I make discounts with "Order Discount Rules" plugin. The plugin applies discount on cart depending on the order subtotal. I've tried to make some rules for shipping, but no results. "Advanced Shipping by Rules" plugin can't see discounts on cart.

For example:

[articles] => 1
[products] => 1
[amount] => 299.9
[amountwithtax] => 299.9
[amountwithouttax] => 299.9
[baseprice] => 299.9
[basepricewithtax] => 0
[discountedpricewithouttax] => 299.9
[salesprice] => 299.9
[taxamount] => 0
[salespricewithdiscount] => 0
[discountamount] => 0
[pricewithouttax] => 299.9

What is the problem?

Discount on cart 11 Feb 2016 17:42 #2

Dear Szumik,
Unfortunately, VirtueMart handles shipping costs before the discounts on the cart are applied, so by design a shipping plugin can never depend on the cart discounts. See the Virtuemart core file administrator/components/com_virtuemart/helpers/calculationh.php, function getCheckoutPrices(&$cart), around line 886, where first the shipping cost is determined (i.e. the plugin does its job, line 886), then the payment cost is calculated (line 888) and then the cart-wide discounts are added (line 892).

Best regards,
Reinhold

Discount on cart 11 Feb 2016 19:49 #3

  • szumik
  • szumik's Avatar Topic Author
Does it mean - no solutions?

Your plugin has a lot of options. I've bought the advance version expecting to solve the problem especially the plugin has rules with discount variables. Maybe is there a solution with a plugin of type 'vmshipmentrules'?
The problem is crucial to me. No any alternative.

Discount on cart 15 Feb 2016 12:45 #4

  • szumik
  • szumik's Avatar Topic Author
Reinhold,

It is not solved to me. I read in the plugin description in "Differences between the standard and the advanced version" table and "Available Variables": "Amount, prices before/after tax/discounts". Nothing about discounts on cart. But it doesn't matter now.

Could you just tell me, in your opinion, it can be solved? Maybe with "Extending the Plugin with Custom Functions and Variables using "vmshipmentrules" plugins"? Any suggestions?

Discount on cart 15 Feb 2016 16:26 #5

Dear Szumik,
Can you please try the latest version 6.1 of the plugin, which we just released. There we added variables
  • billSubtotal ... The product subtotal (all products in the cart) before price modifiers per bill and before taxes per bill (but including modifiers and tax per product)
  • billDiscountAmount, billTaxAmount ... the per-bill tax and discount amounts
  • billTotal ... The order total after per-bill modifiers and taxes have been applied (but excluding shipping and payment fees).

Please note that these new variables will not be influenced by the evaluate_for_XXX function, as they are always defined cart-wide, so it does not make sense to restrict them to certain categories etc.

Best regards,
Reinhold

Discount on cart 16 Feb 2016 15:48 #6

  • szumik
  • szumik's Avatar Topic Author
Thanks Reinhold

I've checked it out. But probably I have bad luck. Unfortunately, the plugin is still not working properly to me.

Data debugging (don't use taxes, no restriction except one - discount on cart for one specific shoppergroup only)

Discount on cart

[amount] => 299.9
[amountwithtax] => 299.9
[amountwithouttax] => 299.9
[baseprice] => 299.9
[basepricewithtax] => 0
[discountedpricewithouttax] => 299.9
[salesprice] => 299.9
[taxamount] => 0
[salespricewithdiscount] => 0
[discountamount] => 0
[pricewithouttax] => 299.9
[billtotal] => 0
[billdiscountamount] =>
[billtaxamount] =>
[billsubtotal] =>

There is no discount. I can see it in the cart - the subtotal section. The discount is not shown in the total section.


Discount on products

[amount] => 239.92
[amountwithtax] => 239.92
[amountwithouttax] => 299.9
[baseprice] => 299.9
[basepricewithtax] => 0
[discountedpricewithouttax] => 239.92
[salesprice] => 239.92
[taxamount] => 0
[salespricewithdiscount] => 239.92
[discountamount] => -59.98
[pricewithouttax] => 299.9
[billtotal] => 0
[billdiscountamount] =>
[billtaxamount] =>
[billsubtotal] =>

There is my discount The discount is shown in all sections.


The total price (amount to pay) is calculated properly with discount on cart. It seems to me the billtotal would be the good solution, but: [billtotal] => 0

In this case - no hope to solve the problem?

Discount on cart 21 Feb 2016 09:51 #7

Dear Szumik,
Thank you for the details. In our tests, a discount per bill (set in VM's prize modifiers and tax configuration) properly sets the billtotal, so I am not able to reproduce the problem with our test installations.

Can you please tell use:
-) The VirtueMart version you have installed
-) The Joomla version you have installed
-) How exactly you have set up the discount on cart (e.g. a screenshot of the calculation rule configuration page)

This might help us reproduce the issue and eventually solve it for you, too.

Best regards,
Reinhold

Discount on cart 05 Mar 2016 00:54 #8

Dear Szumik,
Thank you for the details. In our tests, a discount per bill (set in VM's prize modifiers and tax configuration) properly sets the billtotal, so I am not able to reproduce the problem with our test installations.

Can you please tell use:
-) The VirtueMart version you have installed
-) The Joomla version you have installed
-) How exactly you have set up the discount on cart (e.g. a screenshot of the calculation rule configuration page)

This might help us reproduce the issue and eventually solve it for you, too.

Best regards,
Reinhold
  • Page:
  • 1