Home › Forums › Basel support forum › Custom Fields, Brand | Year/Season | Gender
Custom Fields, Brand | Year/Season | Gender
- This topic has 7 replies, 2 voices, and was last updated 8 years, 3 months ago by Artem Temos.
-
AuthorPosts
-
September 1, 2016 at 8:36 pm #3418
olanygardsParticipantHello!
I would like to enter and show custom fields / taxonomies associated to a product.
Brand
Year/Season
GenderI have seen a plug-in that could do the job, https://sv.wordpress.org/plugins/types/
I can get these custom fields to show up when entering all the information, but I can’t show the info.
I also get an error message in the plug-in “Your theme’s template file for displaying Product items is missing custom fields.”
Do you know if this could be implemented in the Basel theme?
And if so, where I should look.
Thank you
September 1, 2016 at 9:14 pm #3423
Artem TemosKeymasterHello,
Thank you for purchasing our theme.
Unfortunately, we didn’t test our theme with this plugin and can’t say how it will work with Basel. But we suggest to use woocommerce product attributes functionality for this purpose. Just create some attributes (taxonomies) via Dashboard -> Products -> Attributes and associate them with products. Here is a documentation that may help you https://docs.woocommerce.com/document/managing-product-taxonomies/#section-3
Regards
September 2, 2016 at 7:05 am #3438
olanygardsParticipantThanks, that will hopefully work!
But Is is possible to control the display of each attribute?
Now everything is listed under Additional Information
I find that this is coming from
“<?php $product->list_attributes(); ?>” in additional-information.php
But can I make a selection here instead of showing all Attributes?
For example, “Season” attribute is only for us internally. This is not something we would like to show as a “tag” on the product page or selectable sort value in the shop listings. But just for us to be able to make selections to show these products as a group or slide.
Example that we wish to have a page with last Seasons products. Then use the selection Attribute “last year” for a special page. But we don’t want to show everywhere that some products are last years.
Also, I would like to be able to control how to display the information from the Attribute “Brand”.
In our case, I would like to show the value from the Attribute “Brand” on top of Product Title.
(See example: https://dl.dropboxusercontent.com/u/297430/Screenshot-2016-09-02-07_57_43.png )
Many thanks
Ola
September 2, 2016 at 4:24 pm #3449
Artem TemosKeymasterWe understand your request. But the problem is that you task may need additional customization, and according to Envato Support Policy in is out of our support scope.
Thanks for understanding.
September 2, 2016 at 5:28 pm #3455
olanygardsParticipantHello!
Well yes, I do understand that it will take some customization.
I will not ask for code or guide on that to do. But if you by any chance can point me in the right direction would be wonderful.
Like:
Check these files and look up on custom attributes or likewise.Highest prio is how to implement the attribute above the title.
I would love to get some minor directions.
(I just bought 6 month of extra support a few days ago, and I haven’t got any help before)
Thanks
OlaSeptember 2, 2016 at 6:11 pm #3458
Artem TemosKeymasterYou will find single product page code in the file
basel/woocommerce/content-single-product.php
. Just add the code that will display your attribute under the title after this line<div class="basel-scroll-content">
Probably you will find the necessary code on some of the following articles
https://wordpress.org/support/topic/how-to-pull-custom-attributes-for-product-on-shopcategory-page/
https://docs.woocommerce.com/document/display-product-attribute-archive-links/September 3, 2016 at 2:11 pm #3489
olanygardsParticipantPerfect, Thank you so much!
I used the following to display the brand above the product title.
—
<div class=”brandClass”>
<?php
$brandvalues = get_the_terms( $product->id, ‘pa_brand’);
if ( $brandvalues && ! is_wp_error( $brandvalues)):
foreach ( $brandvalues as $brandvalue ) {
echo $brandvalue->name;
}
endif;
?></div>
—(My attibute is called “brand” and I placed the code where your told me).
September 3, 2016 at 4:10 pm #3492
Artem TemosKeymasterWe are happy that you found the solution!
-
AuthorPosts
Tagged: Attributes, custom fields
- You must be logged in to create new topics. Login / Register