knitting

Author Topic: add product types into browse pages??  (Read 15036 times)

neo64

  • Beginner
  • *
  • Posts: 4
add product types into browse pages??
« on: April 30, 2008, 04:47:48 AM »
I´m trying insert product types into browse category page, but I get an error Undefined variable. What code I need to solve this?

Thank you

kornolio

  • Beginner
  • *
  • Posts: 2
    • izdelava spletnih strani
Re: add product types into browse pages??
« Reply #1 on: July 17, 2008, 05:54:43 AM »
Hello!
Did you maybe get to the bottom of this problem?
I am in the same situation and would really like if I could finally get beyond this  point.
And another thing while we are at it :) How do I make a product type default for all new products...I mean that a product type is auto added to new products.

tnx

jonahcoyote

  • Beginner
  • *
  • Posts: 10
Re: add product types into browse pages??
« Reply #2 on: July 25, 2008, 20:23:07 PM »
I found this documentation (http://virtuemart.net/documentation/Developer_Manual/Modifying_the_Layout.html#Themes_and_Templates) on adding variables to a template, since the browse template doesn't have this by default.

I then tried to add this to line 388 of shop.browse.php:

Code: [Select]
$tpl->set( 'product_type', $db_browse->f('product_type') );
And this to line 32 of my browse_1.php template file (making sure this is the enabled browse template):

Code: [Select]
<?php echo $product_type ?>
...But nothing shows. Anyone else have an idea? This would be really nice to get working... Also, any idea on how to enable the display of product types on the cart page?

Much thanks,
Jonah
VM 1.1.0 & Joomla 1.5.3

belugha

  • Beginner
  • *
  • Posts: 8
Re: add product types into browse pages??
« Reply #3 on: July 31, 2008, 13:23:11 PM »
Hi,

I have the same problem, you're resolve ?

Thanks.

jonahcoyote

  • Beginner
  • *
  • Posts: 10
Re: add product types into browse pages??
« Reply #4 on: July 31, 2008, 13:25:42 PM »
No solution, sorry. It seems like there is not much help available on these forums unfortunately.
VM 1.1.0 & Joomla 1.5.3

belugha

  • Beginner
  • *
  • Posts: 8
Re: add product types into browse pages??
« Reply #5 on: July 31, 2008, 13:36:55 PM »
   
You must be patient, this is a great community Virtuemart :)

machabeus

  • Beginner
  • *
  • Posts: 12
    • Naturalne kosmetyki
Re: add product types into browse pages??
« Reply #6 on: September 28, 2008, 16:02:55 PM »
does somebody find the solution ? I know how to add manufacturer name, but it seems that for product type it may not work...

corinne80

  • Beginner
  • *
  • Posts: 5
Re: add product types into browse pages??
« Reply #7 on: October 01, 2008, 01:57:32 AM »
Well, I am asking this question in different topics but on all the topics related to this matter NOBODY is getting a answer. I am looking desperately for a hack or something but no luck yet...

machabeus

  • Beginner
  • *
  • Posts: 12
    • Naturalne kosmetyki
Re: add product types into browse pages??
« Reply #8 on: October 04, 2008, 12:21:42 PM »
http://forum.virtuemart.net/index.php?topic=40092.msg126306#msg126306

if it's possible to do it with manufacturer name, maybe there is a similar way to do it with product types.

flerd

  • Beginner
  • *
  • Posts: 20
Re: add product types into browse pages??
« Reply #9 on: May 13, 2009, 06:19:28 AM »
Hi all,

maybe it would be usefull for someone else too.

I've found out the solution  ;)

joomla 1.5.10
vm 1.1.3

so:

0. step
_backup_ every file!

file:
Code: [Select]
shop.browse.php
1. step:
after:
Code: [Select]
require_once(CLASSPATH . 'ps_product_attribute.php' );
$ps_product_attribute = new ps_product_attribute;
around line 32

add:
Code: [Select]
require_once(CLASSPATH . 'ps_product_type.php' );
$ps_product_type = new ps_product_type;

2. step:
after:
Code: [Select]
$product_s_desc = $db_browse->f("product_s_desc");
if( empty($product_s_desc) && $product_parent_id!=0 ) {
    $product_s_desc = $dbp->f("product_s_desc"); // Use product_s_desc from Parent Product
}
around line 400

add:
Code: [Select]
$flerd_product_id = $db_browse->f("product_id");
$product_type = $ps_product_type->list_product_type($flerd_product_id);

3. step:
than after:
Code: [Select]
$products[$i]['product_s_desc'] = $product_s_desc;around line 440

add:
Code: [Select]
$products[$i]['product_type'] = $product_type;
4. step:
file:
Code: [Select]
browser_2.php (or what browser page you use)

add anywhere you want to use
Code: [Select]
<?php echo $product_type ?>
i hope don't forget anything  ???  ::)

it works for me... i hope it will work for you too.

i'm not a php expert so the only thing i know for sure that it works for me, and it seems okay...

please check it and give me a feedback on the forum, just to know i've done a little good thing on earth  ;D

flerd

p.s.: i marked as SOLVED .. i hope it is ;)

UPDATE 1
livesite (only for testing)
http://bestautohaz.hu/_newsite/index.php?page=shop.browse&category_id=7&option=com_virtuemart&Itemid=89

check thisone too (just for fun)
http://bestautohaz.hu/_newsite/index.php?page=shop.product_details&flypage=bestauto_page&product_id=21&category_id=6&option=com_virtuemart&Itemid=90

esedic

  • Jr. Member
  • **
  • Posts: 60
    • Spletodrom.com
Re: add product types into browse pages??
« Reply #10 on: June 25, 2009, 15:35:32 PM »
flerd, how many product types do you have? Is it just one?
Because I have 4 product types and when I echo $product_type in browse page I get word "ARRAY" displayed instead of product type parameter. It's logical to me, but what code would I need to add to select certain product type?

Any help would be appreciated.

flerd

  • Beginner
  • *
  • Posts: 20
Re: add product types into browse pages??
« Reply #11 on: June 25, 2009, 16:31:10 PM »
hi esedic,

i had 2 product types, but on this page:
http://bestautohaz.hu/_newsite/index.php?page=shop.browse&category_id=7&option=com_virtuemart&Itemid=89
i had only one (both cars has the same product type), that was:
"Használt autók"

now i set one product to
"Használt autók" - (in english: used cars)
and the other to
"Szalonautó" - (in english: new cars)
and it works for me in this way too...

i don't know...
can you try with 2 product types? (if it won't work for you with 2 product types than the problem is somewhere else...)
can you post a link to your site?
what is your joomla and VM version?

i'm not a php expert but i try to help...

(i won't be online on the next few days, but i try to check the forum as soon as possible)

esedic

  • Jr. Member
  • **
  • Posts: 60
    • Spletodrom.com
Re: add product types into browse pages??
« Reply #12 on: June 28, 2009, 04:18:22 AM »
I forgot that I have implemented a modification from Mark Cullf (http://forum.virtuemart.net/index.php?topic=52796.0) which builds an array of all product types and breaks up the product types into individual placeable elements. So probably that's why the "ARRAY" word is displayed.

Can anybody provide some help on joining this two modifications?

Thanks!

bulesz

  • Jr. Member
  • **
  • Posts: 189
Re: add product types into browse pages??
« Reply #13 on: July 02, 2009, 16:32:41 PM »
showing the product parameters has made for the flypage, because of mysql issue...I mean I have tried this with a shop with 20 000 products, and the load speed was horror...:( so use instead some "rarely" used product data for example "product_width_uom" or something like that, that will boost the speed...with almost the same result.

Stefanos

  • Jr. Member
  • **
  • Posts: 93
Re: add product types into browse pages??
« Reply #14 on: November 01, 2009, 03:07:14 AM »
Great Solution, although I never liked editing core, but works for the browse page.

Any ideas about how to make it work on related products ? I am trying to add the product type in productsnapshot.tpl.php and it will not show..

any help appreciated

VirtueMart Forum

Re: add product types into browse pages??
« Reply #14 on: November 01, 2009, 03:07:14 AM »