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:

new vm userinfo field. 26 May 2014 21:22 #1

  • TMadge
  • TMadge's Avatar Topic Author
quick question can we use a field that we've added to the virtuemart_userinfos table with the advanced shipping plugin.

Added a field and a trigger on insert/update to calculate our own region areas, hopefully reducing possible 300 line rule to 16

is this possible ?

new vm userinfo field. 27 May 2014 23:30 #2

This functionality is not readily available in the plugin. You can, however, extend the plugin yourself to make this field available (from your post it seems you have some VM coding experience):

In the function addCustomCartValues (class plgVmShipmentRules_Shipping_Advanced in the rules_shipping_advanced.php file for the advanced version; class plgVmShipmentRules_Shipping_Base in the rules_shipping_base.php file for the free version) you can add your own values to the $values hash, which are then made available as a variable in the rules. In that function, you have the whole cart data structure available in the $cart argument.

E.g.
protected function addCustomCartValues (VirtueMartCart $cart, $cart_prices, &$values) {
    $values['coupon'] = $cart->couponCode;
    $values['yourvariable'] = 12345;
}
Of course, the step that might still be missing is how to get the field from the userinfo table into the cart object...

Best regards,
Reinhold

new vm userinfo field. 28 May 2014 16:10 #3

  • TMadge
  • TMadge's Avatar Topic Author
thnx sorry for the impatience... ;)

[SOLVED] new vm userinfo field. 28 May 2014 16:10 #4

  • TMadge
  • TMadge's Avatar Topic Author
Problem solved.
  • Page:
  • 1