News:

Support the VirtueMart project and become a member

Main Menu

Product Page Fields For Templating

Started by PRO, November 03, 2011, 17:16:20 PM

Previous topic - Next topic

Robert_ITMan

#75
Quote from: kelecz on October 02, 2014, 15:58:44 PM
in which file? I try to do that in my overide defoult.php but nothing.
from my earlier post
Quote from: Robert_ITMan on November 08, 2013, 05:10:40 AM
... 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
WEBSITES @ OURFINGERTIPS
manage > develop > market > repeat

Save a lot of time and money when focused on building a website that works with marketing efforts to get more leads and sales from visitors.

www.ourfingertips.com

kelecz

Thank you. I did that.
So if I return settings in php to 10,4 it will work with that no matter of update?
[url="//staffy.mrpet.rs"]staffy.mrpet.rs[/url]

Robert_ITMan

Quote from: kelecz on October 02, 2014, 16:40: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.
WEBSITES @ OURFINGERTIPS
manage > develop > market > repeat

Save a lot of time and money when focused on building a website that works with marketing efforts to get more leads and sales from visitors.

www.ourfingertips.com

kelecz

I 'll ask this way...
Mine Dimensions and weight code is:
<?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:
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



[url="//staffy.mrpet.rs"]staffy.mrpet.rs[/url]

Robert_ITMan

Look at it closely - I'm sure you would have figured this out yourself:
//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>';
WEBSITES @ OURFINGERTIPS
manage > develop > market > repeat

Save a lot of time and money when focused on building a website that works with marketing efforts to get more leads and sales from visitors.

www.ourfingertips.com

kelecz

Dear Sir,

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

I was really close...  ;D

Thanks again.

Grateful
[url="//staffy.mrpet.rs"]staffy.mrpet.rs[/url]

lostmail

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 | VirtueMart 4.0.12 107771 | HORME3 PRO 1.9.6 / 2.0
VirtueMart 4.2.4 | Joomla 4.4.1 | PHP 8.1

GJC Web Design

and what when u echo it out is $this->product->product_in_stock  ?
GJC Web Design
VirtueMart and Joomla Developers - php developers [url="https://www.gjcwebdesign.com"]https://www.gjcwebdesign.com[/url]
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
[url="https://extensions.joomla.org/profile/profile/details/67210"]https://extensions.joomla.org/profile/profile/details/67210[/url]
Contact for any VirtueMart or Joomla development & customisation

plyushchev

Hello. How I can get ManufacturerCategory Name?

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