Author Topic: Hide attribute prices  (Read 20835 times)

homer1976

  • Beginner
  • *
  • Posts: 2
Hide attribute prices
« on: August 24, 2008, 22:07:46 pm »
Hi!!

In my shop i would like to hide the price of the attributes. I have tried a method that appears in this forum, with attribute as these:

Size,XL<![+1.99]>,M,S<![-2.99]>;

When i add a product and i choose the attribute, the prices dissapear... That's OK. The problem is that in the checkout the total price doesn't add the price of the attributes that i put with that style. I'm using J_1.56 + VM_1.1.2 ¿any idea?
Thanks

Lee Wilson

  • Jr. Member
  • **
  • Posts: 82
Re: Hide attribute prices
« Reply #1 on: October 15, 2008, 03:25:17 am »
My attribute prices also disappear when I add them.

Any joy on this ?

Coucerbaum

  • Beginner
  • *
  • Posts: 6
Re: Hide attribute prices
« Reply #2 on: October 15, 2008, 11:38:56 am »
Hi Peoples...
i have the same problem, this is no possibility to hide the prices...
i searched so long for solution - where are the cracks???  ;D
greetz, coucie

dabempire

  • Beginner
  • *
  • Posts: 7
Re: Hide attribute prices
« Reply #3 on: October 15, 2008, 23:20:43 pm »
I looked for a full day to find these stupid little lines of code.  I hope it helps you guys so you don't have to go through what I did.  ;)

To remove it from your checkout page go to administrator/components/com_virtuemart/html/basket.php

Change line 81 from:

Code: [Select]
. $ps_product->getDescriptionWithTax( $_SESSION['cart'][$i]["description"], $_SESSION['cart'][$i]["product_id"] );
to:

Code: [Select]
. $ps_product->getDescriptionWithTax( $_SESSION['cart'][$i]["description"]);
To remove it from you product description pages go to /components/com_virtuemart/themes/default/templates/common/minicart.tpl.php.

Change line 23 from:

Code: [Select]
<?php echo $cart['quantity'?>&nbsp;x&nbsp;<a href="<?php echo $cart['url'?>"><?php echo $cart['product_name'?></a>
to:

Code: [Select]
<!--<?php echo $cart['quantity'?>&nbsp;x&nbsp;--><a href="<?php echo $cart['url'?>"><?php echo $cart['product_name'?></a>
Hope that helps.

dabempire

  • Beginner
  • *
  • Posts: 7
Re: Hide attribute prices
« Reply #4 on: October 16, 2008, 00:23:48 am »
Woot!  I finally found the last location too.  How to remove the attributes from the miniCart module.

Find line 91 in administrator/components/com_virtuemart//html/shop.basket_short.phpand change it from:

Code: [Select]
$html = str_replace("_"," ",$ps_product->getDescriptionWithTax( $_SESSION['cart'][$i]["description"], $_SESSION['cart'][$i]["product_id"] ))." ";
to:

Code: [Select]
$html = str_replace("_"," ",$ps_product->getDescriptionWithTax( $_SESSION['cart'][$i]["description"] ))." ";
// Line above used to read:
// $html = str_replace("_"," ",$ps_product->getDescriptionWithTax( $_SESSION['cart'][$i]["description"], $_SESSION['cart'][$i]["product_id"] ))." ";
// Line was changed to remove attributes from miniCart

dabempire

  • Beginner
  • *
  • Posts: 7
Re: Hide attribute prices
« Reply #5 on: October 16, 2008, 12:48:43 pm »
To remove it from the confirmation email:

components/com_virtuemart/themes/default/templates/order_emails/confirmation_email.tpl.php near line 184

Change:

Code: [Select]
<td><?php $dboi->p("product_name")?> <?php echo ($dboi->f("product_attribute") ? ' ('.$dboi->f("product_attribute").')' ''); ?></td>
to:

Code: [Select]
<td><?php $dboi->p("product_name")?> <!--<?php echo ($dboi->f("product_attribute") ? ' ('.$dboi->f("product_attribute").')' ''); ?>--></td>

dabempire

  • Beginner
  • *
  • Posts: 7
Re: Hide attribute prices
« Reply #6 on: October 16, 2008, 13:10:51 pm »
To hide it in the order details, line 301 in administrator/components/com_virtuemart/classes/ps_checkout.php:

change:

Code: [Select]
echo " <div style=\"font-size:smaller;\">" . $dbcart->f("product_attribute") . "</div>";
to:

Code: [Select]
//echo " <div style=\"font-size:smaller;\">" . $dbcart->f("product_attribute") . "</div>";

Coucerbaum

  • Beginner
  • *
  • Posts: 6
Re: Hide attribute prices
« Reply #7 on: October 20, 2008, 13:58:05 pm »
dear dabempire,

at first, thank you so much for your spended time and your solutions, you offered... so cool, thx...  :)
i checked out your solution for hiding the prices of the product describtion pages... ther was no result...
i think, i didn't explained my problem very well.

i use the attribute hack by barnett: http://forum.virtuemart.net/index.php?topic=39666.0
so i created a special individual attribut list like:
Code: [Select]
Brunnenauswahl(radio)(Bitte wählen Sie den gewünschten Brunnen mit einem Klick vor die Artikelnummer aus!|title-hover)(293A* [=1075.630]);
Optionales Zubehör(checkbox)(Zum Bestellen der einzelnen Zubehörteile setzen Sie bitte vor den/die gewünschten Artikel einen Haken!|title-hover)(LED-Beleuchtung & Auslauf [+82.3529],Funkfernsteuerung Ein/Aus [+40.3361])
it looks like:
http://www.terracotta-blumentopf.de/index.php?page=shop.product_details&product_id=23&flypage=flypage.tpl&pop=0&option=com_virtuemart&Itemid=1

so, and i want to hide only the prices from these attributes - the prices including the brackets...

now i want only to hide the prices of the attributes, not the attributes themselve... its very hard to find the location, where the prices and the brackets are included or converted in the quantity box...  ???

greetz, coucerbaum

dabempire

  • Beginner
  • *
  • Posts: 7
Re: Hide attribute prices
« Reply #8 on: October 29, 2008, 11:40:32 am »
Hi Coucerbaum.  I am not sure how to do that.  I am not a programmer.  I have just been going through the files to remove attribute prices that show in the brackets like (+xx.xx).

I found another.  To remove it from the final order confirmation page before submitting your order you can change file around line 75 in administrator/components/com_virtuemart/html/ro_basket.php

Code: [Select]
[code]. $ps_product->getDescriptionWithTax( $_SESSION['cart'][$i]["description"]);
to:

Code: [Select]
. $ps_product->getDescriptionWithTax( $_SESSION['cart'][$i]["description"]);
// line above used to read:
//. $ps_product->getDescriptionWithTax( $_SESSION['cart'][$i]["description"], $_SESSION['cart'][$i]["product_id"] );
[/code]

djie

  • Beginner
  • *
  • Posts: 12
Re: Hide attribute prices
« Reply #9 on: November 11, 2008, 00:23:56 am »
Thanks for the help i got the attributes removed from the checkout page and the minicart. But not from the product details page! Anyone has succeeded in getting the product attributes removed from the product details page?

revive

  • Jr. Member
  • **
  • Posts: 96
Re: Hide attribute prices
« Reply #10 on: January 22, 2009, 15:54:12 pm »
Hello,

@djie - I'm not sure if you are trying to remove the attribute pricing from a drop down on the flypage, but if you are, here is the code:

go to:
components/com_virtuemart/themes/default/templates/product_details/includes
and open the addtocart_advanced_attribute.tpl.php file

approx line 12 or so, comment out this PIECE of the line of code:

Code: [Select]
(<?php echo $options_item['sign'].$options_item['display_price'?>)

So, what once looked like this:
Code: [Select]
  <option value="<?php echo $options_item['base_var'?>"><?php echo $options_item['base_value'?>
(<?php echo $options_item['sign'].$options_item['display_price'?>) </option>


Now looks like this:

Code: [Select]
  <option value="<?php echo $options_item['base_var'?>"><?php echo $options_item['base_value'?>

<!-- commented out line below to remove product attribute price adjustment from drop down menu on flypage
(<?php echo $options_item['sign'].$options_item['display_price'?>) --> </option>


Hope that helps ;)


*********

Ok, now I have a question for all the VM gurus out there.. where do I remove the attribute price from the Order details page??

I found that if I remove this code from about line 302 in the account.order_details.tpl.php file (in components/com_virtuemart/themes/default/templates/pages/):
Code: [Select]
echo " <div style=\"font-size:smaller;\">" . $dbcart->f("product_attribute") . "</div>";

it will remove both the attribute name and price (eg. 20oz. (+5.99) gets removed) when we only want to remove the price, so users can see the attribute they chose..

So, on the Order Details page, this:
Product Name
20oz (+5.99)

Turns to this:
Product Name
20oz

Any help is greatly appreciated!

Thanks again,
J

djie

  • Beginner
  • *
  • Posts: 12
Re: Hide attribute prices
« Reply #11 on: January 23, 2009, 09:07:57 am »
Thanks for your contribution revive but it does not seem to work, the attribute prizes are still there on the product details page. Btw I am using the default ;)

revive

  • Jr. Member
  • **
  • Posts: 96
Re: Hide attribute prices
« Reply #12 on: January 30, 2009, 15:08:54 pm »
Hmm.. not sure then. This worked for us and we're using the default as well.. be sure that you inserted the trailing --> to the comment tag as well.. other than that I'll see what I can dig up .. otherwise, try copying and pasting this over all the code in your components/com_virtuemart/themes/default/templates/product_details/includes/addtocart_advanced_attribute.tpl.php file:

Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 

foreach(
$attributes as $attribute) { 
    
?>

    <div class="vmAttribChildDetail" style="float: left;width:25%;text-align:right;margin:3px 0;">
        <label for="<?php echo $attribute['titlevar'?>_field"><?php echo $attribute['title'?></label>:
    </div>
    <div class="vmAttribChildDetail" style="float:left;width:55%;margin:3px 0;">
        <select class="inputboxattrib" id="<?php echo $attribute['titlevar'?>_field" name="<?php echo $attribute['titlevar'].$attribute['product_id'?>">
<?php foreach ( $attribute['options_list'] as $options_item ) : ?>
        <?php if( isset( $options_item['display_price']) ) : ?>
        <option value="<?php echo $options_item['base_var'?>"><?php echo $options_item['base_value'?>

<!-- commented out line below to remove product attribute price adjustment from drop down menu on flypage
(<?php echo $options_item['sign'].$options_item['display_price'?>) --> </option>

        <?php else : ?>
        <option value="<?php echo $options_item['base_var'?>"><?php echo $options_item['base_value'?></option>
        <?php endif; ?>
        <?php endforeach; ?>
        </select>
    </div>
    <br style="clear:both;" />
   
<?php 
?>


Coucerbaum

  • Beginner
  • *
  • Posts: 6
Re: Hide attribute prices
« Reply #13 on: May 19, 2009, 14:11:41 pm »
Hi Guys,

i followed your instructions - thx for this...
but the code in the "addtocart_advanced_attribute.tpl.php" dows not agree with your description...

my entry sounds:
Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 

foreach(
$attributes as $attribute) { 
    
?>

    <div class="vmAttribChildDetail" style="float: left;width:30%;text-align:right;margin:3px;">
        <label for="<?php echo $attribute['titlevar'?>_field"><?php echo $attribute['title'?></label>:
    </div>
    <div class="vmAttribChildDetail" style="float:left;width:60%;margin:3px;">
        <select class="inputboxattrib" id="<?php echo $attribute['titlevar'?>_field" name="<?php echo $attribute['titlevar'].$attribute['product_id'?>">
<?php foreach ( $attribute['options_list'] as $options_item ) : ?>
        <?php if( isset( $options_item['display_price']) ) : ?>
        <option value="<?php echo $options_item['base_var'?>"><?php echo $options_item['base_value'?> </option>

    <?php else : ?>
        <option value="<?php echo $options_item['base_var'?>"><?php echo $options_item['base_value'?></option>
        <?php endif; ?>
        <?php endforeach; ?>
        </select>
    </div>
    <br style="clear:both;" />
   
<?php 
?>


it looks still like that:
http://www.terracotta-blumentopf.de/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=34&category_id=6&keyword=281A&option=com_virtuemart&Itemid=1&vmcchk=1&Itemid=1

there is no possibility for comment your described line:
Code: [Select]
<?php echo $options_item['sign'].$options_item['display_price'?>)
is there another possibility to (un)display these amount? it would be very nice... i cannot believe, that this isn't possible...  :-\

greetz, daniel

revive

  • Jr. Member
  • **
  • Posts: 96
Re: Hide attribute prices
« Reply #14 on: May 19, 2009, 16:35:35 pm »
What version VM are you using? If you are not using the current version I suggest you update your VM installation and try the solution above.. we have used it on many VM 1.1.3 installs with success.

If you are using VM 1.1.3, then it looks as if the portion of  addtocart_advanced_attribute.tpl.php that needed to be commented out has been deleted altogether.. which should remove that price from the page