News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Create new fields in administration area in virtuemart 2

Started by mdelreal, December 07, 2012, 17:28:13 PM

Previous topic - Next topic

mdelreal

Hi,

I created a new fields in the area of administration. I have added to the file:

/ www / administrator / components / com_virtuemart / views / product / tmpl / product_edit_dimensions.php because wanted in that tab. (I added also in the database)

In principle works well, appearing on the administrative side, but I've realized I'm missing something because the changes are not recorded in the database

Anyone know what I need?

Many thanks for your help

Cheers,
Manuel


bytelord

?? Did you try custom fields?
What are you trying to do?
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

mdelreal

Hello bytelord,

First of all thank you for the answer

No, I have not tried the custom fiels because i need a specific format and for me it¡s easier manage so the fields.

What I have done is to add the fields in the database and in the file / www / administrator / components / com_virtuemart / views / product / tmpl / product_edit_dimensions.php, and from the product page call those fields and it works great well, I can locate where I want. The problem is that when I change the administrator data are not stored in the database ... and I'm doing it directly in the database that I have linked via ODBC with Access

Surely I can in some file enlist these fields so that I run the stored procedure

thank you very much
Manuel

PRO

mdelreal,
it's best to use custom fields.

Every time you update it will delete them when you hack the core.

what are you trying to do?

You can do anything with a custom plugin

mdelreal

I know you use custom fields can be easier, but does not help, I need a particular format to display products. I mean an example of a product http://www.kairel.com/llaveros-de-metal/llavero-metal.html

I have many new fields and I have to arrange it on the web in a way, with both custom fiels I have no control over the design.

Another reason is that it is an online catalog, for example putting a price range is this version of VM is complicated.

thanks
Manuel

bytelord

Hello,

But you can control custom fields by creating new positions, place your where you want and style it as you wish with CSS by adding a div class or more...
http://forum.virtuemart.net/index.php?topic=111107.msg372786#msg372786
http://forum.virtuemart.net/index.php?topic=99225.0

So, use custom fields without cart variation ... or with :)

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

PRO

mdelreal,

You can do a lot with the position, and some styling.

Here is my default_customfields.php  I separate them by position



<?php foreach ($this->product->customfieldsSorted[$this->position] as $field) {
         if ($field->layout_pos == warranty) {
         echo $field->display;
         }
       }
       ?>
      
      <?php foreach ($this->product->customfieldsSorted[$this->position] as $field) {
         if ($field->layout_pos == discount10) {
         echo $field->display;
         }
       }
       ?>
      
Look at this position here
        <?php
       if (!empty($this->product->customfieldsSorted[$this->position])) {
if ($this->product->product_weight == 0){ $bwidth = "width49";}
else {$bwidth= "width90";}

       foreach ($this->product->customfieldsSorted[$this->position] as $field ) {
      if ($field->layout_pos == banners) {
          ?><div class="wrap"></div><div class="font15 left10 red shadow top10 center width90" id="saleBanner"><div class="<?php echo $bwidth ?>"><?php echo $field->display ?></div><?php if ($this->product->product_weight == 0) { ?>
                  <div class="width49"><?php echo JText::_('COM_VIRTUEMART_FREE_SHIP'); ?> <?php if ($this->product->min_order_level >1){ echo JText::_('COM_VIRTUEMART_FREE_SHIP_QUAN') .$this->product->min_order_level ;} ?></div><div class="wrap"></div>
               <?php    }?>   </div><div class="wrap"></div>
          <?php
      }
       } }
       ?>
      
if you notice, i use a totally different style for the position   banners

THEN: for example,   in productdetails/default.php

I use this for the a string field that's a single <li>   inside of a <ul>
<?php
if (!empty($this->product->customfieldsSorted['discount10'])) {
   $this->position='discount10';
   echo '<li class="redtext">';
   echo $this->loadTemplate('customfields');
   echo '</li>';}
?>

You can do just what you want to without hacking the core