News:

Support the VirtueMart project and become a member

Main Menu

default_relatedproducts

Started by angel_sia, May 13, 2014, 10:51:34 AM

Previous topic - Next topic

angel_sia

Good afternoon.
Please tell me how can I customize the output in "default_relatedproducts" the following options product_sku + product_name + product_s_desc + manufacturer + product_price :-[

Quotedefined ( '_JEXEC' ) or die ( 'Restricted access' );
?>
        <div class="product-related-products">
<h4><?php echo JText::_('COM_VIRTUEMART_RELATED_PRODUCTS'); ?></h4>

<?php
foreach ($this->product->customfieldsRelatedProducts as $field) {
$db = JFactory::getDBO();
$qt='SELECT `product_price` FROM `#__virtuemart_product_prices`   WHERE `virtuemart_product_id` = '.$field->custom_value.'';
$db->setQuery($qt); $result = $db->loadResult(); $sena = $this->currency->getSymbol();

?>
<div class="product-field product-field-type-<?php echo $field->field_type ?>" style="text-align: left; float:left; width: 100%">
<span class="product-field-display" style="text-align: left"><?php echo $field->display ?></span>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span>
<?php echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $result) ?>

</div>
<?php } ?>
</div>

VM 2 joomla 2.5.20

http://1.grosauto.ru/index.php/praesent-vel-libero/amet-neque-detail
Joomla 2.5.20
Apache 2.2 + PHP 5.2 (php5.2)

jenkinhill

Peease explain exactly what you want to do. It seems you wish to add further data to the related products display by editing default_relatedproducts.php  ?

And please http://forum.virtuemart.net/index.php?topic=79799.0
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

angel_sia

Good again.
Yes I want to add the data from the associated goods.

Apache 2.2 + PHP 5.2 (php5.2)

!!! Tell me how to find the exact version of Virtuemart
Joomla 2.5.20
Apache 2.2 + PHP 5.2 (php5.2)

angel_sia

Quote from: jenkinhill on May 13, 2014, 11:05:20 AM
Peease explain exactly what you want to do. It seems you wish to add further data to the related products display by editing default_relatedproducts.php  ?

And please http://forum.virtuemart.net/index.php?topic=79799.0

I understand that these lines bring me the price.
Quoteforeach ($this->product->customfieldsRelatedProducts as $field) {
$db = JFactory::getDBO();
$qt='SELECT `product_price` FROM `#__virtuemart_product_prices`   WHERE `virtuemart_product_id` = '.$field->custom_value.'';
$db->setQuery($qt); $result = $db->loadResult(); $sena = $this->currency->getSymbol();

I would like the same thing that was for the other points.
product_sku, product_name,  product_s_desc,  manufacturer
Joomla 2.5.20
Apache 2.2 + PHP 5.2 (php5.2)

angel_sia

not really-then no one is going to help with this problem?

Make sure to add their observations.

In which case add what's where in the database.
#_virtuemart_products_ru_ru (product_name + product_s_desc)
#_virtuemart_products (product_sku)
#_virtuemart_product_manufacturers (manufacturer)
#_virtuemart_product_prices (product_price)


I would be very grateful for help.
Joomla 2.5.20
Apache 2.2 + PHP 5.2 (php5.2)

GJC Web Design

it is really unclear what you want.. but if it is to add the name, nmanufacturer etc then you need to extend that query to bring you those things from the tables
you know what the virtuemart_product_id is so then it is just simple queries like you show with the price

either one by one but better a joined query as faster

excellent tutoral here  http://docs.joomla.org/Selecting_data_using_JDatabase
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