Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VirtueMart
Shipping by Rules for VirtueMart
Commits
6687205d
Commit
6687205d
authored
Aug 24, 2017
by
Reinhold Kainhofer
Browse files
V6.2.4: Load the VM framework in all plugins; fix array_merge warning
parent
c5b738f1
Changes
16
Hide whitespace changes
Inline
Side-by-side
plugins/awocoupon/Makefile
View file @
6687205d
BASE
=
awocoupon
PLUGINTYPE
=
vmshipmentrules
ZIPBASE
=
opentools_
$(PLUGINTYPE)
VERSION
=
1.
2
VERSION
=
1.
3
PLUGINFILES
=
$(BASE)
.php
$(BASE)
.script.php
$(BASE)
.xml index.html
...
...
plugins/awocoupon/awocoupon.php
View file @
6687205d
...
...
@@ -17,6 +17,10 @@ defined ('_JEXEC') or die('Restricted access');
* http://open-tools.net/
*
*/
if
(
!
class_exists
(
'VmConfig'
))
{
require
(
JPATH_ADMINISTRATOR
.
'/components/com_virtuemart/helpers/config.php'
);
VmConfig
::
loadConfig
();
}
if
(
!
class_exists
(
'VmPlugin'
))
{
require
(
JPATH_VM_PLUGINS
.
DS
.
'vmplugin.php'
);
}
...
...
plugins/awocoupon/awocoupon.xml
View file @
6687205d
...
...
@@ -6,7 +6,7 @@
<authorUrl>
http://www.open-tools.net
</authorUrl>
<copyright>
Copyright (C) 2014-2017, Reinhold Kainhofer
</copyright>
<license>
GPL v3+
</license>
<version>
1.
2
</version>
<version>
1.
3
</version>
<description>
VMSHIPMENTRULES_AWOCOUPON_DESC
</description>
<files>
<filename
plugin=
"awocoupon"
>
awocoupon.php
</filename>
...
...
plugins/regexp/Makefile
View file @
6687205d
BASE
=
regexp
PLUGINTYPE
=
vmshipmentrules
ZIPBASE
=
opentools_vmshipmentrules
VERSION
=
1.
0
VERSION
=
1.
1
PLUGINFILES
=
$(BASE)
.php
$(BASE)
.script.php
$(BASE)
.xml index.html
...
...
plugins/regexp/regexp.php
View file @
6687205d
...
...
@@ -15,6 +15,10 @@ defined ('_JEXEC') or die('Restricted access');
*
* http://open-tools.net/
*/
if
(
!
class_exists
(
'VmConfig'
))
{
require
(
JPATH_ADMINISTRATOR
.
'/components/com_virtuemart/helpers/config.php'
);
VmConfig
::
loadConfig
();
}
if
(
!
class_exists
(
'VmPlugin'
))
{
require
(
JPATH_VM_PLUGINS
.
DS
.
'vmplugin.php'
);
}
...
...
plugins/regexp/regexp.xml
View file @
6687205d
...
...
@@ -6,7 +6,7 @@
<authorUrl>
http://www.open-tools.net
</authorUrl>
<copyright>
Copyright (C) 2014, Reinhold Kainhofer
</copyright>
<license>
GPL v3+
</license>
<version>
1.
0
</version>
<version>
1.
1
</version>
<description>
VMSHIPMENTRULES_REGEXP_DESC
</description>
<files>
<filename
plugin=
"regexp"
>
regexp.php
</filename>
...
...
plugins/template/YOUR_PLUGIN_NAME.php
View file @
6687205d
...
...
@@ -16,6 +16,10 @@ defined ('_JEXEC') or die('Restricted access');
* http://open-tools.net/
*
*/
if
(
!
class_exists
(
'VmConfig'
))
{
require
(
JPATH_ADMINISTRATOR
.
'/components/com_virtuemart/helpers/config.php'
);
VmConfig
::
loadConfig
();
}
if
(
!
class_exists
(
'VmPlugin'
))
{
require
(
JPATH_VM_PLUGINS
.
DS
.
'vmplugin.php'
);
}
...
...
plugins/template/releases/plg_opentools_vmshipmentrules_YOUR_PLUGIN_NAME_v1.0.zip
View file @
6687205d
No preview for this file type
plugins/vmcouponprice/Makefile
View file @
6687205d
BASE
=
vmcouponprice
PLUGINTYPE
=
vmshipmentrules
ZIPBASE
=
opentools_vmshipmentrules
VERSION
=
1.
0
VERSION
=
1.
1
PLUGINFILES
=
$(BASE)
.php
$(BASE)
.script.php
$(BASE)
.xml index.html
...
...
plugins/vmcouponprice/vmcouponprice.php
View file @
6687205d
...
...
@@ -16,6 +16,10 @@ defined ('_JEXEC') or die('Restricted access');
* http://open-tools.net/
*
*/
if
(
!
class_exists
(
'VmConfig'
))
{
require
(
JPATH_ADMINISTRATOR
.
'/components/com_virtuemart/helpers/config.php'
);
VmConfig
::
loadConfig
();
}
if
(
!
class_exists
(
'VmPlugin'
))
{
require
(
JPATH_VM_PLUGINS
.
DS
.
'vmplugin.php'
);
}
...
...
plugins/vmcouponprice/vmcouponprice.xml
View file @
6687205d
...
...
@@ -6,7 +6,7 @@
<authorUrl>
http://www.open-tools.net
</authorUrl>
<copyright>
Copyright (C) 2017, Reinhold Kainhofer
</copyright>
<license>
GPL v3+
</license>
<version>
1.
0
</version>
<version>
1.
1
</version>
<description>
VMSHIPMENTRULES_VMCOUPONPRICE_DESC
</description>
<files>
<filename
plugin=
"vmcouponprice"
>
vmcouponprice.php
</filename>
...
...
releases/plg_opentools_vm_rules_shipping_advanced_v6.2.4.zip
0 → 100644
View file @
6687205d
File added
releases/plg_opentools_vm_rules_shipping_v6.2.4.zip
0 → 100644
View file @
6687205d
File added
rules_shipping.php
View file @
6687205d
...
...
@@ -19,6 +19,10 @@ defined ('_JEXEC') or die('Restricted access');
* @author Reinhold Kainhofer, based on the weight_countries shipping plugin by Valerie Isaksen
*
*/
if
(
!
class_exists
(
'VmConfig'
))
{
require
(
JPATH_ADMINISTRATOR
.
'/components/com_virtuemart/helpers/config.php'
);
VmConfig
::
loadConfig
();
}
if
(
!
class_exists
(
'vmPSPlugin'
))
{
require
(
JPATH_VM_PLUGINS
.
DS
.
'vmpsplugin.php'
);
}
...
...
rules_shipping_advanced.php
View file @
6687205d
...
...
@@ -21,6 +21,7 @@ defined ('_JEXEC') or die('Restricted access');
if
(
!
class_exists
(
'VmConfig'
))
{
require
(
JPATH_ADMINISTRATOR
.
'/components/com_virtuemart/helpers/config.php'
);
VmConfig
::
loadConfig
();
}
if
(
!
class_exists
(
'vmPSPlugin'
))
{
require
(
JPATH_VM_PLUGINS
.
DS
.
'vmpsplugin.php'
);
...
...
rules_shipping_base.php
View file @
6687205d
...
...
@@ -20,6 +20,7 @@ defined ('_JEXEC') or die('Restricted access');
*/
if
(
!
class_exists
(
'VmConfig'
))
{
require
(
JPATH_ADMINISTRATOR
.
'/components/com_virtuemart/helpers/config.php'
);
VmConfig
::
loadConfig
();
}
if
(
!
class_exists
(
'vmPSPlugin'
))
{
require
(
JPATH_VM_PLUGINS
.
DS
.
'vmpsplugin.php'
);
...
...
@@ -565,6 +566,66 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
return
$ret
;
}
/* Display product shipping costs on product details page (required in some jurisdictions)
*
* Copied from the weight_countries shipment plugin
* @copyright Copyright (C) 2004-2012 VirtueMart Team - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @author Valerie Isaksen
*/
/* function plgVmOnProductDisplayShipment($product, &$productDisplayShipments) {
if ($this->getPluginMethods($product->virtuemart_vendor_id) === 0) {
return FALSE;
}
if (!class_exists('VirtueMartCart'))
require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php');
$html = '';
if (!class_exists('CurrencyDisplay'))
require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php');
$currency = CurrencyDisplay::getInstance();
foreach ($this->methods as $this->_currentMethod) {
if($this->_currentMethod->show_on_pdetails){
if(!isset($cart)) {
$cart = VirtueMartCart::getCart();
$cart->prepareCartData();
}
$prices = array('salesPrice'=>0.0);
if(isset($cart->cartPrices)){
$prices['salesPrice'] = $cart->cartPrices['salesPrice'];
}
if(isset($product->prices)){
$prices['salesPrice'] += $product->prices['salesPrice'];
}
if($this->checkConditions($cart, $this->_currentMethod, $prices, $product)){
$product->prices['shipmentPrice'] = $this->getCosts($cart, $this->_currentMethod, $cart->cartPrices);
// TODO: Implement shipping costs with tax included...
if(isset($product->prices['VatTax']) and count($product->prices['VatTax'])>0){
reset($product->prices['VatTax']);
$rule = current($product->prices['VatTax']);
if(isset($rule[1])) {
$product->prices['shipmentTax'] = $product->prices['shipmentPrice'] * $rule[1]/100.0;
$product->prices['shipmentPrice'] = $product->prices['shipmentPrice'] * (1 + $rule[1]/100.0);
}
}
// TODO: Implement custom display template
$html = $this->renderByLayout( 'default', array("method" => $this->_currentMethod, "cart" => $cart,"product" => $product,"currency" => $currency) );
}
}
}
$productDisplayShipments[] = $html;
}
*/
}
// No closing tag
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment