Author Topic: NO MORE THEME. 2+ uses VIEWS (Layout Override)  (Read 183935 times)

Flasher

  • Beginner
  • *
  • Posts: 37
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #75 on: February 01, 2013, 03:35:26 am »
This treath help me put my custom field after the price! Thank you all for all the examples. Now i want it to add the same CSS Style that the Sales Price.

I was looking around but i don't see any CSS Style on the defaul.php of the product detail.

My Custom field code is

Code: [Select]
<?php // Custom Field Precio
 if (!empty($this->product->customfieldsSorted['precio'])) { $this->position='precio'; echo $this->loadTemplate('customfields');    }   ?>

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10321
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #76 on: February 01, 2013, 17:16:33 pm »
what?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Flasher

  • Beginner
  • *
  • Posts: 37
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #77 on: February 01, 2013, 20:08:38 pm »
Sorry PRO. My bad. I think i didn't explained my self well.

On my product detail i want to have the same CSS of the Sale Price (#1 on the Image) for my custom field (#2 on the Image)



[attachment cleanup by admin]

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10321
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #78 on: February 01, 2013, 20:35:47 pm »
Sorry PRO. My bad. I think i didn't explained my self well.

On my product detail i want to have the same CSS of the Sale Price (#1 on the Image) for my custom field (#2 on the Image)



If you only use 1 language: you can do it like this in default_customfields.php
(I THINK this should work like you want, I did not test it)
What is does is separate the styling differently for that custom field position.
change "myposition"  to YOUR position
defined ( '_JEXEC' ) or die ( 'Restricted access' );
?>
<div class="product-fields">
       <?php
       $custom_title = null;
       foreach ($this->product->customfieldsSorted[$this->position] as $field) {
       if ($field->layout_pos != myposition) {
          if ( $field->is_hidden ) //OSP http://forum.virtuemart.net/index.php?topic=99320.0
             continue;
         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;
         }
       }}
       ?>
      
       <?php
       if (!empty($this->product->customfieldsSorted[$this->position])) {
       foreach ($this->product->customfieldsSorted[$this->position] as $field ) {
      if ($field->layout_pos == myposition) {
          ?><div class="my-pos">Pago Con Tarjeta <span class="product-price"><?php echo $field->display ?></span></div>
          <?php
      }
       } }
       ?>
        </div>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Flasher

  • Beginner
  • *
  • Posts: 37
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #79 on: February 02, 2013, 01:32:31 am »
Hi again Pro. It worked well. I can see the price alignment but the CSS is the same. It doesn't appears like the Sale Price. Here is a screen.



[attachment cleanup by admin]

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10321
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #80 on: February 02, 2013, 17:52:24 pm »
Hi again Pro. It worked well. I can see the price alignment but the CSS is the same. It doesn't appears like the Sale Price. Here is a screen.



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


change the css

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

Flasher

  • Beginner
  • *
  • Posts: 37
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #81 on: February 02, 2013, 20:11:46 pm »
Hi again Pro. It worked well. I can see the price alignment but the CSS is the same. It doesn't appears like the Sale Price. Here is a screen.



TYVM sir!!! It's done!

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


change the css



Flasher

  • Beginner
  • *
  • Posts: 37
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #82 on: February 02, 2013, 20:50:28 pm »
Ok now that the CSS is working i'm having another issue. The Customfield Price is appearing Twice. I Remove the one from the exampled you gave me of default_customfields.php

and i'm doing everything on the the default.php of the template views. But i getting double custom fields on the screen.

Here is my code:

Code: [Select]
    <?php // Custom Field Precio
 if (!empty($this->product->customfieldsSorted['precio'])) { $this->position='precio'; echo $this->loadTemplate('customfields');    }   ?>

</div>
                  <?php
        if (!empty($this->product->customfieldsSorted[$this->position])) {
       
    foreach ($this->product->customfieldsSorted[$this->position] as $field ) {
        if ($field->layout_pos == precio) {
          
?>
<div class="PricesalesPrice">Pago con Tarjeta <span class="PricesalesPrice"><?php echo $field->display ?></span></div>
          <?php
      
}
       } }
       
?>

               
<?php ?>



[attachment cleanup by admin]

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10321
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #83 on: February 03, 2013, 15:37:49 pm »
did you set it up like a cart variant?

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

Flasher

  • Beginner
  • *
  • Posts: 37
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #84 on: February 03, 2013, 19:47:05 pm »
did you set it up like a cart variant?



No is not set like a cart variant. and i don't want it to be. It just a Information Price Field.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10321
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #85 on: February 04, 2013, 13:15:51 pm »
looks like its not removed from somewhere else

are you sure its not being called 2 times in your template?

Look here
http://forum.virtuemart.net/index.php?topic=90935.msg378890#msg378890

do you see where I changed the "normal" custom fields file to say
  if ($field->layout_pos != myposition) {

^^ that makes it NOT display in the regular custom fields
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Flasher

  • Beginner
  • *
  • Posts: 37
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #86 on: February 04, 2013, 20:40:07 pm »
Well i end it up erasing everything to start again. What is the best option to display the custom field.

On the viev folder of the template in the default.php file or in the default_customfields.php on the view folder of product details of virtuemart?????

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10321
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #87 on: February 04, 2013, 21:39:46 pm »
like this

http://forum.virtuemart.net/index.php?topic=90935.msg378886#msg378886


then do the normal in default.php

<?php
if (!empty($this->product->customfieldsSorted['mypos'])) {
   $this->position='mypos';
   echo $this->loadTemplate('customfields');
?>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

yagami

  • Beginner
  • *
  • Posts: 1
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #88 on: March 08, 2013, 23:54:02 pm »
hi
I want to move the product name above the image, I also want to move the description, selling price, cost and details below the image.
would help me a lot thanks.
I searched the views in tmpl ... quiesiera find the div and you can modify as html.

http://balanar.netii.net/

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10321
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« Reply #89 on: March 09, 2013, 04:36:20 am »
hi
I want to move the product name above the image, I also want to move the description, selling price, cost and details below the image.
would help me a lot thanks.
I searched the views in tmpl ... quiesiera find the div and you can modify as html.

http://balanar.netii.net/

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

http://forum.virtuemart.net/index.php?topic=92756.0
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)