News:

Looking for documentation? Take a look on our wiki

Main Menu

VM 3.0.2 - custom fields - related products not working

Started by stawebnice, January 30, 2015, 21:30:44 PM

Previous topic - Next topic

stawebnice

Hi,

Please help...
I have VM 3.0.2 on Joomla 3.3.6 and I have added a custom field type related products with these settings:
http://imtp.me/8yxw02lj3

but when I save it, I get a  lot of warnings most  of them look like (only lines differ):

Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: Unfinished literal in ../libraries/joomla/form/form.php on line 1545

Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: xmlXPathEval: evaluation failed in ../libraries/joomla/form/form.php on line 1545

The custom field is saved but when I go to product and want to select it, it is not available in the custom fields selection...

Please advise what is wrong...the complete screenshot with warnings is attached...


GJC Web Design

warnings at least reported fixed on 3.0.3 - 3.0.4 already out -- updates are for a reason......
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

stawebnice

Hi,

Thank you. I made the update, but still I cannot see the custom field in the product settings even though it is in the list of custom fields. I deleted it and added it again in  the new version, but no change...when I open the custom field again, I get little more settings, so I save it again and still no change...
is there something wrong in its settings?
http://imtp.me/8yym02lj3.p

GJC Web Design

does it need a layout position?  has your template custom field positions?
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

stawebnice

I don't think so, because other custom fields do not have any layout position in their custom field settings and they do show up in product settings and in front end...

Milbo

This is valid for normal fields. They have a fallback.

But the customfield related products needs a position. The "default" position for the normal layout is "related_products".
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

stawebnice

Thanks, Milbo, but it did not work, so I contacted the template provider

stawebnice

I managed to  assign the related product in back-end, but they do not show in  front-end.,here is an example:
http://www.responsive.vintagelab15.com/webshop/zitten/eetkamerstoelen/design-stoel-caprice-tube-groen

here is the screenshot from the back-end: http://imtp.me/8z1o02lj3

GJC Web Design

but has your template a rel prod position?

echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'related_products','class'=> 'product-related-products','customTitle' => true ));
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

stawebnice

No, it was missing but I used your code and pasted it to templates/eshop/html/com_virtuemart/productdetails/default.php  like this and now it works!

Perfect, thank you very much!

tryout

I cannot see the related products too.
In my template related products are shown by this code in com_virtuemart/productdetails/default.php
if (!empty($this->product->customfieldsRelatedProducts)) {
echo $this->loadTemplate('relatedproducts');
    }

and the  com_virtuemart/productdetails/default_relatedproducts.php is
  <?php
    
foreach ($this->product->customfieldsRelatedProducts as $field) {
?>
<div class="product-field product-field-type-<?php echo $field->field_type ?>">
    <span class="product-field-display"><?php echo $field->display ?></span>
</div>
<?php }  ?>

I've tested some changes in the code and in my opinion the problem is
$this->product->customfieldsRelatedProducts
that isn't set (or something like this: I'm not a developer!)

GJC Web Design

if u are on VM3 then

if (!empty($this->product->customfieldsRelatedProducts)) {
   echo $this->loadTemplate('relatedproducts');
    }

is simply wrong - that is VM2 code - there is no default_relatedproducts.php in VM3

use

echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'related_products','class'=> 'product-related-products','customTitle' => true ));
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

tryout

Thanks! I feared it would be.
Now I can see the related products but under every name there is the same sentence: (italian language) "Prototipo personalizzato per i prodotti correlati"
Can I hide ii'
Thanks

GJC Web Design

by css if u can target it
empty lang constant if a lang constant
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

dslove

I'm using the below code for related products in my [custom] template, but somehow it's not working for me. Any clues?
I have created a nice tabbed product page with CSS & jQuery, but I'm kinda stuck here... :(


<div id="vmptab5" class="vmptab">
<?php
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'related_products','class'=> 'product-related-products','customTitle' => true ));
?>

</div>