News:

Support the VirtueMart project and become a member

Main Menu

Add text next to price

Started by JACUK, January 31, 2019, 19:13:17 PM

Previous topic - Next topic

JACUK

Hi,

Hope someone can help.

I have a number of products that have children to allow a drop down to select a specific product bundle, each with a different price.

All works fine. On the product page it displays the short description and then a price (which is the base price for the smallest bundle)

I want to  add text before the price, on the same line, before the price - ie "Prices starting at" and then displaying the price.

Where would be the best place to modify the code.

Thanks


JACUK

meant to include version 3.2.14

GJC Web Design

image? page? your desc is unclear to me
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

JACUK

Hi,

Sorry for lack of clarity.

Screen grab attached that should help clarify.

Thanks

GJC Web Design

depends entirely on your template but on mine it would be

          <?php
          
// Product Short Description
          
if (!empty($this->product->product_s_desc)) {
          
?>

          <div class="product-short-description small well well-sm">
          <?php
          
echo nl2br($this->product->product_s_desc);
          
?>

          </div>
          <?php
          
// Product Short Description END
  
// add additional text here - either a module position, hardcoded or VMcustom field

          
echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$this->product,'currency'=>$this->currency));
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

JACUK

Hi,

Thanks GJC - you have helped point me in the right direction.

I have modified the products.php file as shown below. I have just added the text I wanted to the line <?php  //echo  $rowsHeight[$row]['price'] ?>
It puts the copy above the price which is workable for now - just need to work out how to get it on the same line as the price.

Thanks again - my first joomla/virtuemart project so just learning my way around how it all works.

Julian

<div class="vm-product-descr-container-<?php echo $rowsHeight[$row]['product_s_desc'] ?>">
               <h2><?php echo JHtml::link ($product->link.$ItemidStr, $product->product_name); ?></h2>
               <?php if(!empty($rowsHeight[$row]['product_s_desc'])){
               ?>
               <p class="product_s_desc">
                  <?php // Product Short Description
                  if (!empty($product->product_s_desc)) {
                     echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 300, ' ...') ?>
                  <?php } ?>
               </p>
         <?php  } ?>
            </div>


Prices Starting From:-   <?php  //echo  $rowsHeight[$row]['price'] ?>
         <div class="vm3pr-<?php echo $rowsHeight[$row]['price'] ?>"> <?php
            echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$product,'currency'=>$currency)); ?>
            <div class="clear"></div>
         </div>
         <?php //echo $rowsHeight[$row]['customs'] ?>
         <div class="vm3pr-<?php echo $rowsHeight[$row]['customfields'] ?>"> <?php
            echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$product,'rowHeights'=>$rowsHeight[$row], 'position' => array('ontop', 'addtocart'))); ?>
         </div>

GJC Web Design

can't u add       Prices Starting From:-    to the lang constant of the price label and display the label  ( set in admin)
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

JACUK

Hi GJC,

thanks for the suggestion - at this stage not sure where to look for the price label to change it. When I get a few minutes will investigate.

Any pointers would be appreciated.

Thanks

Julian

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

JACUK

Hi,

Thanks Kelvyn.

Appreciate the links, etc.

I had used the language overides to alter the text on one of the buttons.

What I am not sure about is string would be for price and if there is one for where this appears on the page. All that is displayed is £9.95 for example no other text, hence why I am not sure what to look for.

If there was already text being displayed before the price then I could understand this solution.

A better screen grab is attached. Just want to get the words "Prices from-" on the same line before the actual price displayed.

Any further pointers would be much appreciated.

Thanks

Julian

GJC Web Design

COM_VIRTUEMART_PRODUCT_SALESPRICE
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