Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - CleanMart (SKU# FLEX-00015)

TOPIC: Remove price from cart variant

Remove price from cart variant 10 years 3 months ago #7631

I want to hide price in cart variant. I read on virtuemart forum for that, i found that editing administrator/components/com_virtuemart/models/customefields.php
not solves this issue. I tried to remove price for cart variant in type 'V' but i still see it. So, i guess there is an override for this file. Can you please help me to get it removed.
Attachments:
The topic has been locked.

Remove price from cart variant 10 years 3 months ago #7664

Hi,

There is a override for product details page. But there is no override for printing the custom field dropdown selection box.

Showing/hiding the "extra price" next to product variant is something to do with the Virtuemart core file.
Normally we don't provide support for core modifications. But you are in the right truck.

Openvthis PHP file:
administrator/components/com_virtuemart/models/customefields.php

and find this PHP line:
if ($group->field_type == 'V') {
	$default = current ($group->options);
	foreach ($group->options as $productCustom) {
		$price = self::_getCustomPrice($productCustom->custom_price, $currency, $calculator);
		$productCustom->text = JText::_($productCustom->custom_value) . ' ' . $price;
	}
	$group->display = VmHTML::select ('customPrice[' . $row . '][' . $group->virtuemart_custom_id . ']', $group->options, $default->custom_value, '', 'virtuemart_customfield_id', 'text', FALSE, false);
}

In one of those lines, replace this line:
$productCustom->text = JText::_($productCustom->custom_value) . ' ' . $price;

with this:
$productCustom->text = JText::_($productCustom->custom_value);

this modification should remove the price information from the custom fields selection for V type custom field.

Regards,
Support
Last Edit: 10 years 3 months ago by Support.
The topic has been locked.

Remove price from cart variant 10 years 3 months ago #7666

Problem is solved.

Thanks for quick response. :)
The topic has been locked.

Remove price from cart variant 10 years 3 months ago #7673

Sure no problem.

Case solved. Topic closed.

Regards.
Support
The topic has been locked.
Time to create page: 0.141 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo