Shopping Basket


 x 

Cart empty


Log In

Find Us Elsewhere

Forum Search

Keyword

Product Snapshot in details

  • Mx150
  • Mx150's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
8 months 3 weeks ago #3719 by Mx150
Mx150 created the topic: Product Snapshot in details
Hello and thanks for the great VM Product SnapShot plugin.
It works very well you have done great work.

Can you help me somehow to use this in Product details form.
I want to display a Product in detail? Is this possible?

Hope you can help me with this, thanks for any help.
Greetings

Please Log in or Create an account to join the conversation.

  • Mx150
  • Mx150's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
8 months 3 weeks ago #3720 by Mx150
Mx150 replied the topic: Product Snapshot in details
Would be great if i can use this {product id=10213}
here
/components/com_virtuemart/views/productdetails/tmpl

Hope you can help me with this and know what i mean. We can than add a product id in backend of the Product to display any product you want in the details page. I like to use it like this:

{product id=

<?php if (!empty($this->product->customfieldsSorted)) { ?>
<?php
$custom_title = null ;
foreach ($this->product->customfieldsSorted as $field){
if ($field->display) {
?><div class="product-field product-field-type-<?php echo $field->field_type ?>">
<?php if ($field->custom_title != $custom_title) { ?>
<div >
<div style="display:none;"><?php if ($field->custom_tip) echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png');
} ?></div>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span>
</div>
<?php
$custom_title = $field->custom_title;
}
} ?>
</div>

<?php } // Product Custom ontop3 end ?>
}

Then we can put a number in custom field and product will display.

Thanks for any help

Please Log in or Create an account to join the conversation.

More
8 months 3 weeks ago - 8 months 3 weeks ago #3721 by boggler
boggler replied the topic: Product Snapshot in details
If you want to display another product on the product details page, why not just used the Virtuemart related products? You can select any related products on the same page as the product custom fields.

Also you can use Joomla content plugins in the product description, so you can put {product id=10213} in the description. You need to enable this in the Virtuemart configuration.

It is a bit unclear what you are trying to achieve, you seem to be wanting to put the product in a custom field.

You could do it like this in the template:-
$text = shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'ontop'));
echo  JHtml::_('content.prepare', $text);

Then you could put {product id=10213} in a custom text field. But it is much easier just to use one of the methods I described above, so why go to that trouble?
Last Edit: 8 months 3 weeks ago by boggler.
The following user(s) said Thank You: Mx150

Please Log in or Create an account to join the conversation.

  • Mx150
  • Mx150's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
8 months 1 day ago #3734 by Mx150
Mx150 replied the topic: Product Snapshot in details
Hi thank you for the answer.

Ok i will try to explain what i really want to do, because i think you can maybe help me.

We have a page with much custom tools that allows users to become a vendor and sale product over virtuemart.
So we want to give the vendor a new custom field, where he can simply add the product id. for example 123
the output of the custom field in detail would than be looking like this:

{product id=123]

so the vendor can link other products of him in his own product. We cannot use related products for this because a user doesnt have access to the backend or this feature. So we want vendor to simply put a product id in custom field and the product appears in product details.

Hope you can help me.

PS: Thank you for any answer, the trick with {product id=123] in product description works.. but is not exactly what is perfect. So many thanks for this tip

Greetings
PS2: Will give you 5 star for sure on jed if you can help me with this.

Please Log in or Create an account to join the conversation.

More
8 months 19 hours ago #3736 by boggler
boggler replied the topic: Product Snapshot in details
Thanks for the explanation, it is much clearer now.

It seems to me that you could do this by editing the layout for the custom field display, which is in the file components/com_virtuemart/sublayouts/customfield.php.

On line 424:
case 'S':

you could add
case 'S': $customfield->customfield_value = JHtml::_('content.prepare', $customfield->customfield_value);

Then you should be able to put the code
{product id=123}

into a custom field of type 'string' and have the product rendered as the output of the custom field.

I am not saying that it is guaranteed to work, but I think there is a good chance.

Moreover you can override sub-layouts in your site template, so you can put this in a template override to protect it from being over-written if Virtuemart is updated.

Otherwise we could make a custom plugin to do the same for you, but we would need to charge for the custom programming work, although it should be a fairly simple piece of work so not particularly expensive.

Please Log in or Create an account to join the conversation.

Moderators: boggler
Time to create page: 0.459 seconds