Author Topic: Show parent product name in cart and checkout for child products  (Read 8940 times)

brentonking

  • Jr. Member
  • **
  • Posts: 74
    • Brenton King Graphic Design, Web Design and Joomla! Site Development
Show parent product name in cart and checkout for child products
« on: December 26, 2012, 02:53:27 am »
When I add a product, that has child products to the cart/checkout, it only shows the child product. I need to have it also show the parent product name in front of it.

For example:
The parent product is "tshirt"
The child products are "blue, red, yellow" (I need to have these as child products to track stock levels)

If I go to the tshirt item and select the blue custom field, then add to cart. I then go to view the cart and it shows the product name and custom field as "blue blue"
Obviously I need that to say tshirt blue

I know that the first blue = product name, second blue = custom field

I also know that this is the line to edit (/components/com_virtuemart/views/cart/tmpl/default_pricelist.php):
<?php echo JHTML::link ($prow->url, $prow->product_name) . $prow->customfields; ?>

Tried adding "product_parent->product_name" but no luck:
<?php echo JHTML::link ($prow->url, $prow->product_parent->product_name, $prow->product_name) . $prow->customfields; ?>

Might be more files to edit. Hoping someone can help!

brentonking

  • Jr. Member
  • **
  • Posts: 74
    • Brenton King Graphic Design, Web Design and Joomla! Site Development
Re: Show parent product name in cart and checkout for child products
« Reply #1 on: December 28, 2012, 00:13:07 am »
Desperately need to know this, if anyone can shed some light?

CenturionSigns

  • Beginner
  • *
  • Posts: 25
Re: Show parent product name in cart and checkout for child products
« Reply #2 on: January 04, 2013, 16:32:04 pm »
Bump!  I have been wrestling with this issue too, and can't find answers.

The obvious work around is to make the Child Product Name match the Parent Product Name BUT since it's the Product Name and not any attribute that shows in the drop down box on the product details page this workaround is useless.

So surely that means there are 2 solutions:

1. Display the parent product name in the cart for any child product
2. Allow the drop down selector in the Parent Product Details to be populated by a specific variation

(A 3rd, ideal option would be to simply allow pricing differences based on attributes including multiple options, but looks like we'd need to ditch VM and look at other solutions for that to happen.)

Angelus84

  • Beginner
  • *
  • Posts: 2
Re: Show parent product name in cart and checkout for child products
« Reply #3 on: January 17, 2013, 14:21:36 pm »
Can anyone help with this matter?

I would like to know this as well...

realistix

  • Beginner
  • *
  • Posts: 27
Re: Show parent product name in cart and checkout for child products
« Reply #4 on: February 13, 2013, 09:40:22 am »
It's been a month and a half since this was asked and still no reply, at least three people with the problem and now me also. This trend of leaving valid and relevant questions unanswered really needs to stop, Virtuemart. Please help the people who use your product or they will no longer do so.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10412
  • VirtueMart Version: 3+
Re: Show parent product name in cart and checkout for child products
« Reply #5 on: February 13, 2013, 13:04:54 pm »
Why is a product's name

Red.Blue or Green?


& not

Red Shirt, Green Shirt etc


I think maybe you should be using

"Stockable Cart Variant" instead of child products
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Show parent product name in cart and checkout for child products
« Reply #6 on: February 13, 2013, 13:26:41 pm »
It's been a month and a half since this was asked and still no reply, at least three people with the problem and now me also. This trend of leaving valid and relevant questions unanswered really needs to stop, Virtuemart. Please help the people who use your product or they will no longer do so.

First: Do we have any relationship? Did you payed virtuemart for anything?
Second: 3 people having a problem in a community with more than 100k people is nothing
Third: Please synchronise the vm2.0.14mp branch with the current trunk, please do it, answer me, say yes, feel responsible for it, otherwise I do not see, why I should be responsible for your personal problems.
4th: As already hinted with a fence, you have a special problem which appears by a misuse. In fact it has nothing todo with virtuemart, you create products with attribute names.
5th more answers like that? I think I should shut my fuck up and keep my ***obscenity removed*** mouth closed.
btw ***obscenity removed*** and furthermore ***obscenity removed***, I am really ***obscenity removed*** Why the people ***obscenity removed*** think ***obscenity removed*** ***obscenity removed******obscenity removed*** duty.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

realistix

  • Beginner
  • *
  • Posts: 27
Re: Show parent product name in cart and checkout for child products
« Reply #7 on: February 14, 2013, 18:23:47 pm »
It's been a month and a half since this was asked and still no reply, at least three people with the problem and now me also. This trend of leaving valid and relevant questions unanswered really needs to stop, Virtuemart. Please help the people who use your product or they will no longer do so.

First: Do we have any relationship? Did you payed virtuemart for anything?
Second: 3 people having a problem in a community with more than 100k people is nothing
Third: Please synchronise the vm2.0.14mp branch with the current trunk, please do it, answer me, say yes, feel responsible for it, otherwise I do not see, why I should be responsible for your personal problems.
4th: As already hinted with a fence, you have a special problem which appears by a misuse. In fact it has nothing todo with virtuemart, you create products with attribute names.
5th more answers like that? I think I should shut my fuck up and keep my ***obscenity removed*** mouth closed.
btw ***obscenity removed*** and furthermore ***obscenity removed***, I am really ***obscenity removed*** Why the people ***obscenity removed*** think ***obscenity removed*** ***obscenity removed******obscenity removed*** duty.


Very mature Milbo, very mature. I'm not even going to grace your individual 'replies' with responses. The "it's free so if it doesn't work for you then tough" attitude is one that doesn't rub in this day and age of open source and collaborative programming. You provide a product that is designed and expected to work in a professional environment so you should be prepared to back it up with support. Just because 3 people posted it doesn't mean there are many more who didn't add to the discussion having seen that there were no replies. I almost did the same.

On the flip side, thankyou ever so much PRO for providing a useful answer - I will certainly look into this. Perhaps the other lost souls who posted prior to me and others who perhaps didn't bother posting as they hadn't seen any replies will be able to put your answer to good use also. Unfortunately I already have a fully functioning shop with a fair few products and 5 or so children per product.  In my case I have a parent product - let's say White shirt. It comes in sizes  Small, Medium, Large, XL and XXL - each with different stock levels but same prices. Each child has been named White shirt - S, White Shirt - M, White shirt - L, White Shirt - XL, white shirt - XXL. No matter which one I add to the cart it always shows ( in the cart ) White shirt - XXL and then underneath it shows the option that was selected - for example White shirt - L.

There seem to be so many different ways of doinh 'stockable variants' each with their pros and cons so it's hard to work out which is best to use for the scenario in question. Any guidance would be greatly appreciated, thanks PRO.

CenturionSigns

  • Beginner
  • *
  • Posts: 25
Re: Show parent product name in cart and checkout for child products
« Reply #8 on: February 15, 2013, 09:46:58 am »
Wow.  Bad day Milbo?  I ended up paying someone hundreds of dollars to solve this problem, and the parent name now happily appears beside the child variant name in both product details page and the cart.   Fair enough - the product is free, we wanted something bespoke, so we paid for it.

I came back here though, to see how the VM team or community had responded... and this is what I read? 

Support for VM2 is like hens teeth- not just in the community but with paid developers. We inherited the system for our websites from the last web developers we used and it goes against the grain to make demands from OS developers, but the software is out there to be used and improved, right?

If your attitude is that we shouldn't expect the VM team to respond, then not responding would seem like the better option rather than issuing obscenities?   Or simply saying, Sorry, we don't have a solution for that right now.


Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2658
Re: Show parent product name in cart and checkout for child products
« Reply #9 on: February 16, 2013, 09:59:41 am »
First: Do we have any relationship? Did you payed virtuemart for anything?
Hah you guys both simply ignored Milbo's first statement. With such attitude be prepeared to be ignored in other cases in your lifes.

Really what relationship with VM team have forum member CenturionSigns and forum member Realistix?

Are they 3-d party developers? I can't see this in their forum profiles.

Are they active forum members? Nope. Both have only Beginner forum rank.

Well. Maybe they just two smart guys in webmastering world? I don't know. They don't show own cool personal pages/portfolios/social profiles in their forum signature.

Pardon me, but today Leader of VM Team have freedom, right and responsibility to make his way. Today he and members of his team decide themselves what is the meaning of the words "Open Source E-Commerce project". World global crisis anyone? Or maybe forum member CenturionSigns and forum member Realistix live on other planet?

Sophia23

  • Beginner
  • *
  • Posts: 13
Re: Show parent product name in cart and checkout for child products
« Reply #10 on: March 07, 2013, 18:32:56 pm »
First: Do we have any relationship? Did you payed virtuemart for anything?
Hah you guys both simply ignored Milbo's first statement. With such attitude be prepeared to be ignored in other cases in your lifes.

Really what relationship with VM team have forum member CenturionSigns and forum member Realistix?

Are they 3-d party developers? I can't see this in their forum profiles.

Are they active forum members? Nope. Both have only Beginner forum rank.

Well. Maybe they just two smart guys in webmastering world? I don't know. They don't show own cool personal pages/portfolios/social profiles in their forum signature.

Pardon me, but today Leader of VM Team have freedom, right and responsibility to make his way. Today he and members of his team decide themselves what is the meaning of the words "Open Source E-Commerce project". World global crisis anyone? Or maybe forum member CenturionSigns and forum member Realistix live on other planet?

Haven't read so much nonsense in bad English in a while.

Maxim Pishnyak

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2658
Re: Show parent product name in cart and checkout for child products
« Reply #11 on: March 08, 2013, 23:21:58 pm »
Trolling developers in good English has more sense then?

digger149

  • Beginner
  • *
  • Posts: 6
Re: Show parent product name in cart and checkout for child products
« Reply #12 on: March 28, 2013, 17:36:06 pm »
I'm not sure I really want to play here, I'm a bit worried about getting insulted !

Here is the answer, insert this where you want it in cart/default_pricelist.php (for example)

<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select(array('product_name'));
$query->from('#__virtuemart_products_en_gb');
$query->where('virtuemart_product_id="'.$prow->product_parent_id.'"');
$db->setQuery($query);
$parent_name = $db->loadResult();
echo $parent_name;
?>

It may not be the best or fastest way, but it works.......

vcourbiere

  • Beginner
  • *
  • Posts: 6
Re: Show parent product name in cart and checkout for child products
« Reply #13 on: February 11, 2014, 17:45:24 pm »
Hello everybody,

Following this topic which is quite old; as explained before, child product shows in cart, but if a child product is named "blue", only this word will be displayed in the cart, and not the parent product which would be the T-shirt.
The solution of digger149 works perfectly. However my site is a multi language one, therefore this solution displays well the parent product name in en-GB, but not in the other languages.

Digger149 solution to be applied to the cart/default_pricelist.php:

<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select(array('product_name'));
$query->from('#__virtuemart_products_en_gb');
$query->where('virtuemart_product_id="'.$prow->product_parent_id.'"');
$db->setQuery($query);
$parent_name = $db->loadResult();
echo $parent_name;
?>

Which modification should be done to this code in order to be work with a multi language site ?
Thanks a lot !

vcourbiere

  • Beginner
  • *
  • Posts: 6
Re: Show parent product name in cart and checkout for child products
« Reply #14 on: February 12, 2014, 21:23:40 pm »
Hello,

Please anybody that could answer that ?

I really need this sorted out !
Thank you so much !