Author Topic: Display child price range for parent product?  (Read 32686 times)

cameront21

  • Beginner
  • *
  • Posts: 22
Display child price range for parent product?
« on: May 17, 2010, 23:00:14 PM »
Is there any way to display the parent price as a range of lowest to highest of child product's prices?

Example: I have a parent product with 10 child products. Child products range in price from $1.00-$10.00. Rather than giving parent product a random price and hiding it on product flypage. Is there a way I could make the parent products price show $1.00-$10.00?

Thanks
Cameron

cameront21

  • Beginner
  • *
  • Posts: 22
Re: Display child price range for parent product?
« Reply #1 on: May 18, 2010, 17:06:49 PM »
Anybody?

tmate

  • Beginner
  • *
  • Posts: 3
Re: Display child price range for parent product?
« Reply #2 on: October 02, 2010, 16:54:31 PM »
I am also really interested about that. Is it possible? thanks..

Reincha

  • Jr. Member
  • **
  • Posts: 137
Re: Display child price range for parent product?
« Reply #3 on: February 07, 2011, 11:28:26 AM »
Hi!
i'm very interested in this feature
old topic, so maybe by now somebody have done it?
R.

mfrieder

  • Beginner
  • *
  • Posts: 1
Re: Display child price range for parent product?
« Reply #4 on: April 28, 2011, 05:03:29 AM »
I am also interested in this, it seems many other carts can do this but virtuemart cannot?

VM_Fans

  • Jr. Member
  • **
  • Posts: 251
Re: Display child price range for parent product?
« Reply #5 on: April 30, 2011, 14:28:19 PM »
Maybe we can recommend virtuemart team to add this feature in the next version.

webs4travel

  • Beginner
  • *
  • Posts: 33
Re: Display child price range for parent product?
« Reply #6 on: May 09, 2011, 20:41:30 PM »
Am also interested in this.  In the meantime, if I set the parent price to be the lowest of the child prices, I can't find the file to change product_price_lbl "Price:" to "Price From:"  on the browse page.  I realise this will aslo change the label on the product details page, but I'm not too worried about this as will just remove the price alltogether as it's displayed in the cart!  The other option I did think of was to add the to-from prices to the short description, but it's a bit of a pain when I change prices/discounts...

MrRiz

  • Beginner
  • *
  • Posts: 25
Re: Display child price range for parent product?
« Reply #7 on: May 11, 2011, 11:49:32 AM »
generally the labels are in /administrator/components/com_virtuemart/languages/common

might be PHPSHOP_PRODUCT_PRICE_TITLE.

Frank

atrus

  • Jr. Member
  • **
  • Posts: 128
    • Quality Tuning
  • VirtueMart Version: 3.8.6
Re: Display child price range for parent product?
« Reply #8 on: June 09, 2011, 18:03:57 PM »
Dear All,

pls find here our solution for this problem for www.quality-tuning.com. It calculates and updates the price of all parent products' price in the database using the minimum price of all children. You can do this in the administration - we have added a new button for this (see attached). This hack adds also the text "From:" near the price of all parent products in browse and product_details pages. We believe a similar solution or same should be included in the standard VM version.

1. New files (See attached)
administrator\components\com_virtuemart\html\product.product_minprice.php
administrator\components\com_virtuemart\class\ps_calminprice.php
components\com_virtuemart\themes\YOUR_TEMPLATE\templates\common\minprice.tpl.php

2. Changed files

2.1 administrator\components\com_virtuemart\ header.php
After line 317: Add:
<hr />
<li class="item-smenu vmicon vmicon-16-editadd">
<a href="<?php $sess->purl($_SERVER['PHP_SELF']."?pshop_mode=admin&page=product.product_minprice") ?>"><?php echo 'Calculate Min Price' ?></a>
</li>

2.2 administrator\components\com_virtuemart\ html\shop.browse.php
After line 31: Add:
require_once(CLASSPATH . 'ps_calminprice.php' );
$ps_calminprice = new ps_calminprice();
After line 443: Add:
$minpriceid = $ps_calminprice->getminprice($db_browse->f("product_id"));
      if($minpriceid!=''){
         $product_price = $ps_calminprice->show_price($minpriceid);
      }

2.3 administrator\components\com_virtuemart\ html\ shop.product_details.php
After line 418: Add:
require_once(CLASSPATH . 'ps_calminprice.php' );
$ps_calminprice = new ps_calminprice();
$minpriceid = $ps_calminprice->getminprice($product_id);
if($minpriceid!=''){
   $product_price = $ps_calminprice->show_price($minpriceid);
}

Regards,
Chris

mark R

  • Jr. Member
  • **
  • Posts: 220
Re: Display child price range for parent product?
« Reply #9 on: June 15, 2011, 13:52:13 PM »
Hi Chris,

This is a fantastic addition to VM but unfortunately the attachment is missing from this post.

Many thanks
mark
Seek and ye shall find.........
4 VM sites and counting

atrus

  • Jr. Member
  • **
  • Posts: 128
    • Quality Tuning
  • VirtueMart Version: 3.8.6
Re: Display child price range for parent product?
« Reply #10 on: June 27, 2011, 15:01:40 PM »
Hi again guys,

There was a problem with forum's attachments in general, pls see attached now ;)

Just a note to be clear: i cannot offer any support or guarantee for this, we paid a professional to fix this for our website and we are sharing it with you in case you think it is useful  8) some modifications for your website might be necessary (This is tested with VM 1.1.8 )

Regards,
Chris

[attachment cleanup by admin]

Ollie C.

  • Beginner
  • *
  • Posts: 2
Re: Display child price range for parent product?
« Reply #11 on: November 29, 2011, 23:34:58 PM »
Hi again guys,

There was a problem with forum's attachments in general, pls see attached now ;)

Just a note to be clear: i cannot offer any support or guarantee for this, we paid a professional to fix this for our website and we are sharing it with you in case you think it is useful  8) some modifications for your website might be necessary (This is tested with VM 1.1.8 )

Regards,
Chris

Thank you for this solution. I am also using 1.1.8 and just followed the instructions stated above, however the button in admin section doesnt show up.
Was "the new button in the administrative section" generated through phpMyadmin?


kry

  • Beginner
  • *
  • Posts: 3
Re: Display child price range for parent product?
« Reply #12 on: May 21, 2012, 08:25:56 AM »
Hello!
Has anyone realized at the decision by artus? It is very necessary...
When you click on the Calculate button displays the error:
Fatal error: Call to a member function bind() on a non-object in Z:\home\SITE\www\administrator\components\com_virtuemart\html\product.product_minprice.php on line 56

Really need your help!

Sorry for my English.



kry

  • Beginner
  • *
  • Posts: 3
Re: Display child price range for parent product?
« Reply #13 on: June 26, 2012, 09:20:28 AM »
Are there other ways to bring "Price From:" on the browse page??

oviliz

  • Beginner
  • *
  • Posts: 27
Re: Display child price range for parent product?
« Reply #14 on: June 18, 2014, 15:08:59 PM »
I know that's a old topic, but is not simple to find this specific problem on other threads.

Is there any way to make this work on VM 2 ?

Thanks.