Author Topic: Product Page Fields For Templating  (Read 115568 times)

Robert_ITMan

  • Jr. Member
  • **
  • Posts: 82
    • websites developed and managed @ ourfingertips.ca
  • VirtueMart Version: 2.6.22
Re: Product Page Fields For Templating
« Reply #75 on: October 02, 2014, 16:09:02 pm »
in which file? I try to do that in my overide defoult.php but nothing.
from my earlier post
... productdetails/default.php is just like we have in category/default.php

MAKE SURE you are editing the files in your template! For example copy the file
FROM:
/components/com_virtuemart/views/productdetails/tmpl/default.php
TO:
/templates/(your template)/html/com_virtuemart/productdetails/default.php
www.ourfingertips.ca - websites developed and managed @ ourfingertips

Let me help you make the most of the technology at our fingertips

kelecz

  • Beginner
  • *
  • Posts: 49
    • Staffy
Re: Product Page Fields For Templating
« Reply #76 on: October 02, 2014, 16:40:32 pm »
Thank you. I did that.
So if I return settings in php to 10,4 it will work with that no matter of update?
staffy.mrpet.rs

Robert_ITMan

  • Jr. Member
  • **
  • Posts: 82
    • websites developed and managed @ ourfingertips.ca
  • VirtueMart Version: 2.6.22
Re: Product Page Fields For Templating
« Reply #77 on: October 02, 2014, 16:46:32 pm »
So if I return settings in php to 10,4 it will work with that no matter of update?
Yes exactly - do not edit your database table settings - instead format your display in your template overrides.
www.ourfingertips.ca - websites developed and managed @ ourfingertips

Let me help you make the most of the technology at our fingertips

kelecz

  • Beginner
  • *
  • Posts: 49
    • Staffy
Re: Product Page Fields For Templating
« Reply #78 on: October 02, 2014, 21:34:27 pm »
I 'll ask this way...
Mine Dimensions and weight code is:
Code: [Select]
<?php if (($this->product->product_length 0) || ($this->product->product_width 0) || ($this->product->product_height 0) || ($this->product->product_weight 0) || ($this->product->product_packaging 0)) { ?>
            <div class="Dimensions">

                <h4><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DIMENSIONS_AND_WEIGHT'?></h4>
                <?php
                
if ($this->product->product_length 0) {
                echo 
'<div>'.JText::_('COM_VIRTUEMART_PRODUCT_LENGTH').': ' .$this->product->product_length.$this->product->product_lwh_uom.'</div>';
                }
                if (
$this->product->product_width 0) {
                echo 
'<div>'.JText::_('COM_VIRTUEMART_PRODUCT_WIDTH').': ' .$this->product->product_width.$this->product->product_lwh_uom.'</div>';
                }
                if (
$this->product->product_height 0) {
                echo 
'<div>'.JText::_('COM_VIRTUEMART_PRODUCT_HEIGHT').': ' .$this->product->product_height.$this->product->product_lwh_uom.'</div>';
                }
echo number_format($this->product->product_weight1'.'',');
                if (
$this->product->product_weight 0)  {
                echo 
'<div>'.JText::_('COM_VIRTUEMART_PRODUCT_WEIGHT').': ' .$this->product->product_weight.$this->product->product_weight_uom.'</div>';
}
                if (
$this->product->product_packaging 0) {
                echo 
'<div>'.JText::_('COM_VIRTUEMART_PRODUCT_PACKAGING').': ' .$this->product->product_packaging.$this->product->product_unit.'</div>';
                }
                
                if (
$this->product->product_box) {
                
?>

                    <div class="product-box">
                   
                    <?php

and show me this:
..........................................................................
DIMENSIONS AND WEIGHT

10.0
Weight: 10.0000KG
..........................................................................
How can I put code to show me :
...........................................................................................
DIMENSIONS AND WEIGHT

Weight: 10.0 KG
...........................................................................................
We are talking about this code:
Code: [Select]
echo number_format($this->product->product_weight, 1, '.', ',');
                if ($this->product->product_weight > 0)  {
                echo '<div>'.JText::_('COM_VIRTUEMART_PRODUCT_WEIGHT').': ' .$this->product->product_weight.$this->product->product_weight_uom.'</div>';
}

Thank you in advance



staffy.mrpet.rs

Robert_ITMan

  • Jr. Member
  • **
  • Posts: 82
    • websites developed and managed @ ourfingertips.ca
  • VirtueMart Version: 2.6.22
Re: Product Page Fields For Templating
« Reply #79 on: October 02, 2014, 23:04:18 pm »
Look at it closely - I'm sure you would have figured this out yourself:
Code: [Select]
//replace echo '<div>'.JText::_('COM_VIRTUEMART_PRODUCT_WEIGHT').': ' .$this->product->product_weight.$this->product->product_weight_uom.'</div>';
//with this
echo '<div>'.JText::_('COM_VIRTUEMART_PRODUCT_WEIGHT').': ' .number_format($this->product->product_weight, 1, '.', ',').$this->product->product_weight_uom.'</div>';
www.ourfingertips.ca - websites developed and managed @ ourfingertips

Let me help you make the most of the technology at our fingertips

kelecz

  • Beginner
  • *
  • Posts: 49
    • Staffy
Re: Product Page Fields For Templating
« Reply #80 on: October 03, 2014, 01:06:51 am »
Dear Sir,

you are my hero! See http://petproba.konji.rs/konji/product-38-detail

I was really close...  ;D

Thanks again.

Grateful
staffy.mrpet.rs

lostmail

  • Jr. Member
  • **
  • Posts: 199
Re: Product Page Fields For Templating
« Reply #81 on: June 20, 2015, 00:22:06 am »
I have this peace of code in templates/mytemplate/html/com_virtuemart/productdetails/default.php :
Quote
<div class="stock-level"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?>

                     <?php
            $stato = "";
            $statotip = "";
            if ($this->product->product_in_stock < 1) {
               $stato = "nostock";
               $statotip = "Entschuldigung, wir haben derzeit keine Exemplare dieses Artikels auf Lager";

            } else {
               if ($this->product->product_in_stock < 5) {
                  $stato = "lowstock";
                  $statotip = "Sofort Lieferbar, aber nur noch wenige Exemplare auf Lager!";

               } else {
                  $stato = "normalstock";
                  $statotip = "Sofort Lieferbar!";
                     }
            } ?>
            <span class="vmicon vm2-<?php echo $stato ?>" title="<?php echo $statotip ?>"></div>

            <div class="stock-level">
            <?php

            if ($this->product->product_in_stock < 1) {
               echo  "Nicht auf Lager!";
            } else {
               if ($this->product->product_in_stock < 5) {
               echo "Wenige Exemplare auf Lager!";
               } else {
                  echo "Auf Lager!";
               }
            } ?>
            </div>

After update to VM 2.6.12 it seems the calculation does not work anymore and show false invormation.
A product with stock of 6 pcs and booked/orders 6 pcs has stock "0" - so it should be case 1 "no stock" but it shows that the product ist available and a green bar instead of red..

Why does my code not work proper ?
Joomla 3.x + VM 3.0.16

GJC Web Design

  • 3rd party VirtueMart Developer
  • Hero Member
  • *
  • Posts: 7442
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Product Page Fields For Templating
« Reply #82 on: June 20, 2015, 10:03:06 am »
and what when u echo it out is $this->product->product_in_stock  ?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

plyushchev

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Product Page Fields For Templating
« Reply #83 on: July 14, 2015, 20:50:54 pm »
Hello. How I can get ManufacturerCategory Name?

I create topic about this http://forum.virtuemart.net/index.php?topic=130744.0