VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: angel_sia on May 13, 2014, 10:51:34 AM

Title: default_relatedproducts
Post by: angel_sia on May 13, 2014, 10:51:34 AM
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 (http://1.grosauto.ru/index.php/praesent-vel-libero/amet-neque-detail)
Title: Re: default_relatedproducts
Post by: 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
Title: Re: default_relatedproducts
Post by: angel_sia on May 13, 2014, 11:16:23 AM
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
Title: Re: default_relatedproducts
Post by: angel_sia on May 13, 2014, 11:27:23 AM
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
Title: Re: default_relatedproducts
Post by: angel_sia on May 16, 2014, 14:31:35 PM
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.
Title: Re: default_relatedproducts
Post by: GJC Web Design on May 16, 2014, 15:58:09 PM
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