Author Topic: How to add new fields from jos_vm_product table into the query for shop.browse  (Read 11432 times)

beachy

  • Jr. Member
  • **
  • Posts: 277
  • VirtueMart Version: 2.0.22
Hi Guys,

I have added two new fields to my jos_vm_product table. For ease I will call them field1 and field2. I have added them into the browse_vmshopblue.php so that they will show up when browsing category pages.

But because they arent included in the current query for the page they arent being shown. How to add them to the query?

I have dug through the forum and found this thread but it still doesnt seem to help me!
http://forum.virtuemart.net/index.php?topic=43627.msg139518#msg139518

Can anyone help me on this?

Thanks in advance!
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503
1. In shop_browse_queries.php, add your 2 fields to the line that start with:   $fieldnames =

2. In shop.browse.php, find this line:
     $product_s_desc = $db_browse->f("product_s_desc");
   Duplicate that line twice, and in the first line, replace product_s_desc TWICE with field1, and then in the second line, twice with field2

3. Still in shop.browse.php, find this line:
     $products[$i]['product_s_desc'] = $product_s_desc;
   Duplicate that line twice, and in the first line, replace product_s_desc TWICE with field1, and then in the second line, twice with field2

beachy

  • Jr. Member
  • **
  • Posts: 277
  • VirtueMart Version: 2.0.22
Thanks rb just giving it a go now! Well once I have created an offline copy of my site!

Is there a way to add new fields in the new product area in the backend of viurtuemart to line up with the new fields I have created in the database?
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

beachy

  • Jr. Member
  • **
  • Posts: 277
  • VirtueMart Version: 2.0.22
rb works great!

But as above

Quote
Is there a way to add new fields in the new product area in the backend of viurtuemart to line up with the new fields I have created in the database?

Thanks again!  ;D
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

defyinggravity

  • Beginner
  • *
  • Posts: 5
Is this what you are looking for Beachy?

http://forum.virtuemart.net/index.php?topic=59343.msg194702#msg194702

Please let me know if you get it all to work together...I am stuck with getting Allvideos Reloaded to display on my fly page. Easy if I add a product type with a parameter but that is just extra work, so I would like to simplyfy the process. With the steps in the link above I get it to create the field but it is not posting to the DB. Any ideas?

defyinggravity

  • Beginner
  • *
  • Posts: 5
Apologies, I made a blunder...the info from the link I posted works, so a combo of these instructions on this page and the one from the link I posted and Bob's your uncle...sure is going to save a huge amount of time!

beachy

  • Jr. Member
  • **
  • Posts: 277
  • VirtueMart Version: 2.0.22
Awesome! I was using phpmyadmin but it was becoming a little bit slow to say the least!

I will give it go!
_______
Joomla 2.5.11 Virtuemart 2.0.22
Apache 2.2.24 PHP 5.4.13
Hosted By RochenHost.com - MVS

mbit

  • Jr. Member
  • **
  • Posts: 323
i want to add a new image field , copy of availability. Any guide how to make that?

grimmari

  • Beginner
  • *
  • Posts: 27
Line missing
« Reply #8 on: September 04, 2010, 03:21:24 am »
HELP !!!!

Quote
2. In shop.browse.php, find this line:
   $product_s_desc = $db_browse->f("product_s_desc");
   Duplicate that line twice, and in the first line, replace product_s_desc TWICE with field1, and then in the second line, twice with field2

 


I can not find this "$product_s_desc = $db_browse->f("product_s_desc");"
I have Virtuemart 1.1.5 and Joomla is 1.5.20.

How I can go forvard

amitpatel1849

  • Beginner
  • *
  • Posts: 2
how can i show the filed at product listing page please tell me as soon as possible.

atranaz

  • Beginner
  • *
  • Posts: 12
thanks for guide line can you guide me how can i show my new field in productssnapshort.tpl.php  ???

thanks in Advance