Hello
Not a big deal I don't think . In the Virtuemart configuration we have Default Weight Unit = Pounds and Default LWH Unit = Foot.
However when we add new products it no longer defaults to pounds and feet. It defaults to Killogrammes and Metres.
Any help would be appreciated
Thanks :-)
Martin
have the same problem but with Centimeters. new products are defaulted to Meters.
in the last version? I thought I solved that.
VirtueMart 2.6.6 still has this problem... any solutions ?
found the solutions... hope it will be fix in the next version...
file: administrator\components\com_virtuemart\views\product\view.html.php
search for this row --> if(!empty($product->product_weight_uom))
replace all if else with this one:
if(!empty($product->product_weight_uom))
{ // or !$task=='add'
$product_weight_uom = $product->product_weight_uom;
$product_unit = $product->product_unit;
if(!empty($product->product_lwh_uom))
{
$product_lwh_uom = $product->product_lwh_uom;
}
else
{
$product_lwh_uom = VmConfig::get('lwh_unit_default');
}
}
else if(!empty($product_parent))
{
$product_weight_uom = $product_parent->product_weight_uom;
$product_unit = $product_parent->product_unit;
if(!empty($product_parent->product_lwh_uom))
{
$product_lwh_uom = $product_parent->product_lwh_uom;
}
else
{
$product_lwh_uom = VmConfig::get('lwh_unit_default');
}
}
else
{
$product_weight_uom = VmConfig::get('weight_unit_default');
$product_unit = VmConfig::get('weight_unit_default');
$product_lwh_uom = VmConfig::get('lwh_unit_default');
}
?
This?
Quote
if(!empty($product->product_weight_uom)){ // or !$task=='add'
$product_weight_uom = $product->product_weight_uom;
$product_unit = $product->product_unit;
$product_lwh_uom = $product->product_lwh_uom;
} else if(!empty($product_parent)){
$product_weight_uom = $product_parent->product_weight_uom;
$product_unit = $product_parent->product_unit;
$product_lwh_uom = $product_parent->product_lwh_uom;
} else {
$product_weight_uom = VmConfig::get('weight_unit_default');
$product_unit = VmConfig::get('weight_unit_default');
$product_lwh_uom= VmConfig::get('lwh_unit_default');
}
Quote from: Milbo on August 14, 2014, 02:23:44 AM
?
This?
Quote
if(!empty($product->product_weight_uom)){ // or !$task=='add'
$product_weight_uom = $product->product_weight_uom;
$product_unit = $product->product_unit;
$product_lwh_uom = $product->product_lwh_uom;
} else if(!empty($product_parent)){
$product_weight_uom = $product_parent->product_weight_uom;
$product_unit = $product_parent->product_unit;
$product_lwh_uom = $product_parent->product_lwh_uom;
} else {
$product_weight_uom = VmConfig::get('weight_unit_default');
$product_unit = VmConfig::get('weight_unit_default');
$product_lwh_uom= VmConfig::get('lwh_unit_default');
}
yes... that section.... :)
What about this solution?
if(!empty($product->product_weight_uom)){
$product_weight_uom = $product->product_weight_uom;
} else if(!empty($product_parent)){
$product_weight_uom = $product_parent->product_weight_uom;
} else {
$product_weight_uom = VmConfig::get('weight_unit_default');
}
if(!empty($product->product_lwh_uom)){
$product_lwh_uom = $product->product_lwh_uom;
} else if(!empty($product_parent)){
$product_lwh_uom = $product_parent->product_lwh_uom;
} else {
$product_lwh_uom = VmConfig::get('lwh_unit_default');
}
if(!empty($product->product_unit)){
$product_unit = $product->product_unit;
} else if(!empty($product_parent)){
$product_unit = $product_parent->product_unit;
} else {
$product_unit = VmConfig::get('product_unit_default','KG');
}
Quote from: Milbo on August 15, 2014, 10:42:18 AM
What about this solution?
if(!empty($product->product_weight_uom)){
$product_weight_uom = $product->product_weight_uom;
} else if(!empty($product_parent)){
$product_weight_uom = $product_parent->product_weight_uom;
} else {
$product_weight_uom = VmConfig::get('weight_unit_default');
}
if(!empty($product->product_lwh_uom)){
$product_lwh_uom = $product->product_lwh_uom;
} else if(!empty($product_parent)){
$product_lwh_uom = $product_parent->product_lwh_uom;
} else {
$product_lwh_uom = VmConfig::get('lwh_unit_default');
}
if(!empty($product->product_unit)){
$product_unit = $product->product_unit;
} else if(!empty($product_parent)){
$product_unit = $product_parent->product_unit;
} else {
$product_unit = VmConfig::get('product_unit_default','KG');
}
nope... it didn't work for this situation: Create New Product...
In Virtuemart Configurations -> ShopFront, I set Default LWH Unit to Centimeters. But in Create New Product, it shows Metres...
thx in advance....
just try the new version, there is another line missing, setting the parent to false if there is no parent (id =0)
Quote from: Milbo on August 16, 2014, 04:03:01 AM
just try the new version, there is another line missing, setting the parent to false if there is no parent (id =0)
ok... i'll try it... thx... :)