News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

tag system for custom fields

Started by sadra, April 28, 2019, 18:55:02 PM

Previous topic - Next topic

sadra

Is there any solution to add a custom field to link to it's similar products like a joomla tag system?

For example I have a publisher field in my books custom field group, When a user click on a publisher name in custom fields list, show him all the book from the same publisher.


Ghost

You can wrap custom field value with a link like this:

JRoute::_('index.php?option=com_virtuemart&view=category&keyword=+&customfields[' . $field->virtuemart_custom_id . ']=' . $field->customfield_value);

This links to category view with custom field search applied.

Studio 42

Quote from: Ghost on April 29, 2019, 08:03:06 AM
You can wrap custom field value with a link like this:

JRoute::_('index.php?option=com_virtuemart&view=category&keyword=+&customfields[' . $field->virtuemart_custom_id . ']=' . $field->customfield_value);

This links to category view with custom field search applied.
You can but it's not optimized. My plugin use an index only, so bigger is the shop and faster is my solution compared to VM core. You can see here about text search optimisation in mysql https://hackernoon.com/dont-waste-your-time-with-mysql-full-text-search-61f644a54dfa

sadra

Quote from: Ghost on April 29, 2019, 08:03:06 AM
You can wrap custom field value with a link like this:

JRoute::_('index.php?option=com_virtuemart&view=category&keyword=+&customfields[' . $field->virtuemart_custom_id . ']=' . $field->customfield_value);

This links to category view with custom field search applied.

is it possible to only use this code for specified custom fields?

sadra

Quote from: Studio 42 on April 28, 2019, 19:45:39 PM
https://shop.st42.fr/en/products/shortcodes.htm
Go on bottom Demo page https://pro.st42.fr/en/android/acer-liquid-z6-plus.html and click TAGS : android for eg.

Thanks your extension seems promising, but I need a free solution for my project.

Studio 42

Sadra,
If you have a little shop, you can use the core as explained by ghost.
Add &customfields[45]=value
[/size]where 45 is the ID of your tag customfield

balai

I think that you need custom fields for assigning attributes and a filtering system for showing the products based on those attributes.

I am not aware of a free system, but if you are willing to spend a few pennies, please check the Custom Filters system.
https://breakdesigns.net/extensions/custom-filters

Studio 42

Balai, it dont want pay for it. And want Tags not filters.

AH

QuoteThanks your extension seems promising, but I need a free solution for my project.

Note everything can be free - unless of course your shop will also give away all the products it has for free!
Regards
A

Joomla 4.4.5
php 8.1

balai

#10
QuoteBalai, it dont want pay for it. And want Tags not filters.
If you don't want to pay, try to write a letter to Santa Clause, maybe he will get that one  :)
I don't see any difference between the tags and the filters, from functionality aspect.



Studio 42

Quote from: balai on May 20, 2019, 11:06:40 AM
I don't see any difference between the tags and the filters.
Tag are displayed inside products.
Filters are all tags, price, search ... displayed in category for eg. So more generic

Ghost

#12
Quote from: sadra on May 17, 2019, 23:06:08 PM
Quote from: Ghost on April 29, 2019, 08:03:06 AM
You can wrap custom field value with a link like this:

JRoute::_('index.php?option=com_virtuemart&view=category&keyword=+&customfields[' . $field->virtuemart_custom_id . ']=' . $field->customfield_value);

This links to category view with custom field search applied.

is it possible to only use this code for specified custom fields?

Yes, check the field ID, position or some other property.


// IDs of fields to show links for.
$tagFields = array(1, 2 3);


// Inside field loop.
if (in_array($field->virtuemart_custom_id, $tagFields)) :
echo '<a href="' . JRoute::_('index.php?option=com_virtuemart&view=category&keyword=+&customfields[' . $field->virtuemart_custom_id . ']=' . $field->customfield_value) . '">' . $field->display . '</a>';
else :
echo $field->display;
endif;

PRO

Quote from: sadra on April 28, 2019, 18:55:02 PM
When a user click on a publisher name in custom fields list, show him all the book from the same publisher.

Are you using the manufacturer field for something else?