News:

Support the VirtueMart project and become a member

Main Menu

Add Manufacturer to cart

Started by gruvhip, August 07, 2012, 18:30:02 PM

Previous topic - Next topic

gruvhip

I would like to add the manufacturer to the cart on the line that shows the product

I have tried
<?php echo JHTML::link($prow->url, $prow->mf_name .$prow->product_name).$prow->customfields; ?> and get nothting
I tried
<?php echo JHTML::link($prow->url,$prow->virtuemart_manufacturer_id .$prow->product_name).$prow->customfields; ?> and it does show the ID #, so I tried

<?php echo JHTML::link($prow->url,$prow->virtuemart_manufacturer_name .$prow->product_name).$prow->customfields; ?> and get nothing.

I have tried many combinations to get the product Manufacturer name  on the default_pricelist.php to show but no luck. Any help would be greatly appreciated!
Thanks!


gruvhip

Does anyone know how to accomplish putting the manufacturer in the cart???

PRO

do you want the name?

Its not going to show wityhout some coding.

You can create a link to the manufacturer page easily.

The manufacturer id, is all thats in the array that I can see.


gruvhip

Thank you for your response.

The store is for cocktail mixers. So in many categories such as syrups there are a lot of different flavors and many flavors such as cherry are made by a variety of different manufacturers. If I put the manufacturer name in as a part of the product name, it won't sort them alphabetically properly or by product name.  So on the category and product page I made the manufacturer name and the product name look like one name but they are really two separate parts. That way the page will properly sort by product name and also sort by manufacturer correctly.

However, when it goes into the cart it just says cherry and does not say which brand or manufacturer of cherry syrup it is. Buyers will not know or remember which brand of cherry syrup they bought by the invoice.  So I want to have the cart also say, for example, brand A cherry  qty3 and  brand B cherry qty 2. Unless there is a better way to make this work, all I can think of is to have the manufacturer name also show in the cart. I think I understand you array point which is why I can only call up the ID# and not the name. I'm not sure how to get the manufacturer name to be included in the array so I can get it to show up on the cart. Can you point me in the right direction? I'm not the greatest coder.  If I can accomplish this then I would be set.  Thanks again for your help.

PRO

there is a way to , but I do not know the way to do it.


How many manufacturers are there?

If its not too many, you could loop through an if statement with the manufacturer ID, and match to the name.




gruvhip

I have no idea either.  There are about 30 or so total manufacturers. I would assume since it is calling the manufacture ID # that I would be able to call up the name.  Doing so worked great on the category and product page so confused as to why its not working on the cart page.  Basically a $this->product get mf_name. in PHP language. How would a do a loop as you mentioned. I can offer reasonable compensation for any assistance to a resolution here too. Thanks again

gruvhip

I put the statement below in for 2 manufacturers and it does work but I have more like 60 manufacturers. Is there a more efficient or elegant way to do this than doing 60 if statements?
<?php $name = "$prow->virtuemart_manufacturer_id";
               if( $name == "4")
               {echo "Zing Zang";
               }
               if( $name == "1")
               {echo "Monin";
               }
               ?>

PRO

yes there is, but I do not know it