Author Topic: Custom Fields - No Cart Attribute  (Read 4418 times)

IceMan-101

  • Beginner
  • *
  • Posts: 23
  • Master of Web disaster!
    • MyITManager
Custom Fields - No Cart Attribute
« on: February 29, 2012, 14:31:26 pm »
Hi All,

I am running the latest version of Virtuemart 2.0.2. I am stuck and can not get my Custom fields with no Cart Attribute to display in my product details page. My Custom Field with Cart Attribute display with no problems.

I would like to know am i doing something wrong?

Here is the code of my custom template I am using:

Code: [Select]
<?php // Product custom_fields
if (!empty($this->product->customfieldsCart)) {  ?>

<div class="product-fields">
<?php foreach ($this->product->customfieldsCart as $field)
?>

<div class="product-field-type-<?php echo $field->field_type ?>">
<label class="product-fields-title" ><?php echo  JText::_($field->custom_title?></label>
<?php echo $field->display ?>
</div>
<?php
}
?>

</div>
<?php }
/* Product custom Childs
* to display a simple link use $field->virtuemart_product_id as link to child product_id
* custom_value is relation value to child
*/

if (!empty($this->product->customsChilds)) {  ?>

<div class="product-fields">
<?php foreach ($this->product->customsChilds as $field) {  ?>
<div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field->field_type ?>">
<span class="product-fields-title" ><b><?php echo JText::_($field->field->custom_title?></b></span>
<span class="product-field-desc"><?php echo JText::_($field->field->custom_value?></span>
<span class="product-field-display"><?php echo $field->display ?></span>
</div>
<br />
<?php
?>

</div>
<?php ?>


Here is an image of the setting in the custom fields manager:


Any help or guidance would be appreciated.

Regards,
IceMan
Master of Web disaster!

teecookie

  • Beginner
  • *
  • Posts: 9
Re: Custom Fields - No Cart Attribute
« Reply #1 on: March 02, 2012, 20:23:15 pm »
I have found that if you unpublish first the custom field, then add to custom attribute in product, add your attribute EX. small med and large then publish it it will appear in a list

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10338
  • VirtueMart Version: 3+
Re: Custom Fields - No Cart Attribute
« Reply #2 on: March 02, 2012, 21:35:22 pm »
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

IceMan-101

  • Beginner
  • *
  • Posts: 23
  • Master of Web disaster!
    • MyITManager
Re: Custom Fields - No Cart Attribute
« Reply #3 on: March 06, 2012, 08:22:06 am »
Hi Guys,

Thanks for the feedback.

I have found that if you unpublish first the custom field, then add to custom attribute in product, add your attribute EX. small med and large then publish it it will appear in a list

I tried it and it is not working.

BanquetTables.pro, do you think if I create a custom layout position that it would resolve my problem?
Master of Web disaster!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10338
  • VirtueMart Version: 3+
Re: Custom Fields - No Cart Attribute
« Reply #4 on: March 06, 2012, 11:52:06 am »
put

ontop    in the position and it will show up
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

IceMan-101

  • Beginner
  • *
  • Posts: 23
  • Master of Web disaster!
    • MyITManager
Re: Custom Fields - No Cart Attribute
« Reply #5 on: March 06, 2012, 13:09:26 pm »
Hi BanquetTables.pro,

Thanks it worked and now it is showing up correctly.

For those that want to know what I did, her is the code:
Code: [Select]
if (!empty($this->product->customsChilds)) {  ?>
<div class="product-fields">
<?php foreach ($this->product->customsChilds as $field) {  ?>
<div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field->field_type ?>">
<span class="product-fields-title" ><b><?php echo JText::_($field->field->custom_title?></b></span>
<span class="product-field-desc"><?php echo JText::_($field->field->custom_value?></span>
<span class="product-field-display"><?php echo $field->display ?></span>
</div>
<br />
<?php
?>

</div>
<?php // Product Custom ontop begin?>
<?php if (!empty($this->product->customfieldsSorted['ontop'])) { ?>
   <div class="product-fields">
   <?php
   $custom_title 
null ;
   foreach (
$this->product->customfieldsSorted['ontop'] as $field){
  if ($field->display) {
 ?>
<div class="product-field product-field-type-<?php echo $field->field_type ?>">
<?php if ($field->custom_title != $custom_title) { ?>
<span class="product-fields-title" ><?php echo JText::_($field->custom_title); ?></span>
<?php if ($field->custom_tip) echo JHTML::tooltip($field->custom_tip,  JText::_($field->custom_title), 'tooltip.png');
 } ?>

<span class="product-field-display"><?php echo $field->display ?></span>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc?></span>
</div>
<?php
 $custom_title $field->custom_title;
  }
   } 
?>

   </div>
<?php // Product Custom ontop end ?>

Hope it helps, if you have any questions, please ask and I'll try to help where I can.

Regards,
IceMan
Master of Web disaster!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10338
  • VirtueMart Version: 3+
Re: Custom Fields - No Cart Attribute
« Reply #6 on: March 06, 2012, 14:19:03 pm »
iceman, there is a separate template for custom fields now.

So you can just echo the template
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

IceMan-101

  • Beginner
  • *
  • Posts: 23
  • Master of Web disaster!
    • MyITManager
Re: Custom Fields - No Cart Attribute
« Reply #7 on: March 08, 2012, 15:12:29 pm »
iceman, there is a separate template for custom fields now.

So you can just echo the template

BanquetTables.pro, where can I get this template or is part of Virtuemart 2.0.2?

I am making use of the GavickPro eSport template and it has a custom Virtuemart template. Could this be influencing the separate template for custom fields?
Master of Web disaster!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10338
  • VirtueMart Version: 3+
Re: Custom Fields - No Cart Attribute
« Reply #8 on: March 08, 2012, 16:44:56 pm »

BanquetTables.pro, where can I get this template or is part of Virtuemart 2.0.2?

I am making use of the GavickPro eSport template and it has a custom Virtuemart template. Could this be influencing the separate template for custom fields?

Yes its in vmart core.

productdetails/tmpl/HERE

http://forum.virtuemart.net/index.php?topic=98505.0



J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)