Hello,
you have to provide an updated version of the plugin:
www.hikashop.com/marketplace/product/221...quantity-plugin.html
I changed the code so that it works with the new Hikashop versions.
I don't know if it is 100% correct.
Best,
Yannis
<?php
jimport('joomla.plugin.plugin');
class plgSystemCustom_quantity extends JPlugin{
}
if(!function_exists('fid_custom_quantity_normalize_length')) {
function fid_custom_quantity_normalize_length($value) {
$value = trim((string) $value);
$value = str_replace(',', '.', $value);
return (float) $value;
}
}
if(!function_exists('hikashop_product_price_for_quantity_in_cart') && !function_exists('hikashop_product_price_for_quantity_in_order')) {
function hikashop_product_price_for_quantity_in_cart(&$product){
$currencyClass = hikashop_get('class.currency');
$quantity = @$product->cart_product_quantity;
$ordered_length = 1;
if(!empty($product->ordered_length)){
$ordered_length = fid_custom_quantity_normalize_length($product->ordered_length);
}
$currencyClass->quantityPrices($product->prices, $quantity, $product->cart_product_total_quantity);
if($ordered_length > 0 && $ordered_length != 1 && !empty($product->prices)) {
foreach($product->prices as $k => $price) {
if(isset($price->price_value)) {
$product->prices[$k]->price_value = (float) $price->price_value * $ordered_length;
}
if(isset($price->price_value_with_tax)) {
$product->prices[$k]->price_value_with_tax = (float) $price->price_value_with_tax * $ordered_length;
}
}
}
}
function hikashop_product_price_for_quantity_in_order(&$product){
$quantity = $product->order_product_quantity;
if(!empty($product->ordered_length)){
$ordered_length = fid_custom_quantity_normalize_length($product->ordered_length);
$quantity = $quantity * $ordered_length;
}
$product->order_product_total_price_no_vat = $product->order_product_price * $quantity;
$product->order_product_total_price = ($product->order_product_price + $product->order_product_tax) * $quantity;
}
}