Author Topic: Hide the attribute price (keep the description) in carts and checkout etc  (Read 7313 times)

jbmaca

  • Beginner
  • *
  • Posts: 16
Thanks for the reply Hutson!  I really appreciate it.  I modified a few files based on dabempire's posts below and it worked like a charm. :)

http://forum.virtuemart.net/index.php?topic=44905.0

Can I ask you though how you managed to allow for multipliers to be used in the attributes?  My other pricing options are determined by percentages so it would be great if I could do it that way instead.

Many thanks for the help.  :)

exhost

  • Beginner
  • *
  • Posts: 23
thanks for posting this, I am trying to remove the title of the attribute from the cart as well . Any ideas?

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3254
  • VirtueMart Version: 3.8.4
exhost

Try what I posted earlier

I have made some modifications to the attribute handling to allow for a multipliers to be used in the attributes e.g. take the base price and * by x

Hence the removal in ps_product.

JBmaca

To get rid of the attribute in carts



You might need to hack
adminstrator/com_virtuemart/classes/ps_product.php



Just comment these lines out as shown.

Unless of course someone has a better idea??


Code:
Code: [Select]
if( in_array( $this_key, $custom_attribute_fields )) {
if( @$custom_attribute_fields_check[$this_key] == md5( $mosConfig_secret.$this_key )) {
// the passed value is valid, don't use it for calculating prices
continue;
}
}
           

// if( isset( $product_attributes[$this_key]['values'][$this_value] )) {
// $modifier = $product_attributes[$this_key]['values'][$this_value]['adjustment'];
// $operand = $product_attributes[$this_key]['values'][$this_value]['operand'];
//
// $value_notax = $GLOBALS['CURRENCY']->convert( $modifier, $product_currency );
// if( abs($value_notax) >0 ) {
// $value_taxed = $value_notax * ($my_taxrate+1);
// $temp_desc_new  = str_replace( $operand.$modifier, $operand.' '.$CURRENCY_DISPLAY->getFullValue( $value_taxed ), $temp_desc //  );
//                   
// $description = str_replace( $this_key.':'.$this_value,
// $this_key.':'.$this_value.' ('.$operand.' '.$CURRENCY_DISPLAY->getFullValue( $value_taxed ).')',
// $description);
//
// }
// $temp_desc = substr($temp_desc, $finish+1);
// }


}
       
$description = str_replace( $CURRENCY_DISPLAY->symbol, '@saved@', $description );
$description = str_replace( "[", " ", $description );
$description = str_replace( "]", "", $description );
$description = str_replace( ":", ": ", $description );
$description = str_replace( ";", "<br/>", $description );
$description = str_replace( '@saved@', $CURRENCY_DISPLAY->symbol, $description );



THe attribute modifier will not appear in carts, the description will!

Let me know if it works for you.
regards
A

Joomla 3.9.20
php 7.3

peeyush09

  • Beginner
  • *
  • Posts: 5
Hi,

I need more help in this page, i want to show attributes but not along with product name. i want to show in other td where only show product attributes.

Thanks in advance
Peeyush GUpta

pRemon

  • Beginner
  • *
  • Posts: 3
    • Nut Codes
Re: Hide the attribute price (keep the description) in carts and checkout etc
« Reply #19 on: September 02, 2011, 13:57:37 pm »
Remove attribute price from the cart

components\com_virtuemart\themes\default\templates\basket\basket_b2c.html.php

comment this line:
<td align="left"><?php echo $product['product_name'] . $product['product_attributes'] ?></td>

add these lines below:
 <?php $pieces=explode('(',$product['product_name'] .$product['product_attributes']); ?>
 <td align="left"><?php echo $pieces[0] ?></td>

My attribute is 'Stk 4 (=220.00)'
so this will remove '(=220.00)"
http://nutcodes.com - Joomla WordPress PHP JavaScript jQuery tutorials