Commit 1215c921 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Images for documentation (translating rule names)

parent 266d6b7e
......@@ -776,20 +776,21 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
$data['discountamount'] = $cart_prices['discountAmount'];
$data['pricewithouttax'] = $cart_prices['priceWithoutTax'];
} else {
// TODO: Calculate the prices from the individual products!
// Calculate the prices from the individual products!
// Possible problems are discounts on the order total
foreach ($products as $product) {
$data['amount'] = $product->allPrices[$product->selectedPrice]['salesPrice'];
$data['amountwithtax'] = $product->allPrices[$product->selectedPrice]['salesPrice'];
$data['amountwithouttax'] = $product->allPrices[$product->selectedPrice]['priceWithoutTax'];
$data['baseprice'] = $product->allPrices[$product->selectedPrice]['basePrice'];
$data['basepricewithtax'] = $product->allPrices[$product->selectedPrice]['basePriceWithTax'];
$data['discountedpricewithouttax'] = $product->allPrices[$product->selectedPrice]['discountedPriceWithoutTax'];
$data['salesprice'] = $product->allPrices[$product->selectedPrice]['salesPrice'];
$data['taxamount'] = $product->allPrices[$product->selectedPrice]['taxAmount'];
$data['salespricewithdiscount'] = $product->allPrices[$product->selectedPrice]['salesPriceWithDiscount'];
$data['discountamount'] = $product->allPrices[$product->selectedPrice]['discountAmount'];
$data['pricewithouttax'] = $product->allPrices[$product->selectedPrice]['priceWithoutTax'];
JFactory::getApplication()->enqueueMessage("<pre>Product: ".print_r($product,1)."</pre>", 'error');
$data['amount'] += $product->allPrices[$product->selectedPrice]['salesPrice'];
$data['amountwithtax'] += $product->allPrices[$product->selectedPrice]['salesPrice'];
$data['amountwithouttax'] += $product->allPrices[$product->selectedPrice]['priceWithoutTax'];
$data['baseprice'] += $product->allPrices[$product->selectedPrice]['basePrice'];
$data['basepricewithtax'] += $product->allPrices[$product->selectedPrice]['basePriceWithTax'];
$data['discountedpricewithouttax'] += $product->allPrices[$product->selectedPrice]['discountedPriceWithoutTax'];
$data['salesprice'] += $product->allPrices[$product->selectedPrice]['salesPrice'];
$data['taxamount'] += $product->allPrices[$product->selectedPrice]['taxAmount'];
$data['salespricewithdiscount'] += $product->allPrices[$product->selectedPrice]['salesPriceWithDiscount'];
$data['discountamount'] += $product->allPrices[$product->selectedPrice]['discountAmount'];
$data['pricewithouttax'] += $product->allPrices[$product->selectedPrice]['priceWithoutTax'];
}
}
return $data;
......@@ -823,8 +824,7 @@ class plgVmShipmentRules_Shipping_Base extends vmPSPlugin {
// Finally, call the triger of vmshipmentrules plugins to let them add/modify variables
JPluginHelper::importPlugin('vmshipmentrules');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onVmShippingRulesGetCartValues',array(&$cartvals, $cart, $products, $method, $cart_prices));
JDispatcher::getInstance()->trigger('onVmShippingRulesGetCartValues',array(&$cartvals, $cart, $products, $method, $cart_prices));
return $cartvals;
}
......@@ -1203,7 +1203,6 @@ class ShippingRule {
"evaluate_for_manufacturers" => 'manufacturers'
);
// JFactory::getApplication()->enqueueMessage("<pre>Scoping: condition is ".$filterkeys[$scoping].'='.print_r($conditionvals,1).", Old cartvals are: ".print_r($vals,1)."</pre>", 'error');
$conditions = array();
if (isset($filterkeys[$scoping]))
$conditions[$filterkeys[$scoping]] = $conditionvals;
......@@ -1212,7 +1211,6 @@ class ShippingRule {
$filteredproducts = filterProducts($products, $conditions);
// We have been handed a callback function to calculate the cartvals for the filtered list of products, so use it:
$filteredvals = $cartvals_callback($filteredproducts);
// JFactory::getApplication()->enqueueMessage("<pre>Scoping: condition is ".print_r($conditions,1).", products filtered: ".count($filteredproducts).", New cartvals are: ".print_r($filteredvals,1)."</pre>", 'error');
return $this->evaluateTerm ($expr, $filteredvals, $filteredproducts, $cartvals_callback);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment