VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Products, Prices, Tax and Categories VM 1.1 => Topic started by: qme1ster on August 28, 2010, 01:03:49 am

Title: Additional Product Fields
Post by: qme1ster on August 28, 2010, 01:03:49 am
Is it possible have additional product specifications ? So in the same way that we have available fields for length, height, width etc and can have these output in the product flypage ? I need to incorporate approximately 8 others product specs.

I think the solution might involve adding extra fields in the database and amending some VM core files but am not 100% sure. Any advice gratefully accepted :-)

Many thanks in advance.
Title: Re: Additional Product Fields
Post by: LeroanZ on August 28, 2010, 01:40:07 am
i want it too
Title: Re: Additional Product Fields
Post by: qme1ster on September 13, 2010, 17:27:36 pm
Hi can anyone help with this please. I'm sure it must be possible...

Thanks in advance.
Title: Re: Additional Product Fields
Post by: Vmart 4u on September 14, 2010, 17:17:42 pm
yes it is possible well i have not done this but it can be done through making change in (Product Dimensions and Weight)specific page you can jst create table like product_extra_fields having some fields you need and id of that particular product and then you can easily insert data ,and can retrieve it in flypage.tpl ,hope it will help you
Title: Re: Additional Product Fields
Post by: qme1ster on September 23, 2010, 13:22:36 pm
Thanks Vmart 4u for your response. Sorry I don't follow so well. Any chance you can provide clearer instructions, step by step please ? Or if anyone else can assist ?

Much appreciated.
Title: Re: Additional Product Fields
Post by: qme1ster on September 27, 2010, 21:58:46 pm
Can anyone please lend a hand ? Still need to add a few additional custom product fields.

(I have looked into product types but these aren't going to serve my purposes)

Many thanks in advance.

Q
Title: Re: Additional Product Fields
Post by: soupman on September 29, 2010, 19:19:17 pm
Any resolution to this problem?

I am in the same position - I added fields to the database and have coded them on the details page and they show up. You can see this by the link below:

http://tirepitcrew.com/index.php?page=shop.product_details&flypage=flypage-ask.tpl&product_id=5&category_id=1&option=com_virtuemart&Itemid=54&vmcchk=1&Itemid=54

But on this page the "browse" page the same data does not show up as you can see below:

http://tirepitcrew.com/index.php?page=shop.browse&category_id=1&option=com_virtuemart&Itemid=54

I am calling the same fields for both forms - What am I missing to make the data available in both the "browse" and "Details" page.

Title: Re: Additional Product Fields
Post by: qme1ster on September 30, 2010, 13:29:35 pm
Soupman, it's great the way you got those additional product specs onto the flypage. That's something I need to get sorted pronto.....Any chance you could talk me through step by step ?  I'd be very very grateful.

Thanks in advance

q
Title: Re: Additional Product Fields
Post by: soupman on September 30, 2010, 15:49:58 pm
qme1ster,

The only thing I did to get the product specs on the page was to add them to the database then call them in the template. This is the part that has me baffled, I did not have to modify any other code and they just showed up. Unless somewhere down the line I got lucky and changed something that enabled all of this to work.

Here is the actual code in /product_details/flypage-ask.tpl.php

<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__);
 ?>

<?php echo $buttons_header // The PDF, Email and Print buttons ?>

<?php
if( $this->get_cfg( 'showPathway' )) {
   echo "<div class=\"pathway\">$navigation_pathway</div>";
}
if( $this->get_cfg( 'product_navigation', 1 )) {
   if( !empty( $previous_product )) {
      echo '<a class="previous_page" href="'.$previous_product_url.'">'.shopMakeHtmlSafe($previous_product['product_name']).'</a>';
   }
   if( !empty( $next_product )) {      
      echo '<a class="next_page" href="'.$next_product_url.'">'.shopMakeHtmlSafe($next_product['product_name']).'</a>';
   }
}
?>
<p>&nbsp;</p>
<div class="container">
   <div class="container_head"><span class="headerbrand">&nbsp;<?php echo $b_brand ?>&nbsp;&nbsp;</span>&nbsp;
                        <span class="headerproduct"><?php echo $product_name; echo ' ' . $edit_link; ?></span>
                                <span class="headertype"><?php echo $product_s_desc ?></span></div>
      
      <div class="body_one"><?php echo $product_image ?>
      </div>
      <div class="body_two"><p class="display8"><strong>Size:</strong>&nbsp;<?php echo $b_size ?><br/>
                              <strong>Sidewall Style:</strong>&nbsp;<?php echo $b_sidewallstyling ?><br/>
                              <strong>Service Description:</strong>&nbsp;<?php echo $b_service_desc ?><br/>
                            <strong>Load Range:</strong>&nbsp;<?php echo $b_loadrange ?><br/>
                            <strong>UTQG:</strong>&nbsp;<?php echo $b_UTQG ?></p>
                      
                               
        </div>
      <div class="body_three"><p class="display8"><strong>Price:</strong> <span class="display2"><?php echo $product_price ?></span><span class="display4">(each)</span><br/>
                           <strong>Availability:</strong>&nbsp;In stock<br/>
                          <strong>Manufacture:</strong><span class="display4">&nbsp;<?php echo $manufacturer_link ?></span><br/>
                           <strong>Type:</strong>&nbsp;<?php echo $b_category ?><br/>
                        <strong>Warranty:</strong>&nbsp;<?php echo $b_warranty ?></p>
        </div>
      <div class="body_four"><p>&nbsp;</p><p>&nbsp;</p>
                        <p class="display8"><strong>Quantity</strong></p>
                        <p>&nbsp;</p><p>&nbsp;</p>
       </div>
      <div class="body_five"><p>&nbsp;</p><p>&nbsp;</p>
                        <p class="display8"><strong>PURCHASE BOX</strong></p>
                        <p>&nbsp;</p><p>&nbsp;</p>
      </div>
      


       
      <div class="footer_one"><p class="display8"><strong>Spacer1</strong> </div>
      <div class="footer_two"><p class="display8"><strong>Additional Information</strong>
                              <br/>Product Description | Specifications | Warranty
      </div>
      <div class="footer_three"><p class="display8"><strong>Spacer2</strong> </div>

</div>

<p>&nbsp;</p>


<p><?php echo $product_reviewform ?></p>
<p><?php echo $addtocart ?></p>
<p><?php echo $ask_seller ?></p>
<p><?php echo $product_reviewform ?></p>


<br style="clear:both;" />


<table border="2" align="center" style="width: 100%;" >
           


   
   <tr>
       <td rowspan="1" colspan="2">
            <hr style="width: 100%; height: 0 px;" />
            <strong><?php echo $b_brand ?></strong><br/><?php echo $product_description ?>
           <br/><span style="font-style: italic;"><?php echo $file_list ?></span>
        </td>
   </tr>
   <tr>
       <td colspan="2">
      
       <?php  echo $related_products ?>
       <br />
       </td>
   </tr>
    <tr>
       <td colspan="2">
        <div style="text-align: center;">
                </div>
                <?php echo $navigation_childlist ?><br /></td>
   </tr>
   
   
  <tr>
    
   </tr>
</table><br style="clear:both"/>
<div class="back_button"><a href='javascript:history.go(-1)'> <?php echo $VM_LANG->_('BACK') ?></a></div>



And this is were it gets screwed up because on the Admin side it tells me the flypage ="flypage" and nothing I change on "flypage" has any effect on the display. By process of elimination I found that any changes on "flypage-ask.tpl.php " directly impacted the display. Also the admin panel tells me I am using flypage="browser_1" but I have deleted all of the browse pages except "browse_3" again process of elimination.

PM or send a reply if you have more question. There is just something I am missing or not getting with these templates -ie flypages
Title: Re: Additional Product Fields
Post by: qme1ster on September 30, 2010, 16:58:07 pm
Hi soupman,

Thanks for getting back to me with this info. Is there a particular table into which to add the new additional product fields ? Could you talk me through the database part by any chance ?

In regards to your flypages- it doesnt seem possible that the new information can show up if it's not in the flypage/browsepage that has been allocated - have you double checked what flypage and browsepages have been set for each category just to make sure ? These override the settings in admin panel.

Title: Re: Additional Product Fields
Post by: soupman on September 30, 2010, 19:25:28 pm
qme1ster,

Thanks - never looked at the category page and there it is "browse_3" and "flypage-ask" PLAIN AS THE NOSE ON MY FACE - Duh

PM me with a number and I'll walk you through the DB if the follwing does not help;

open up phpAdmin
In the tables column choose ->vm_products
Select - Structure (tabs on top)
on the bottom of the page you will see an input box with a "1" which is how many fields to add to the table -> on the right is a drop down that you can select to insert the new fields within the table.

That's it - define the fields and save

example from above is "b_brand" which is in the DB and to call it use

<?php echo $b_brand ?>

As I said earlier though I followed the instructions in the documentation and I can only get it to appear on the "flypage-ask" and not on the "browse_3 page" and that is where I need help.
Title: Re: Additional Product Fields
Post by: qme1ster on September 30, 2010, 21:17:08 pm
Thanks soupman for the further explanation. I now follow how to setup the additional fields in the database, however how does one get these fields to appear in VM admin, to  be able to populate with data ? Default tab "Product dimensions & weight" - ideally I'd like to see the additional fields appearing in this same format. Did you manage to get this part done ?
Title: Re: Additional Product Fields
Post by: soupman on September 30, 2010, 21:54:40 pm
Yes,

/administrator/components/com_virtuemart/languages/product/english.php

This is the label for the page
'PHPSHOP_PRODUCT_FORM_ITEM_DETAILS_TIRE_LBL' => 'Tire Information',

You can add as many fields as you would like
'PHPSHOP_PRODUCT_FORM_BRAND' => 'Brand',
'PHPSHOP_PRODUCT_FORM_B_SIZE' => 'Tire Size',
'PHPSHOP_PRODUCT_FORM_B_WIDTH' => 'Tire Width',
'PHPSHOP_PRODUCT_FORM_B_RATIO' => 'Sidewall Ratio',
'PHPSHOP_PRODUCT_FORM_B_COMPOSITION' => 'Composition',
'PHPSHOP_PRODUCT_FORM_B_DIAMETER' => 'Diameter',
'PHPSHOP_PRODUCT_FORM_B_SERVICE_DESC' => 'Service Description',
'PHPSHOP_PRODUCT_FORM_B_LOADRANGE' => 'Load Range',
'PHPSHOP_PRODUCT_FORM_B_UTQG' => 'UTQG',


To add it to the admin interface:

administrator/components/com_virtuemart/html/product.product_form.php

This is adding a new TAB

$tabs->startTab( $tire_label, "tire-page");

?>
<h2><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ITEM_DETAILS_TIRE_LBL') ?></h2>

<table class="adminform">
    <tr class="row1">
      <td width="21%" valign="top" >
        <div style="text-align:right;font-weight:bold;"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_BRAND') ?>:</div>
      </td>
      <td width="79%" >
        <input type="text" class="inputbox"  name="b_brand" value="<?php $db->sp("b_brand"); ?>" size="15" maxlength="15" />
      </td>
    </tr>
    <tr class="row0">
      <td width="21%" valign="top" >
        <div style="text-align:right;font-weight:bold;"><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_B_DESCRIPTION') ?>:</div>
      </td>
      <td width="79%" >
        <input type="text" class="inputbox"  name="b_description" value="<?php $db->sp("b_description"); ?>" size="15" maxlength="15" />
      </td>
    </tr>

</table>
<?php
$tabs->endTab();

There is more work to do as you have to ADD the fields to the DB queries in order to store or retrieve any of the information. There are different queries depending on the function you will be doing.


FILE: administrator/components/com_virtuemart/classes/ps_product.php


To add data - > ADD around line 250

// Insert into DB
      $fields = array ( 'vendor_id' => $vendor_id,
            'product_parent_id' => vmRequest::getInt('product_parent_id'),
            'product_sku' => vmGet($d,'product_sku'),
            'product_name' => vmGet($d,'product_name'),
            'product_desc' => vmRequest::getVar('product_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
            'b_brand' => vmGet($d,'b_brand'),

and so on..... for all the fields you need to ADD

Do the same around line 447 which updates the data in the database

Should look something like this:

   /**
    * Function to update product $d['product_id'] in the product table
    *
    * @param array $d The input vars
    * @return boolean True, when the product was updated, false when not
    */
   function update( &$d ) {
      global $vmLogger, $perm, $VM_LANG;
      require_once(CLASSPATH.'ps_product_attribute.php');
      
      if (!$this->validate($d)) {
         return false;
      }

      if (!vmImageTools::process_images($d)) {
         return false;
      }

      $timestamp = time();
      $db = new ps_DB;
      $ps_vendor_id = $_SESSION["ps_vendor_id"];
      if( $perm->check( 'admin' )) {
         $vendor_id = $d['vendor_id'];
      }
      else {
         $vendor_id = $ps_vendor_id;
      }
      $old_vendor_id = $this->get_field($d['product_id'], 'vendor_id');
      
        // Insert into DB
      $fields = array ( 'vendor_id' => $vendor_id,
                  'product_sku' => vmGet($d,'product_sku'),
                  'b_brand' => vmGet($d,'b_brand'),
                  'product_desc' => vmRequest::getVar('product_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
                  'product_s_desc' => vmRequest::getVar('product_s_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
                  'product_thumb_image' => vmGet($d,'product_thumb_image'),

There you go you can now add or edit from the ADMIN Panel
Title: Re: Additional Product Fields
Post by: soupman on September 30, 2010, 21:59:22 pm
Now can some one tell me how top get it on the TEMPLATE to DISPLAY or is it too simple to explain..
Title: Re: Additional Product Fields
Post by: qme1ster on September 30, 2010, 22:49:49 pm
Thanks soupman, I really really appreciate you taking the time to provide that info. I'm going to give that a go in the morning as I'm calling it a day here. Please paste your browsepage code here and I'll take a look at your template issue for you in the morning.
Title: Re: Additional Product Fields
Post by: soupman on October 01, 2010, 05:42:54 am
Thanks for jogging my brain today on your issues qme1ster for it made me think!

And yes from what I can tell and what I have done I think it works. Now some of you may use the "product type" to add elements and it may work for most but I have on the order of 100 unique fields and that approach will not work long term.

Enough with my problems here is what I did to get the data to show up can't say it's all correct but it works and please add to this if there is something missing it helps everyone out or even to clarify.

We will work with 2 files

shop_browse_queries.php
shop.browse.php


1st we need to fetch the data from the database. (Logical)

You will find the info here:

/administrator/components/com_virtuemart/html/shop_browse_queries.php


About line 30 - 33 if no other mods done.

Here it is below:
----------------------------------------

/** Prepare the SQL Queries
*
*/
// These are the names of all fields we fetch data from
$fieldnames = "`product_name`,`products_per_row`,`category_browsepage`,`category_flypage`,`#__{vm}_category`.`category_id`,
            `#__{vm}_product`.`product_id`,`product_full_image`,`product_thumb_image`,`product_s_desc`,`product_parent_id`,`product_publish`,
`product_in_stock`,`b_brand`,`b_size`,  -and so on

--------------------------------------------

There, now we fetchd the data that we previously stored in the DB


It gets even easier - 2 steps in this file

Now go to ->    /administrator/components/com_virtuemart/html/shop.browse.php

STEP 1

About line 100 and add in your fields that you fetched "b_brand" and cast them "$b_brand" as below

 
      
/**
       * CATEGORY DESCRIPTION
       */
      $browsepage_lbl = $category_name;
      $tpl->set( 'browsepage_lbl', $browsepage_lbl );

      $tpl->set( 'desc', $desc );
         $tpl->set( 'b_brand', $b_brand );
         $tpl->set( 'b_size', $b_size );
         $tpl->set( 'b_UTQG', $b_UTQG );


STEP 2

Bottom of page about 470

Fetch them for the $db_browse

      $products[$i]['product_url'] = $db_browse->f("product_url");
      $products[$i]['b_brand'] = $db_browse->f("b_brand" );
      $products[$i]['b_size'] = $db_browse->f("b_size" );




That's all - add them to your "browse" template and they should show up


Title: Re: Additional Product Fields
Post by: qme1ster on October 01, 2010, 14:58:52 pm
Hi soupman, I'm glad you sorted your issue !

Unfortunately my issues persist ! I've followed your instructions but am ending up with a parse error which I can't figure out.

When trying to access VM admin in Joomla backend I get the following:

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/mydomain/public_html/administrator/components/com_virtuemart/classes/ps_product.php on line 305

This line 305 is the start of the code additions I made. I added the following in the code block as per your instructions:

Code: [Select]
// Insert into DB
        $fields = array ( 'vendor_id' => $vendor_id,
                        'product_parent_id' => vmRequest::getInt('product_parent_id'),
                        'product_sku' => vmGet($d,'product_sku'),
                        'product_name' => vmGet($d,'product_name'),
                        'product_desc' => vmRequest::getVar('product_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
                        'product_s_desc' => vmRequest::getVar('product_s_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
                        'product_thumb_image' => vmGet($d,'product_thumb_image'),
                        'product_full_image' => vmGet($d,'product_full_image'),
                        'product_publish' => $d['product_publish'],
                        'product_weight' => vmRequest::getFloat('product_weight'),
                        'product_weight_uom' => vmGet($d,'product_weight_uom'),
                        'product_length' => vmRequest::getFloat('product_length'),
                        'product_width' => vmRequest::getFloat('product_width'),
                        'product_height' => vmRequest::getFloat('product_height'),
                        'product_lwh_uom' => vmGet($d,'product_lwh_uom'),
                        'product_unit' => vmGet($d,'product_unit'),
                        'product_packaging' => (($d["product_box"] << 16) | ($d["product_packaging"]&0xFFFF)),
                        'product_url' => vmGet($d,'product_url'),
                        'product_in_stock' => vmRequest::getInt('product_in_stock'),
                        'attribute' => ps_product_attribute::formatAttributeX(),
                        'custom_attribute' => vmGet($d,'product_custom_attribute'),
                        'product_available_date' => $d['product_available_date_timestamp'],
                        'product_availability' => vmGet($d,'product_availability'),
                        'product_special' => $d['product_special'],
                        'child_options' => $d['child_options'],
                        'quantity_options' => $d['quantity_options'],
                        'product_discount_id' => vmRequest::getInt('product_discount_id'),
                        'cdate' => $timestamp,
                        'mdate' => $timestamp,
                        'product_tax_id' => vmRequest::getInt('product_tax_id'),
                        'child_option_ids' => vmGet($d,'included_product_id'),
                        'product_order_levels' => $d['order_levels'] );
                        'extra_diameter' => vmGet($d,'extra_diameter'),
                         'extra_colour' => vmGet($d,'extra_colour');
                        'extra_material' => vmGet($d,'extra_material');
                        'extra_lightbulb_type' => vmGet($d,'extra_lightbulb_type');
                        'extra_lightbulb_incl' => vmGet($d,'extra_lightbulb_incl');
                        'extra_dimmer' => vmGet($d,'extra_dimmer');
                        'extra_cordlength' => vmGet($d,'extra_cordlength');
                        'extra_ipnumber' => vmGet($d,'extra_ipnumber');

The last 8 items are my additions. I had followed your instructions here:
Quote
To add data - > ADD around line 250

// Insert into DB
      $fields = array ( 'vendor_id' => $vendor_id,
            'product_parent_id' => vmRequest::getInt('product_parent_id'),
            'product_sku' => vmGet($d,'product_sku'),
            'product_name' => vmGet($d,'product_name'),
            'product_desc' => vmRequest::getVar('product_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
            'b_brand' => vmGet($d,'b_brand'),

and so on..... for all the fields you need to ADD

It's probably a very simple error I've made somewhere but in the first instance I'd thought I'd run this by you in case you can see straight away what the issue might be.

These are the fields are added in the database:

extra_diameter
extra_colour
extra_material
extra_lightbulb_type
extra_lightbulb_incl
extra_dimmer
extra_cordlength
extra_ipnumber

I'm just wondering, was I supposed to create variables for these somewhere ?

Thanks again

q
Title: Re: Additional Product Fields
Post by: soupman on October 01, 2010, 16:11:48 pm
qme1ster,

On a quick note I see this error you are using semicolons and commas

, and ; at the end of the line.
Title: Re: Additional Product Fields
Post by: qme1ster on October 01, 2010, 17:12:32 pm
Thanks soupman. Well spotted ! I've corrected that code block as follows and that is now working.

Code: [Select]
// Insert into DB
        $fields = array ( 'vendor_id' => $vendor_id,
                        'product_parent_id' => vmRequest::getInt('product_parent_id'),
                        'product_sku' => vmGet($d,'product_sku'),
                        'product_name' => vmGet($d,'product_name'),
                        'product_desc' => vmRequest::getVar('product_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
                        'product_s_desc' => vmRequest::getVar('product_s_desc', '', 'default', '', VMREQUEST_ALLOWHTML),
                        'product_thumb_image' => vmGet($d,'product_thumb_image'),
                        'product_full_image' => vmGet($d,'product_full_image'),
                        'product_publish' => $d['product_publish'],
                        'product_weight' => vmRequest::getFloat('product_weight'),
                        'product_weight_uom' => vmGet($d,'product_weight_uom'),
                        'product_length' => vmRequest::getFloat('product_length'),
                        'product_width' => vmRequest::getFloat('product_width'),
                        'product_height' => vmRequest::getFloat('product_height'),
                        'product_lwh_uom' => vmGet($d,'product_lwh_uom'),
                        'product_unit' => vmGet($d,'product_unit'),
                        'product_packaging' => (($d["product_box"] << 16) | ($d["product_packaging"]&0xFFFF)),
                        'product_url' => vmGet($d,'product_url'),
                        'product_in_stock' => vmRequest::getInt('product_in_stock'),
                        'attribute' => ps_product_attribute::formatAttributeX(),
                        'custom_attribute' => vmGet($d,'product_custom_attribute'),
                        'product_available_date' => $d['product_available_date_timestamp'],
                        'product_availability' => vmGet($d,'product_availability'),
                        'product_special' => $d['product_special'],
                        'child_options' => $d['child_options'],
                        'quantity_options' => $d['quantity_options'],
                        'product_discount_id' => vmRequest::getInt('product_discount_id'),
                        'cdate' => $timestamp,
                        'mdate' => $timestamp,
                        'product_tax_id' => vmRequest::getInt('product_tax_id'),
                        'child_option_ids' => vmGet($d,'included_product_id'),
                        'product_order_levels' => $d['order_levels'],
                        'extra_diameter' => vmGet($d,'extra_diameter'),
                         'extra_colour' => vmGet($d,'extra_colour'),
                        'extra_material' => vmGet($d,'extra_material'),
                        'extra_lightbulb_type' => vmGet($d,'extra_lightbulb_type'),
                        'extra_lightbulb_incl' => vmGet($d,'extra_lightbulb_incl'),
                        'extra_dimmer' => vmGet($d,'extra_dimmer'),
                        'extra_cordlength' => vmGet($d,'extra_cordlength'),
                        'extra_ipnumber' => vmGet($d,'extra_ipnumber') );

Commas after adding the call for each new field, and ending with a closing bracket and a semi colon.

I can see my new product fields in a new tab in VM admin, and have tested that new data is saved to the database. Thank you SO SO MUCH !

One small issue - the tab name is not being output for some reason. In product.product_form I did start the new tab code block as follows:

Code: [Select]
<?php
$tabs
->endTab();

$tabs->startTab$specs_label"specs-page");

?>

<h2><?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ITEM_ADD_SPECS_LBL'?></h2>

 I also added PHPSHOP_PRODUCT_FORM_ITEM_ADD_SPECS_LBL to the ...languages/product/english.php file as follows:

Code: [Select]
'PHPSHOP_PRODUCT_FORM_ITEM_ADD_SPECS_LBL' => 'Additional Product Information'
So  not sure why that's not being output. Again probably something really simple that I've overlooked !

Thanks again.

q
Title: Re: Additional Product Fields
Post by: soupman on October 01, 2010, 17:37:27 pm
qme1ster,

Try outputing the entry from the language.php file anywhere on a page to see if it is reading correctly. The way I read your statement the page name should show up under the tab as a page heading.

<?php echo $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ITEM_ADD_SPECS_LBL') ?>
Title: Re: Additional Product Fields
Post by: qme1ster on October 01, 2010, 18:22:30 pm
Hi soupman,

I think I see what the problem might be. I am getting the heading output at the top of the page, above my new product fields, as it's supposed to. The tab itself though does not have a title, and I've just resolved that - I had omitted to define that label variable.

I had started the code block for the creation of the new tab with:

Code: [Select]
$tabs->startTab( $specs_label, "specs-page");
I needed to define $specs_label, which I did as follows:-

Code: [Select]
$specs_label = $VM_LANG->_('PHPSHOP_PRODUCT_FORM_ITEM_ADD_SPECS_LBL');
I placed this code in 2 places - line 80 and line 100.

I now have a tab title !

Thanks again !!

Title: Re: Additional Product Fields
Post by: edthenet on November 08, 2010, 14:23:21 pm
The problem with core changes is that you can't update to a newer version of Virtuemart. You loose the changes.