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

special text in product detail if price is 4000,- and more?

Started by marvays, January 30, 2017, 13:51:40 PM

Previous topic - Next topic

marvays

hi.
now i try set in product detail page default.php this code:
<div style="color: #F44336;font-weight: 700;">
<?php
   if(empty(
$this->product->prices) > 4000){ 
echo JText::_('COM_VIRTUEMART_CART_FREE_SHIPPING');
}?>

</div>


what is bad? nothing show for me :(

J!2.5.28 and VM 2.6.22 and VM 2.0.14

marvays

ok . . . this work for me in product detail page:
<div class="Doprava" style="color: #F44336;font-weight: 700;">
<?php // zobrazení dopravy zdarma
   if ($this->product->prices['salesPrice']>=4000 ){ 
echo JText::_('COM_VIRTUEMART_CART_FREE_SHIPPING');
}?>

</div>


but not in category page. why?

GJC Web Design

try

<div class="Doprava" style="color: #F44336;font-weight: 700;">
         <?php // zobrazení dopravy zdarma
      if ($product->prices['salesPrice']>=4000 ){
      echo JText::_('COM_VIRTUEMART_CART_FREE_SHIPPING');
      }?>
         </div>
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

marvays

Quote from: GJC Web Design on January 30, 2017, 23:04:58 PM
try

<div class="Doprava" style="color: #F44336;font-weight: 700;">
         <?php // zobrazení dopravy zdarma
      if ($product->prices['salesPrice']>=4000 ){
      echo JText::_('COM_VIRTUEMART_CART_FREE_SHIPPING');
      }?>
         </div>

work it :)

i must change to:
<?php if ($product->prices['salesPrice']>=4000 ){ ?>
<div class="Doprava-kategorie" ><div>Doprava zdarma</div></div>
<?php } ?>

thx alot
           <?php } ?>

Milbo

You should use vmdebug, that makes it easier, then you would have seen that prices is always an array and never empty
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

marvays

now i try make this code for cart . . . (free delivery price - add products = price to free delivery for this order) :)

Milbo

You should use the right option for it. and not write your own stuff. There is the optoin "free shipment if price is higher than" doing anything for you.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

marvays

i know. But i have one website on joomla 2.5.28 and Vm 2.0.14