Author Topic: NO MORE THEME. 2.0 uses VIEWS (Layout Override)  (Read 151742 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
NO MORE THEME. 2.0 uses VIEWS (Layout Override)
« on: September 14, 2011, 21:28:43 pm »
2.0 does NOT use a "theme". It uses the standard Joomla "View".


The view folders are located
com_virtuemart/views/MANY_VIEWS_HERE


Doing a Joomla Template Override is easy.
Open the view folder you want to change, THEN, the tmpl folder.
COPY the "default.php"
THEN< follow the steps below.
In your JOOMLA template folder. You create a folder called  "html" then a folder called "com_virtuemart" in it.
Then for each view you want to override. Create a folder for it.
Then place your modified "default.php" an that views folder.
So , to override the product details page. You create YOUR_TEMPLATE/html/com_virtuemart/productdetails/default.php

Doing a Joomla Template override guarantees the view will use your modified default.php

FOR changing the css. What you do is copy the virtuemart css located in
com_virtuemart/assets/css/vmsite-ltr.css

THEN, add that to your joomla template css file. (or call it seperately, AFTER you put a copy in your Joomla template foler)
THEN, go to vmart configuration, and turn off virtuemart css

[attachment cleanup by admin]
I do NOT do development work for hire.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 8799
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #1 on: September 15, 2011, 05:01:12 am »
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ruigato

  • Jr. Member
  • **
  • Posts: 71
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #2 on: September 15, 2011, 19:12:02 pm »
hello

in the category view i manage to show category images via

Code: [Select]
echo $category->images[0]->displayMediaThumb("",true);
the output is the image with link to itself, can someone help me to link the image to the category?

I would like to do the same with the product images listings in categories, linking the image to de product details and not the standar modal image poput.

Thanks in advance

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #3 on: September 15, 2011, 19:20:17 pm »
You can try this

         // Category Link
         $caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

                     <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
                     <?php echo $category->images[0]->displayMediaThumb("",true); ?>


                     </a>
I do NOT do development work for hire.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #4 on: September 20, 2011, 20:06:16 pm »
Link the picture to the flypage from the category Page


<?php echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$product->images[0]->displayMediaThumb('class="browseProductImage" border="0"',false)); ?>
I do NOT do development work for hire.

Ellalex

  • Beginner
  • *
  • Posts: 5
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #5 on: September 29, 2011, 09:49:01 am »
Based on this "YOU CAN then choose it as the default in vmart configuration" I created my own productdetails view and changed the vmart configuration to have the one I changed as default.

So I thought this would be my default view for at least the new products so that I don't have to choose it every time I create a new product... but when I create a new product at Product Details Page field the "default" is selected and not the one I set up as the default in vmart configuration.

Is this how it works or am I doing something wrong? Do I have to choose the new one for all products I create?
   

Ellalex

  • Beginner
  • *
  • Posts: 5
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #6 on: September 30, 2011, 13:31:47 pm »
Lance, it could be coded.

BUT you can also choose related categories in each product

Related Categories works though I would prefer it to show this without me having to add them but anyway this works but I want to move it on another place on the view e.g. under Manufacturer in product-details view.

Anyone knows which code I should move there? I tried many ways but none seemed to work :(

Edit: Found it, had to move the code below to move custom fields on another place in productdetails view  ::)

Code: [Select]
<?php
if (!empty(
$this->product->customfields)) { ?>

<div class="product-fields">
<?php
$custom_title null ;
foreach ($this->product->customfields as $field){
?>
<div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field_type ?>">
<?php if ($field->custom_title != $custom_title) { ?>
<span class="product-fields-title" ><b><?php echo JText::_($field->custom_title); ?></b></span>
<?php 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_fields END ?>

PeterMK85

  • Beginner
  • *
  • Posts: 4
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #7 on: December 25, 2011, 16:43:40 pm »
For me one thing is missing:

The code for the measurements of the product (length/height/width/weight)

Anybody knows that?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #8 on: December 25, 2011, 17:20:43 pm »
For me one thing is missing:

The code for the measurements of the product (length/height/width/weight)

Anybody knows that?

http://forum.virtuemart.net/index.php?topic=92756.0
I do NOT do development work for hire.

flaterik

  • Jr. Member
  • **
  • Posts: 100
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #9 on: January 03, 2012, 02:08:03 am »
How to use this code on product detail page?
I try to use it but doesn't recognize <?php echo $product->stock->stock_level ?> and the image doesn't work

Product Stock Level Picture
                  <div class="paddingtop8">
                     <span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo

$product->stock->stock_tip ?>"></span>
                     <span class="stock-level"><?php echo JText::_

('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?></span>
                  </div>

infinart

  • Beginner
  • *
  • Posts: 40
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #10 on: January 03, 2012, 11:40:55 am »
ok. So how does one, like myself, with no PHP and very little html skill make the category pages look decent. I like my sites to be pixel perfect.
Are there pre-made php files that already style the page rather than the mess I see as in the attached image?

Rock on!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #11 on: January 03, 2012, 15:54:17 pm »
ok. So how does one, like myself, with no PHP and very little html skill make the category pages look decent. I like my sites to be pixel perfect.
Are there pre-made php files that already style the page rather than the mess I see as in the attached image?



sounds like you will need to buy a theme , or learn html/css

No other way around it
I do NOT do development work for hire.

flaterik

  • Jr. Member
  • **
  • Posts: 100
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #12 on: January 03, 2012, 16:05:46 pm »
[quote ]
Product Stock Level Picture
                  <div class="paddingtop8">
                     <span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo

$product->stock->stock_tip ?>"></span>
                     <span class="stock-level"><?php echo JText::_

('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?></span>
                  </div>
[/quote]

Someone can help me? I think i don't write very well my problem
The code that i post work on category page.
I want to put in productdetails but doesn't work.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10275
  • VirtueMart Version: 3+
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #13 on: January 03, 2012, 17:08:52 pm »
How to use this code on product detail page?
I try to use it but doesn't recognize <?php echo $product->stock->stock_level ?> and the image doesn't work

Product Stock Level Picture
                  <div class="paddingtop8">
                     <span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo

$product->stock->stock_tip ?>"></span>
                     <span class="stock-level"><?php echo JText::_

('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?></span>
                  </div>


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


I do NOT do development work for hire.

flaterik

  • Jr. Member
  • **
  • Posts: 100
Re: NO MORE THEME. 2.0 uses VIEWS
« Reply #14 on: January 03, 2012, 23:25:40 pm »
There i can't find Product Stock Level Picture!